hazybits

home16 April 2023

I love migrations

General

The short story why and how I migrated from Gatsby to Next.js. And I'm not going back.

From (Not The Greatest) Gatsby

Back in 2021 I decided to set up my personal blog.

I chose Gatsby because of its static site generation (SSG) capabilities that seemed to be ideal for a small blog. On top of that, there was (and still is) a free hosting in the Gatsby Cloud, automatically setup while bootstrapping the Gatsby project. Plus, I simply wanted to learn Gatsby.

And it was fun.

Until it wasn't.

After the initial excitement, as the time has passed, it was less fun than I wanted it to be:

  • Updating the framework or the plugins used was a nightmare. I continuously spent hours bumping the dependencies - usually by trying to decipher cryptic error messages.

  • Content layer queryable with GraphQL is an interesting idea, but it felt more and more like an overkill for a simple blog. I could see no real benefits but it surely made the whole setup more complex.

  • TypeScript support has been mediocre at best. I kept convincing myself one does not need TypeScript to write a blog. But I failed to eventually convince myself.

  • Built times were painfully long given I was bundling a site with just a few pages.

  • I don't feel like Gatsby is executing its vision well enough to bet on them long-term.

To Next.js (and not back again)

So here we are today - I eventually decided to migrate this site to Next.js (13.3). While I was not so happy with Gatsby, Vercel has been doing a great job in developing Next.js by adding more and more features. In the recent months, they really pushed the framework forward in an impressive way.

The migration experience

Migrations are usually not pleasant.

This time, the migration experience was okeyish. I create an empty project with create-next-app and manually migrated the files to fit the Next.js way of doing things. After some adjustments, it somehow worked. After more adjustments, it worked.

I also decided to add TypeScript, ditched @emotion/css in favor of Tailwind - although I still really like the DX of emotion, it's proven to be too powerful for my use case.

Thank you for your time.

I hope you enjoyed the post 😊.

If you'd like to discuss something in more detail or simply let me know what do you think, connect with me on Twitter or reach out via email.


Until the next one,
@catchergeese




Read more