Fork me on GitHub
#humbleui
<
2023-11-28
>
Ben Sless08:11:55

started a REPL via cider-jack-in, everything loads fine, but app window doesn't start

Ben Sless12:11:17

when I start the REPL via the python script it works fine, but not with CIDER

Niki17:11:55

python script also calls user/-main , do you do the same with cider?

Niki17:11:39

In there there’s ui/start-app! that actually starts the app

Ben Sless17:11:18

Hang on I feel a facepalm coming

Ben Sless17:11:04

all good 🙃

Niki17:11:23

Here, I extracted user/start from user/-main so you can start app without starting server repl https://github.com/HumbleUI/HumbleUI/commit/7dbc511c012f35ad83399576e1b8dc8c78481e20

Niki21:11:35

Ok hooks are in. Kind of a weird way to implement lifecycle methods but it works? WDYT? Hooks? Class-based?

Daniel Gerson13:11:03

Interesting to see you embracing React patterns. Makes sense given the original goals.

Niki13:11:30

This is just an experiment to see how ergonomic that would be

👍 1
lilactown17:11:26

I'd take hooks over classes (because they compose), and I'd take solidjs signals over hooks

Daniel Gerson13:11:19

Is there any reason why both models can't be supported by the lower substrate?

Niki14:11:59

I think signals work fine with React model, but then you still have to decide between classes or hooks, both of which are not exactly natural for Clojure

Daniel Gerson15:11:50

Thanks, no experience with signals (only briefly looked at SolidJs) so I find the evolution and discussion interesting.

Quest17:12:05

Is there a side-by-side comparison of code for classes vs hooks? I'm currently running a Datalevin database with an in-app event system. Whenever a screen begins transition, I reify its required state into HumbleUI's state-atom. In an ideal world, I'd pull data directly from the database inside a (dynamic ...) binding, but I haven't attempted this yet. With a surface level of understanding, I'm inclined to agree with lilactown's hooks > classes, but I'd have to understand what my downstream implementation will look like to provide good feedback.

Niki20:12:16

No comparison for Humble UI but there’re lots for React I think. E.g. https://www.bitovi.com/blog/react-hooks-vs-classes-the-ultimate-comparison

👀 1
Quest19:12:31

Reading through these, I'm reminded of trying an early release of Om Next many years ago. I didn't get far and left with a healthy fear of components, something I'd forgotten until now. I suspect hooks would be a more flexible way to handle reifying state. They seem like a better basis for implementing a closely woven re-frame style dataflow without being caught up in an intermediate layer of components. The functional flavor of HumbleUI's API has also been pleasant to work with & I'd like to retain that as much as possible.

Niki19:12:19

Yeah, Om Next was more complex than it needed to be

Quest01:12:03

I'd believe it. I chatted with a friend on hooks vs components but without a real conclusion. His complaints about hooks were that it breaks symmetry with the code tree, can be hard to debug when they break, & taints code. But that they usually "just work." He viewed components as more simple & self-apparent but not inherently better. The conversation reconvinced me that I still don't know enough to make a useful decision -- but I'll try moving my HumbleUI codebase over to latest HumbleUI main in the coming weeks & see what I learn.