Alright folks, let’s dive into one of the buzzwords of modern web development: 💧Hydration. No, it’s not about water bottles or staying healthy during coding marathons. In the JavaScript world, hydration is a key concept used in frameworks like Angular, React and many more. If you’ve never heard of it, no worries! Let’s break it down.
🏗 What is 💧Hydration?
Imagine you open a webpage. The page loads super fast, and everything looks perfect. But then, you try to click a button or interact with it—and nothing happens. Why? Because the page was just a "static" HTML snapshot.
Hydration is the process of activating that static HTML with JavaScript so it becomes interactive. Essentially, it’s JavaScript "rehydrating" the HTML, like pouring life back into it. It makes your website dynamic and functional, connecting all the buttons, forms, and animations.
It’s a commonly used phrase in a world of SSR (Server Side Rendered) apps.
Images taken from React Conf 2021.
đź’ˇ How đź’§Hydration works in Frameworks?
Let's have a look at the most popular frameworks utilizing different hydration types.
Feature | Angular | React | SolidJS | Qwik | Vue |
---|---|---|---|---|---|
Hydration Type | Incremental | Full + Partial | Granular | No hydration | Full |
Client-Side JavaScript | Moderate | Heavy | Minimal | Minimal | Heavy |
Resumability | No | No | Partial | Yes | No |
Top comments (0)