Day 24 hydratable
Christmas Eve is here! Santa's countdown app looks perfect — until you realize the server is in San Francisco and you're not. When the page loads, the time flickers like a candle in a winter storm. The server says one thing, the client says another, and suddenly your beautiful countdown looks like it got tangled in the tree lights!
Enter hydratable — Svelte's gift for keeping server and client in perfect harmony. Wrap your value in this low-level API with a unique key, and whatever the server computes gets picked up during hydration. No more flickering, no more timezone confusion — just smooth, seamless Christmas magic!
The real present? This works with promises too! Fetch data on the server, and the client receives it wrapped and ready — no need to make the trip to the North Pole twice. SvelteKit uses this under the hood for remote functions, but now you can unwrap it yourself for special cases.
And with that, our Advent journey comes to an end. From $inspect.trace() to hydratable, we've unwrapped 24 days of Svelte magic together. Have a happy Christmas, and thank you for following along!