@forever @joepie91 @arcade I know! I recently saved someone from "prerendering" the pages of their multilingual dynamic website using headless browsers and waiting for the XHRs of thousands of URLs then saving the DOM. Now they're doing the bulk of the work server side with simple templating and they're amazed that prerendering one page doesn't take 8 seconds anymore but a fraction of one
@alinanorakari @forever@fedi.nullob.si @arcade Possibly useful to keep in your back pocket for when talking to someone who is doing React and Node:
- https://gist.github.com/joepie91/c0069ab0e0da40cc7b54b8c2203befe1
- https://www.npmjs.com/package/@joepie91/express-react-views
@joepie91 @forever @arcade "cached for the lifetime of the server process" … "If you have database access or other async operations, they should be done in your routes." … "does not support mounting those views on the client"
I don't even know where to start. It's all needlessly convoluted and wasteful and many devs could be much less wasteful if they took the time to learn developing a proper approach with less abstracting tools. But that would require more time per money so let's be wasetful.
@alinanorakari @forever@fedi.nullob.si @arcade Huh? This is specifically about server-side rendering of templates, as an alternative to browser-side SPAs.
@joepie91 @forever @arcade neither of those two options are really desirable in any project with sufficiently complex data though, also writing templates for the static parts using JSX is total overkill. A solid server-side language plus a basic templating engine like mustache and a lightweight frontend framework like alpine.js can replace 90% of the react projects I've seen while being vastly more efficient server- and client-side, indexable by international search engines and _fast_
@alinanorakari @forever@fedi.nullob.si @arcade Like, to clarify: express-react-views runs on the *server* side, and functions like any other server-side templating library would