helix

https://github.com/Lokeh/helix
orestis 2020-07-14T06:38:47.326800Z

We gave up on local state, we now use it only for things like popup on/off.

orestis 2020-07-14T06:40:52.328600Z

We are using atoms and subscription to the atoms. It’s not really global (it’s in a var in a namespace) but you don’t have to think about passing dispatch functions around.

orestis 2020-07-14T06:41:29.329600Z

In practice it ends up being a stateful component that subscribed to state, and just renders a stateless one.

orestis 2020-07-14T06:42:15.330400Z

After a few rounds of polish I will document reseda a bit more and make a release of sorts.

Aron 2020-07-14T09:30:31.331700Z

That is another thing I could've done, to use clojurescript's own state management mechanism so I have access to easy debugging through the REPL. Even though I can manually extract react hook values through the react dev tools, it's not very convenient to do so repeatedly. Too much clicking.

lilactown 2020-07-14T15:18:39.332Z

interesting. we’ve done the opposite

lilactown 2020-07-14T15:18:54.332400Z

we started with a large re-frame app, and are adopting helix and putting most things in local state

lilactown 2020-07-14T15:19:29.332900Z

the only thing that doesn’t go in local state is routing (we already had a routing solution) and data from the backend

Aron 2020-07-14T15:23:48.333200Z

and how do you inspect local state during development?

Aron 2020-07-14T15:23:53.333400Z

are you using atoms?

lilactown 2020-07-14T15:24:35.334200Z

using React DevTools to find the component and then logging them to the console for inspection of the CLJS data

lilactown 2020-07-14T15:24:50.334600Z

or placing console.log’s inside the body of the component

Derek Passen 2020-07-14T15:25:29.335100Z

or tap> in shadow-cljs especially

Aron 2020-07-14T15:29:34.335900Z

@dpassen1 how do I use tap> to investigate the contents of a react hook? I have never used tap> before, I am not even sure what it is, people talk about it like it's common wisdom

Derek Passen 2020-07-14T15:29:52.336600Z

Just any place where console.log works

Derek Passen 2020-07-14T15:30:05.337200Z

shadow will send that to its inspect tab

Aron 2020-07-14T15:30:13.337500Z

@lilactown that's what I do, and (js-debugger) but it's extremely cumbersome and time consuming, I would not like to continue to debug like this.

Aron 2020-07-14T15:30:54.338200Z

@dpassen1 but that's the thing, console log is not adequate for this, I need to see live data from clojures without having to manually decorate it with calls like (prn)

Aron 2020-07-14T15:32:04.339600Z

What @lilactown says is very useful here because there is a top-down direction of selecting which components' which hook to inspect at any time when I have a breakpoint or anything. I am not aware that I can introduce new console.log calls when execution is suspended

Aron 2020-07-14T15:32:49.340500Z

it's just that the manual labor of selecting the component and clicking around to open the tree and inspect the values is like the least favorite way of any activity I could imagine doing at a computer 🙂

lilactown 2020-07-14T15:33:01.340700Z

hehe

lilactown 2020-07-14T15:33:30.341300Z

at some point I’ll come up with a design I like for looking up state at the REPL

orestis 2020-07-15T09:44:53.341500Z

ctrl-c ctrl-e 😛