DEV Community

Discussion on: Conquering JavaScript Hydration

Collapse
 
ryansolid profile image
Ryan Carniato

Most of these frameworks that add arbitrary bits of JS on top of HTML still need to "render" once to setup their reactive subscriptions as they are determined at runtime. Qwik actually does determine them at runtime but with the server acting as the one time it runs, and then serializes the subscriptions into the page. Marko uses compiler analysis to know the dependencies and serializes that.

But most of the motivation here is to provide a single app experience when authoring. Ultimately what happens is we let the user basically write a full JavaScript application. Picture like writing a React app. And then through build process we break it into the little pieces that need to be sent to the browser, and serialize enough data so barely anything actually runs on page load. From there using fine-grained reactivity (like what petite-vue or Solid has) we just update the parts that change, as needed on end user interaction.