Say Goodbye to Gatsby and Hello to Remix
New Year. New Me. New Blog.
I rewrote my blog to use Remix. The latest hottest new full stack framework to hit Javascript. My previous version of the blog was using Gatsby.js. I decided to try this new framework out and try to rewrite my blog to see how it easy it was.
My original version of the blog was created on January 1st, 2021 and, as many Gatsby sites do, I had a lot of plugins. Plugins for parsing markdown files, highlighting code snippets, Google Analytics, various GraphQL plugins, plus lots of development dependencies.
Dependencies…a lot of dependencies
I counted all the dependencies up before this rewrite 29 third party dependencies in total. All this code that I needed to continue to upgrade and maintain for a simple blog that converts markdown in HTML.
Now, I’ve used Gatsby on a larger scale project at my last company and really enjoyed it. The plugin system and the community are pretty great. I’ve even contributed to Gatsby’s source code in the past.
You can find a plugin for practically anything. Just look up gatsby-
on npm and look at the number of results: 5,212 (as of 1/2/2022).
Why did I decide to rewrite the blog?
I’ve been trying to go through my open source projects and get them all upgraded to the latest versions. I want all the security patches updated and make sure they’re as relevant as possible. As part of that work, I looked at my own blog. I had a pretty old version of everything because I haven’t upgraded any in over a year.
- I tried upgrading one package, but it required a newer version of Gatsby.
- So I upgraded Gatsby.
- Now all the other
gatsby-
plugins broke, because they required the other version of Gatsby. - I decided to just upgrade everything to the latest. The app wouldn’t build because of some GraphQL issues. I checked the latest documentation and it was still using the code in the same way I was.
- I realized this dependency management is way too much for a simple blog application and decided I needed something simpler.
- Remix has been on my mind for awhile now. I follow the creators on Twitter and have been wanting to try it out on a project.
Remix benefits
After rewriting this blog using Remix, I’ve landed at 15 third party dependencies. For those keeping track, that’s about half the amount I had before. I still have the same functionality as before: I’m parsing markdown and turning it into HTML. I can highlight code snippets and I’m deploying my app to Netlify.
I still feel like 15 dependencies is a lot though. I really shouldn’t need this many for a blog app, but I feel like these 15 are way easier to maintain. I have separate plugins that do their little piece well. It’s feels like following the Unix Philosophy and it’s truly a breath of fresh air. I have a single library just for parsing markdown into HTML. I have a single library that pulls frontmatter out of a markdown file. These plugins can all be upgraded independently without breaking the others. Obviously, there are some plugins like React and Remix that have dependencies on each other, but nothing else does.
This feels like a huge weight off my shoulders. We all want to keep our applications up-to-date, but the npm world makes that hard. Remix simplifies that for us. It feels like I’m working with plain JS again. There’s certainly a lot of magic to Remix, but it’s good magic. It’s built in a way that you don’t need to worry about the magic. You see and have the ability to customize where needed and can ignore all of the internals that aren’t relevant. It’s extremely nice to work with. I do think Remix is headed in the right direction in terms of developer experience in the Javascript world.