Islands Architecture realised
This page is generated with Web Components - on the server!
Once the HTML/CSS is displayed, a tiny (few kb) script runs to detect which components YOU chose to be powered by JavaScript on the frontend.
That component's JavaScript is downloaded & executed without affecting any of the inert (static) DOM around it.
The following counter component is powered by a Web Component, but it can bootstrap and run itself whilst the rest of the page remains static 🤯