nanojsx / nano

🎯 SSR first, lightweight 1kB JSX library.
http://nanojsx.io
MIT License
1.44k stars 39 forks source link

Feature Request: Resumability? #124

Open renhiyama opened 1 year ago

renhiyama commented 1 year ago

Can you please take a look at https://qwik.builder.io/ ? They talk about Resumability feature, and it sounds pretty great, but they currently "build" and expose some different APIs which even makes it incompatible with original react projects... Can we see Resumability feature on nano ssr anytime soon? Preferably the "no build required" route? If possible I want to work with nano to support this feature too ☺️ Lemme know about anything More info: https://qwik.builder.io/docs/concepts/resumable/

Kapelianovych commented 1 year ago

It may not be possible with the current nano state.

First of all resumability requires the library to be able to fetch modules on demand which requires a special compilation to generate such modules. Qwik does such loading by propagating events to special handler which is able to determine which module to load. Those modules has to be separated into two pieces: logic and UI. UI shouldn't replace old nodes with identical ones to conduct true resumability. But as far as I know nano even in current state with implemented hydration just generates and replaces a non-interactive DOM tree with the same but interactive DOM tree. The hydrate function is just an alias to the render.