I’ve written a lot of JavaScript. I like JavaScript. And more importantly, I’ve built up a set of skills in understanding, optimizing, and debugging JavaScript that I’m reluctant to give up on. So maybe it’s natural that I get a worried pit in my stomach over the current mania to rewrite every Node.js tool in … … Continue reading →
I love the js-framework-benchmark. It’s a true open-source success story – a common benchmark, with contributions from various JavaScript framework authors, widely cited, and used to push the entire JavaScript ecosystem forward. It’s a rare marvel. That said, the benchmark is so good that it’s sometimes taken as the One True Measure of a web […]
Every so often, the web development community gets into a tizzy about something, usually web components. I find these fights tiresome, but I also see them as a good opportunity to reach across “the great divide” and try to find common ground rather than another opportunity to dunk on each other. Ryan Carniato started the […]
Recently I got an interesting performance bug on emoji-picker-element: I’m on a fedi instance with 19k custom emojis […] and when I open the emoji picker […], the page freezes for like a full second at least and overall performance stutters for a while after that. If you’re not familiar with Mastodon or the Fediverse, […]
Pop quiz: what emoji do you see below? [1] Depending on your browser and operating system, you might see: The flag of Martinique The old flag of Martinique (which kinda looks like the Quebecois flag) The enigmatic initials “MQ” This, frankly, is a mess. And it’s emblematic of how half-heartedly browsers and operating systems have […]
Writing good benchmarks is hard. Even if you grasp the basics of performance timings and measurements, it’s easy to fool yourself: You weren’t measuring what you thought you were measuring. You got the answer you wanted, so you stopped looking. You didn’t clean state between tests, so you were just measuring the cache. You didn’t […]
One question I see a lot about web components is whether this is okay: The answer is: yes. It’s fine. Go ahead and make your connectedCallbacks async. Thanks for reading. What? You want a longer answer? Most people would have tabbed over to Reddit by now, but sure, no problem. The important thing to remember […]
I think filing bugs on browsers is one of the most useful things a web developer can do. When faced with a cross-browser compatibility problem, a lot of us are conditioned to just search for some quick workaround, or to keep cycling through alternatives until something works. And this is definitely what I did earlier […]
A common mistake I see in web components is this: This setupLogic() can be just about anything – subscribing to a store, setting up event listeners, etc. The teardownLogic() is designed to undo those things – unsubscribe from a store, remove event listeners, etc. The problem is that constructor is called once, when the component […]
Compared to previous years, my reading velocity has taken a bit of a nosedive. Blame videogames, maybe: I’ve put more hours into Civilization 6 than I care to admit, and I’m currently battling Moblins and Bokoblins in Zelda: Tears of the Kingdom. I’ve also been trying to re-learn the guitar. I basically stopped playing for […]
Web components are kind of having a moment right now. And as part of that, shadow DOM is having a bit of a moment too. Or it would, except that much of the conversation seems to be about why you shouldn’t use shadow DOM. For example, “HTML web components” are based on the idea that […]
In my last post, we went on a guided tour of building a JavaScript framework from scratch. This wasn’t just an intellectual exercise, though – I actually had a reason for wanting to build my own framework. For a few years now, I’ve been maintaining emoji-picker-element, which is designed as a fast, simple, and lightweight […]
In my day job, I work on a JavaScript framework (LWC). And although I’ve been working on it for almost three years, I still feel like a dilettante. When I read about what’s going on in the larger framework world, I often feel overwhelmed by all the things I don’t know. One of the best […]
Here’s a deep-in-the-weeds thing about web components that I ran into recently. Let’s say you have a humble component: And let’s say that this component throws an error in its connectedCallback: Why would it do that? I dunno, maybe it needs to validate its props or something. Or maybe it’s just having a bad day. […]
Dave Rupert recently made a bit of a stir with his post “If Web Components are so great, why am I not using them?”. I’ve been working with web components for a few years now, so I thought I’d weigh in on this. At the risk of giving the most senior-engineer-y “It depends” answer ever: […]
A few months ago, I gave a talk on CSS performance at performance.now in Amsterdam. The recording is available online: (You can also read the slides.) This is one of my favorite talks I’ve ever given. It was the product of months (honestly, years) of research, prompted by a couple questions: What is the fastest […]
Five years ago, I started a journey to build a better Mastodon client – one focused on performance and simplicity. And I did! Pinafore is the main Mastodon client I’ve used myself since I first released it. After five years, though, my relationship with social media has changed, and it’s time for me to put […]