4 ms·
You can get the best of both worlds with Gatsby plus gatsby-plugin-no-javascript. Gatsby inlines critical css and small images and does just about every trick a
by city41 6y ago
You can get the best of both worlds with Gatsby plus gatsby-plugin-no-javascript. Gatsby inlines critical css and small images and does just about every trick available to minimize page load, then the plugin kills the hydration. The plugin can run on a per page basis, so you can still keep your hydration on your pages that need them. For complex webapps that also have marketing/documentation/landing pages, it's a really nice combo.
Gatsby devs or advocates would argue removing the js removes the preloading of pages that helps make Gatsby faster. Although this is true, in my experience removing hydration is often a better trade off. It of course depends on the site.
- toinbis 6y agoHey! Sure - been there done that https://stackoverflow.com/questions/57556599/how-to-render-nearly-empty-page-without-any-overhead-with-gatsby https://stackoverflow.com/questions/57556599/how-to-render-n... :) Sapper, however, will not let you do that easily https://stackoverflow.com/questions/64507516/how-to-disable-spa-like-navigation-in-sapper https://stackoverflow.com/questions/64507516/how-to-disable-... . I think with next.js it's somewhere in between - possbile, but not easy. And I totally buy the approach of being able to use and mix both according to the needs. My personal favorite for html+css composition is to develop components with react, deploy them on bit.dev and render with react.renderToStaticMarkup in backend with express.js Turboeshop.com is made exactly that way. BTW, there is identical website to https://turboeshop.com/fastestpageintheworld/ https://turboeshop.com/fastestpageintheworld/ built with next.js(never mind the domain name): https://gatsbyeshop.com https://gatsbyeshop.com . Will update my initial comment as well.
- city41 6y agoI feel like we're in a transition period where we will eventually get both the nice developer experience and flexibility combined with nice performance. Gatsby gets there largely by accident and in a crude way. I'm hopeful over time all these tools will get there explicitly. It sounds like Remix might also be a nice catalyst in this department.
- toinbis 6y agoSo glad to hear someone else feeling that way :) Thanks a lot for sharing - feel exactly the same way. We'll surely get there, fingers crossed for that happening sooner! :)