helix

rafaeldelboni 2023-01-09T13:33:42.485679Z

Hi folks how you doing? First I wanna wish happy new year! I'm planning to use Helix in a production system in my current company and in my studies I liked to use https://github.com/ferdinand-beyer/refx for state management and I know @lilactown is working in something for this (I think is called https://github.com/lilactown/flex), but I'm afraid that both aren't production ready. What do you folks use for state management in production systems with helix? Do you think is a good choice using it for production systems? Sorry if this has been asked before.

Brandon Stubbs 2023-01-12T17:20:56.208329Z

@rafaeldelboni would love to hear your conclusion when you are ready

rafaeldelboni 2023-01-12T17:48:26.237269Z

I've been using refx for a quite while for pet projects, I'm really keen to try it in production and if anything goes super wrong do a personal fork or so, my only fear is the lack of useful tools like https://github.com/day8/re-frame-10x or https://github.com/flexsurfer/re-frisk, but you always can use the repl inspection or a https://github.com/rafaeldelboni/helix-refx-playground/blob/main/src/app/core.cljs#L72 on the db atom ๐Ÿ˜ฌ But I will still discuss with my team, @corasaurus-hexโ€™s suggestion of using react default tools are appealing for me as well.

๐Ÿ‘๐Ÿป 1
alexdavis 2023-01-10T17:39:20.067919Z

Personally Iโ€™ve really liked offloading (almost) all global state to tanstack-query, https://tkdodo.eu/blog/practical-react-query is a really good resource if you want to go down that path (and Iโ€™d definitely recommend it)

๐Ÿ†’ 1
Cora (she/her) 2023-01-09T15:08:41.180749Z

I'd just use the built-in react state management hooks

Cora (she/her) 2023-01-09T15:10:30.411309Z

use-state/use-reducer/use-context/use-ref

๐Ÿ†’ 1
dodo 2023-01-10T04:12:35.644569Z

I use refx for global state , use-state for local state management, and react-hook-form for reducing the use of state management.

๐Ÿ†’ 1
dvingo 2023-01-11T14:55:32.346129Z

I've been combining fulcro for state management + transaction management with helix and subscriptions for UI updates. example https://github.com/matterandvoid-space/todomvc-fulcro-subscriptions fulcro has a "remote" abstraction which is where features similar to react query are implemented for example - retry failed https://github.com/fulcrologic/fulcro/blob/71ed79c650222567ac4a566513365a95f12657e3/src/main/com/fulcrologic/fulcro/networking/tenacious_remote.cljs

๐Ÿ†’ 1
dvingo 2023-01-11T16:16:47.123069Z

I'm curious though, @alex395 what benefits do you get from using cljs vs js/typescript with your stack? any tradeoffs you lose from doing so? in short: why not just use js/typescript?

Brandon Stubbs 2023-01-11T16:18:54.801979Z

@danvingo @alex395 I am curious too. At the moment I am using react-query, react-table and nivo charts on an app and I feel I am not gaining a lot using Clojurescript. I wanted to stick with it to see if I have an aha moment this is what makes it so much better

Cora (she/her) 2023-01-11T16:19:29.697769Z

I can vouch that typescript is so so so good on front-end

Brandon Stubbs 2023-01-11T16:20:08.715279Z

@corasaurus-hex do you normally write typescript components to be used with Clojurescript via interop? Or you just use vite/next depending on the app youโ€™re building?

alexdavis 2023-01-11T16:20:11.871179Z

Sometimes the whole team knows clojure and if the frontend is in clojurescript itโ€™s easier to stick to one language for frontend and back, but to be honest if there are people in the team who know or are happy to learn typescript I think I prefer that over cljs these days

๐Ÿ‘๐Ÿป 1
Cora (she/her) 2023-01-11T16:20:37.402289Z

nah, I don't typically use clojurescript w/ typescript. I barely use cljs, really

1
Cora (she/her) 2023-01-11T16:22:11.811269Z

I think the big win is the fact that there a million front-end APIs, and front-ends end up very complicated, and so having types to guide you is a huge help. I'm sure I'd choose cljs over just js without typescript

alexdavis 2023-01-11T16:22:55.097969Z

If you are heavily using js libs and donโ€™t like all the interop squint is quite an interesting concept, you can write code that interacts with js libraries pretty seamlessly, hereโ€™s a quick example I was playing around with using react query and graphql subscriptions https://github.com/armincerf/squint-chat/blob/main/src/Comments.cljs

Cora (she/her) 2023-01-11T16:23:21.678889Z

squint is so great! (full disclosure: I work on squint)

2
Brandon Stubbs 2023-01-11T16:24:27.350699Z

Yeah I love squint, contributed to it, itโ€™s just too cutting edge for production use on the particular app I am making

Cora (she/her) 2023-01-11T16:25:04.459029Z

I can definitely understand that

rafaeldelboni 2023-01-11T16:27:02.733259Z

I'm really excited with squint, last time I checked I just missed repl support, but is super promising

Cora (she/her) 2023-01-11T16:29:34.983069Z

cherry is really cool, too, fwiw

2
Cora (she/her) 2023-01-11T16:29:46.132839Z

one of its sister projects

Cora (she/her) 2023-01-11T16:32:03.427719Z

also I can't recommend enough just pairing with someone who knows TypeScript to get up to speed. it helps so much

dvingo 2023-01-11T19:16:48.559219Z

thanks for your replies! It's good to hear about different setups. If you're sending json over the wire, talking to http servers I'm not sure anymore that cljs is the right choice. I still use it when I can send transit over the wire and have a pathom backend though.

rafaeldelboni 2023-01-11T19:34:35.177559Z

Exactly thanks for all the inputs, I will spend some time thinking and reading about everything said in this thread ๐Ÿ˜„