Framework showdown
One shopping list, built eight times: with Jeasx, Preact, Lit, HTMX, Alpine.js, Vue, Svelte and React. Every version starts as the same HTML form from the server. The difference is how much JavaScript each one needs to make it interactive.
All eight share the same update logic, the same styles and the same state: a cookie on the server. Without JavaScript, every form posts to the server and keeps working. With JavaScript, each framework takes over in its own way: Jeasx runs the same JSX component from the server in the browser and renders each change itself, HTMX swaps in HTML from the server, Preact, React, Vue and Svelte hydrate, and Alpine.js and Lit replace the server HTML with their own templates.
Each card shows how much JavaScript it downloaded, sorted from the smallest bundle to the largest. Throttle the network in the dev tools to feel the difference, or turn off JavaScript to see that nothing breaks.
Jeasx
… KB JSIsomorphic JSX: the browser runs the same component as the server and renders each change itself.
Preact
… KB JSThe React model in a smaller package: rendered on the server, then hydrated.
Lit
… KB JSA web component without hydration: the server renders the same Lit template, Lit replaces it with a live one.
HTMX
… KB JSThe form is sent in the background, and the server answers with the new list as HTML.
Alpine.js
… KB JSThe server renders the markup with x- attributes, Alpine renders the items again from its template.
Vue
… KB JSA single-file component, rendered on the server, then hydrated.
Svelte
… KB JSCompiled away: rendered on the server, then hydrated with small generated code.
React
… KB JSRendered on the server, then hydrated.