Framework: React
Bundler: Vite
Routing: Tanstack Router
- User makes request to
/
or/about
- Request hits a Cloudflare Worker, prerendered HTML gets sent back instantly, at the same time the request gets forwarded to a Lambda function
- Browser receives the prerendered HTML and it gets displayed to the user
- Browser makes the necessary requests for static assets and JS for hydration, page gets repainted and the button gets hydrated
- Cloudflare Worker receives server rendered HTML from the lambda and streams it down to the browser
- Dynamic content gets injected to the HTML document, page repaints, and potential hydration happens
- Done
Inspired by https://github.com/threepointone/react-ppr-workers