Zero client-side JavaScript by default. But you then have the ability to optionally go in and hydrate individual components that need them. So some sort of image carousel or something with interactivity, maybe client-side data fetching. You can opt into that on a component-by-component level.
This is something that we get for free because we've actually changed the way we think about what you're building. It's not one big JavaScript application that you build with Astro, you're actually building a website, a website that follows something called islands architecture.
So this was a term coined by Jason Miller of Preact and Google fame. And it's all about thinking of your website not as one big application, but as a series of components on the page, some of them statically rendered zero client side weight, but others can then be hydrated individually almost as isolated islands from each other.
So instead of one big application, you have many small, almost mini applications, mini React components rendering individually and isolated from each other. So not blocking each other, smaller components kinda hydrate themselves much faster, while maybe a slower larger one takes a little bit. They're all isolated from each other and hydrate as progressively as they load.
This is something that we get for free by thinking in this way. This idea of islands and components and an actual HTML-first output. That's the superpower of Astro.
So to recap, Astro is a modern way to build faster websites. By default, everything you build with Astro serves zero client-side JavaScript by default. Everything is HTML-based and HTML-focused, but with the ability to opt-in to different components for client-side rendering. So you can use React on the server, you can use it on the client, you can do both. You can mix it into your markdown. You can do all these things on a component-by-component basis that are really difficult to do in other frameworks.
And that idea of opting into individual components for hydration instead of sending down an entire application, that is a superpower of partial hydration that is at the backbone of what Astro is all about.
So one of the downsides of recording this talk so much farther in advance is I actually don't know what the state of this project will be when you watch this video. I can't commit to anything right now but what I will say is check out astro.build for an early preview of what we're working on. We can't wait to get this out into your hands and to see what you build with this new way to build websites using partial hydration and react components on the server. Hope you've enjoyed this talk.
Comments