To my surprise, I was able to do just that. While migrating, I had a goal in the back of my mind to get the first version out without using any React code. You can use any combination of UI frameworks, including React, Preact, Svelte, Vue, SolidJS, AlpineJS, and Lit. Next.js being “The React Framework” was a big selling point for me as React was and still is, the library I’m most familiar with and comfortable with. More performance comparisons can be found in Benchmarks. The same page built with React on Next.js contained 191 kB of client-side JavaScript. Not including the three third-party libraries used for comments, scroll spy, and copy to clipboard, I only had to write 106 total lines of client-side JavaScript to give this site all the interactivity it needs.Īfter minification and compression, there is only 3.9 kB of client-side JavaScript loaded for pages that include all those features. If your project falls into the second “application” camp, Astro might not be the right choice for your project… and that’s okay! Check out Next.js for a more application-focused alternative to Astro.Īstro leverages server-side rendering over client-side rendering as much as possible. The Why Astro? docs call this out in a few places.Īstro was designed for building content-rich websites. While Astro can do many things that Next.js can, Astro is built more for static websites. The only dynamic section of this site is the post comments, and I use a third-party FastComments for that. However, the needs of this site are free of any server-side-rendering whatsoever. With support for React Server Components coming down the pipe and the other work in progress in the app beta around static rendering, Next.js will continue to improve. While Next.js does a great job of bridging the gap between full-blown SPAs and static websites, there is still a fair bit of client-side rendering that happens with any site built on Next.js. I did a bit of reading through Astro’s docs and set up a demo app before fully committing to migrating over. That’s not to say I’m ready and willing to jump into any new framework or library I come across. This being my personal site, gives me the freedom to play with the new shiny toys as I discover them. With that, I don’t have the opportunities I once had to flex my coding muscles. While I worked as a front-end developer for many years, I’ve worked as an engineering manager since 2014. Part of the reason I built this site was to try something new and have a project that allowed me to write a fair bit of code. Why did I dedicate the time and effort to learning an entirely new framework and migrating this site? Well… Why Not? □Īre you currently using Astro? Are you thinking about using Astro? Let me know below in the Comments. Now that the dust has settled, I thought I’d write about why I switched, what I like, what I don’t like, and give some insight into what the migration looked like. Even more, I completely dropped React and went with native Astro components and vanilla JS. Maybe I should, so I can thank that person.Īs of two weeks ago, this site is entirely off Next.js and instead built with Astro. I have yet to go back to look for the exact post. That was until I was casually browsing either r/webdev or r/javascript and saw someone in the comments mention Astro. Since upgrading, I struggled with certain things and even considered moving off the app beta and back to the pages directory. I even upgraded to Next.js version 13 and opted into the app directory beta a month ago. Since then, I’ve made various changes and improvements to the site and kept pushing myself to find things to write about. However, I was excited and motivated to build a site from scratch and put my name behind it. (I remember when Dreamhost launched their one-click WordPress install). Now, I’m not saying what Next.js + Vercel were, and still are, doing are novel, as I’m aware there are similar frameworks and “one-click” hosting providers out there. Next.js + Vercel allowed me to build an interface in React and deploy it relatively easily. I’ve been “spinning up” websites since the late 90s, and I’m still amazed at how far things have come. I was very excited when I set out to build this site in 2021 and discovered Next.js.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |