Well, I’ve rewritten my blog again. This time I’ve used Astro. Its faster, simpler and way lighter as compared to the likes of Gatsby and Next.js. They’re really good, don’t get me wrong, but the complexity and the feature-set of these more mature frameworks are not needed for a simple blog application. All I do is just write my blog in Markdown and push to Github.
Astro does a few things really good. First of all, it outputs HTML, CSS and a tiny amount of Javascript. Now I realise the others also do the same where almost all of the page data is server-side rendered, however what Astro does is include only the bare minimum amount of Javascript. For example, if we’re including a button with a click event on it in Gatsby or Next.js, or any other similar framework for that matter, they will include the click handler with a bunch of bundled code that is required to render the page and all the components in it. What that results in, is a bunch of code that is there just for compatibility and nothing else.
Secondly, with Astro, you are not limited to just React, you can use any UI Framework of you choice, be it React, Preact, Svelte, Vue, SolidJS, AlpineJS and Lit. Read more here. Or you can also use any Framework of your choice, read more here.
At the end of the day you can still choose to do compile time render everything or client side call some of it as you choose. You still get the benefit of working with a dynamic framework instead of manually writing plain HTML, CSS and Javascript.
As I aleady metioned it’s lighter, faster and simpler. And all of this for the one single goal of making my website as quick and slick as possible. Hope this lasts a while.
じゃあまたね