DEV Community


Discussion on: Is 0kb of JavaScript in your Future?

132 profile image

Partial hydration sounds more like SSR of micro frontend, and Astro is also like an implementation of micro frontend.

ryansolid profile image
Ryan Carniato Author

Manual Islands like Astro are like Microfrontends more or less. They got here for a different reason. The goal instead of split ownership is to maximize the amount of static parts outside of the island. In a sense, a team might own that static part so it's a bit different. You could use the same technology but this is less concerned with how you stitch it together as much as ensuring least JS is sent.

Partial Hydration is different though. You literally write a single app. Like picture writing a normal React app (minus client-side routing). All your code is written in JSX the whole tree using React components. And then you run npm run build and the bundle automatically realized that most of your code never updates so it doesn't need to send it to the browser. It can move down the tree from the root eliminating components that never have props that update and aren't stateful themselves until it has isolated a few micro apps inside the main app to bundle.

It is like Islands or Microfrontends perhaps in what you get out of it but it's not a way of splitting up dev. It's quite the opposite. You wrote a single app experience.