The way that is achieved is pretty neat, Next.js has a <Document />[1] component that you can extend. This Document is essentially your application shell that is used when server side rendering.
Here is the trends Document component[2] where you can see I'm simply omitting `NextScripts` which ends up being the frontend bundle with react + application code
I'd seen references to next before this but never really dug in deep enough to get a sense of whether it was worthwhile. Thanks for giving it enough context to show how cool and accessible next is.
It's certainly interesting. This kind of development has gone full circle where the methodologies are back to where it was years ago.
The issues that really large JS bundles can cause are really hard to solve (bloated sizes, but also parse time of the bundles). There are a lot of tools to help mitigate those like code splitting, but it's really challenging once things get big.
When I wanted to achieve a 100 in my chrome performance audit, I simply couldn't include React.
I think React adds a tremendous amount of value from the ecosystem, the constant improvements and updates .. and the mindset that developers have when building out react applications. (component model, etc)
I think for any really large application with lots of client side interactions or async data / data management, my solution would become unwieldy.
But for smaller applications that maybe don't need to do as much, (in the above case we're simply registering some event listeners to submit a form) or landing pages or the like .. the above solution would work very well.
If I understand correctly you could build something like that but I'm not currently persisting any data from github which is something I'd need to add first.
I'm simply getting this data from Github and then caching the rendered result on the cloudflare CDN layer, the rendered page data in memory in node, and additionally the GraphQL query in memory
I'm in the process of migrating my companies RTE from Slate to Lexical.
I've been able to remove thousands of lines of custom code and increase the performance and reliability