Some thoughts and questions about Hilla and React

Rather than useLoaderData, I would look for something that integrates with signals so that the loader automatically triggers again if any relevant signal value changes. I did one exploration on that topic in RFC: Signal-based view state management but I haven’t investigated that topic further since then. If we go that route, then we might eventually move away from React Router or maybe use it mainly for some low-level bookkeeping and for backwards compatibility.

Updating to React 19 is mostly a matter of staying up-to-date. There isn’t any specific new feature that we plan start using. use(Promise) looks tempting but it turns out to be quite tricky to use. That’s because it triggers Suspense which in turn leads to discarding the state of the component that was about to be rendered. This basically means that you have to use some additional mechanism to cache the promise instance so that you can get the result from it once the component renders again.

React Compiler is to my knowledge mostly a way of fixing the same things that signals help with so that’s not very relevant for typical Hilla use. RSC also doesn’t seem applicable since running JS on the server basically defeats the purpose of Hilla.

1 Like