humbleui 2025-03-26

I'm thinking of building something using HumbleUI and playing with the examples a bit. Is there a way to configure things so that when I make a change to a component and eval that component in the repl, it immediately triggers a re-render of it? I can't find a good way to do it right now. Bonus points if the re-render doesn't lose state like scroll position, etc.

Not really. I am using clj-reload to do correct state-aware reload

Would it be viable to set every node in the tree as dirty and then request a frame? (so far I don't know how to get ahold of any node object...)

I'm doing a ui for a larger project and don't want to try to integrate all of that with clj-reload. I tried a while ago but I think I ran into problems using that together with virgil for hot-compile-reload of java sources.

It’s hard to say what is required, need to try and see if it works

Might be some gotcha between e.g. vars vs values

Just looking deeper into how things work, it seems like I'd need to create a component that force-rebuilds the components under it since it looks like the hiccup-like format is a stack of constructors that probably isn't how the live system is being rendered...

I may stick with my initial naive approach, which is to swap the current pane, sleep 40ms and then swap back to force a re-render.

Also you might try using var, e.g. [#'comp ...args] instead of [comp args]. You’ll still need to force a re-render (no watchers there) but it might solve the problem of stale components

I'll try that