From Gatsby to Eleventy
I try not to rebuild my site too frequently, as it's one of the classic blunders, alongside getting involved in a land war in Asia. But the Six-Year Itch is real, and it was time for a change.
The (Not So Great) Gatsby
My site has been powered by Gatsby since Dustin Schau (former coworker and Gatsby emeritus) ported it over as an early Christmas gift in 2018. I'm not a React guy, but it was easy to work with, and I could see the appear of a framework built around collecting arbitrary sources, and unifying them into a single data structure queryable by GraphQL.
Unfortunately, Gatsby isn't in the healthiest state these days. It wasn't able to achieve the liftoff that's expected from venture-funded frameworks. As it's fallen out of favor in the past few years, the OSS side of the framework has continued to languish since its acquisition by Netlify. Lately, I've spent more time fighting with dependencies than I do blogging, and it's felt more like a mill around my neck than a productive authoring tool.
Turning it up to Eleventy
I wanted to switch to something that's built for the long haul, and Eleventy fits the charge.
Created by Nebraskan (and former coworker) Zach Leatherman, it's a static site generator with a focus on simplicity, sustainability, and not getting in your way. It's heavily inspired by Jekyll, which was how my site was built ten years ago, so it feels like I've come full circle.
In addition to its familiarity as a tool, I appreciate what the Eleventy project prioritizes. Rather than a laundry list of features mean to check boxes, Zach advertises how stable its API is and how easy upgrades are, with major versions focused on removing dependencies and modernizing the codebase. I trust Zach when he says he doesn't tie Eleventy to a bundler, because he wants it to outlive the current bundlers.
Zach has also been at the vanguard of working through sustainability models for Eleventy, as it's been maintained as an OSS passion project, to one funded by VC-backed companies, to a crowdfunded model. It's currently found a home at Font Awesome, which feels like it's finally aligned from its values, and has a history of stewarding open source projects such as Shoelace/Web Awesome.
With the recent 3.0 release of Eleventy (now powered by ES Modules), it felt like a great time to start fresh.
From WebC to Shining WebC
I didn't want to lose out on the component model when moving off Gatsby. I've struggled with the template-first model that Jekyll, Hugo, and other SSGs use when it's not driven by a framework. And while I really like Web Components, it didn't feel like the right tool for a primarily static site, without building my own server-side rendering framework along the way.
WebC is a new authoring format, loosely coupled with Eleventy, and hit the sweet spot. It's got a similar feel to Single File Component models popularized by Vue and Astro, but it outputs markup akin to Web Components. Using WebC, I was able to rebuild most of the Gatsby components, and not feel like I was spaghettifying my codebase.
I'm using "Web Components" loosely here, as the markup is highly configurable. Most of the components simply get converted into the HTML they encapsulate, and are never generated client-side or extend HTMLElement
.
But if you want to render components as "real" Custom Elements with Declarative Shadow DOM, you can do so!
I'm hoping WebC sees a life beyond Eleventy projects, because it feel like a utilitarian tool designed for real problems. As it stands, this is probably the part of the codebase that's most tied to Eleventy, but if I have to rebuild the dozen-ish .webc
files at some point, it shouldn't be too difficult to port to a 'vanilla' Custom Element, or whatever comes next.
Four Hundo Blaze It
It's not all conceptual benefits, one immediate advantage I see are improved build times (production builds are 2-3x faster, and the dev server starts immediately, rather than after ~30 seconds).
I've done little to optimize the site. Yet without much effort, I'm awful close to the coveted Lighthouse Four Hundos:
This is in stark contract to my Gatsby blog; I had to do quite a bit of work to make it perform like I wanted, including applying a plugin to delete all the client-side JavaScript used to hydrate components that should have been static anyway.
The site is fast by default, and the URIs remain Cool. A few features are missing from the Gatsby era (namely, custom OpenGraph images), but I feel like I've got a solid foundation to iterate on.
It feels good, like I'm working with the grain of the Web, rather than against it. The codebase is at https://github.com/mattdsteele/steele.blue. Here's to the next six years (and beyond).
- From Gatsby to Eleventy - 2024
- Mutation Testing with StrykerJS - 2024
- My favorite water bottles - 2024
- Web Push is almost usable with iOS 17 - 2023
- I wired up my bike's GPS to order me pizza during a gravel race 🍕 - 2023
- Running a Playwright script on AWS Lambda - 2023
- Overly Complicate Starting Your Vehicle, Using Home Assistant, an ESP8266, and a Spare Car Fob - 2023
- Generating Custom OpenGraph Cards with Gatsby and the 11ty Screenshot Service - 2023
- Keeping your Fediverse followers when moving Owncast servers - 2023
- Running Owncast with Hardware Acceleration on a Raspberry Pi 4 - 2023
- Vite is Neat - 2023
- Serverless Bike Tracking with a SPOT Tracker, AWS Location + Friends - 2022
- Advent of Code as Soulcraft - 2021
- Gravel Worlds - Long Voyage - 2021
- Making a Raspberry Pi Photo Booth with Pibooth, NeoPixels, and Giant Buttons - 2021
- 3 Things I Learned Trying out the JavaScript Temporal API - 2021
- Green Screen Zwifting with retroreflective fabric - 2021
- Getting the PPPoE Credentials from your C4000XG without calling CenturyLink - 2020
- Setting up a Livestream with Owncast - 2020
- Indieweb Livestreaming your Wedding with Owncast - 2020
- Maybe mashups in 2020 are just Jamstack sites - 2020
- Secret Strava - 2020
- <bt-device> and Renderless Web Components - 2020
- Building Fast, Tiny GitHub Actions with Go and Docker - 2019
- Why I Built Blumhouse to Purge My Twitter History - 2019
- Toolchainless - 2019
- Web Components Aren't Weird Anymore - 2018
- JavaScript Gardening with the Particle Photon - 2018
- The Neverending Side Project - 2018
- Light Up Your Bike with Web Bluetooth and StencilJS - 2017
- Every Java Developer Should Learn TypeScript - 2017
- Web Bluetooth Is Your New Squeeze - 2017
- Building Custom Elements That Work With AngularJS 1.x and Angular - 2016
- How to Run a Board Game Library At Your Conference After-Party - 2016
- The Languages Which Almost Became CSS (Recap) - 2016
- Upgrading to Angular 2 using ngUpgrade - 2016
- Reacting to Heart Rate and Bike Sensors With RxJS - 2016
- Driving an LED Light Strip with Heart Rate and Bike Sensors - 2015
- Bringing ArnoldC to JavaScript - 2015
- Source Maps in 2015 - 2015
- We're hosting a JavaScript conference! - 2015
- Building a Handcrafted IR Blaster for Arduino-Powered Bike Lights - 2014
- Responsive Images using <picture> and srcset/sizes - 2014
- Responsive Web Design Workshop at Interface - 2014
- Hardware is the new Geocities - 2014
- Go(lang) for Broke - 2013
- Clickbait HTTP Status Codes - 2013
- A fresh coat of paint - 2013
- Exploring the Device APIs - 2013
- Diving into the Device API - 2013
- Unit Testing JavaScript when you're Afraid of JavaScript - 2013
- What Zelda Taught Me About Front End Engineering - 2012
- Unit Testing in JavaScript with Jasmine - 2012
- Town Tester - How well does your city unit test? - 2012
- Zen and the Art of TDD - 2012
- Lessons Learned from the first Hack Omaha - 2012
- I have a cameo in The Clean Coder - 2011
- Test-driven source code formatting - 2011
- Scramble Squares puzzle game solver - 2010
- Omaha Public Library card symbology - 2010
- Now this is a story all about how my bike got flipped, turned upside down - 2009
- The King of Kong - A Fistful of Inaccuracies - 2008
- Inelegant code affects your reputation - 2008
- Unintended consequences of the Internet - 2007
- Screen scraping Google Spreadsheets exported as HTML - 2007
- UI designs in Leopard that I really hope grow on me - 2007
- The Thatcher Illusion - 2007