In the age of AI, what is the role of summarizers| samthor.au
All Browsers Get This Wrong We found a bug in Shadow DOM that's strangely consistent across Firefox, Safari and Chrome. And this bug is strange: it's not actually a user-facing issue, but rather, something the developer tools across each browser just gets wrong. 🤯 Background I'm a huge fan of Web Components, despite their various downsides. Part of this was my time at Google: I was paid to believe in them, and it's hard to get out of that habit. In building my startup Gumnut Dev (we make y...| Sam Thorogood
Baldur's Gate 3 Character Choice My partner and I have been playing co-op Baldur's Gate 3 on PS5. It's good, although a bit clunky on controller, and while the split-screen mode is amazing that it works at all, it's also the source of pretty hefty FPS drops. When cross-play is added, one of us will probably swap to a Mac to keep playing. How Your Character Choice Works We found character creation confusing, especially as you're sort of dumped into it… what does it mean to pick an "origin ch...| Sam Thorogood
Opinions On Sydney Rail Transport This is a post containing my niche opinions on Sydney's public transport system. If you're from Sydney and a transport nerd, this is probably interesting. Otherwise, maybe read something else. I'm not going to give background, suffice to say that Sydney is Australia's biggest city and has the highest number of commuters who use public transport. Without further ado, some spicy takes. 🌶️ Takes Isolate the Eastern Suburbs line Sydney has an interesting his...| Sam Thorogood
AWS Amplify Is A Grift Yes, this is a punchy headline, but if you'll join me on this journey, you'll see how. 👀 So, here's the context. For the past year or so, I was at a renewable energy startup. It was a great experience, but I recently resigned: I'm having another child, and I just don't need to work full-time—so I'm not going to. To be clear, this post is entirely my opinion: as of writing, I'm only employed by myself. The startup heavily used Amplify—I inherited that decision—b...| Sam Thorogood
AbortController for expiry My last post on AbortController continues to be my most read blog post, ever. This one probably won't do quite as well, but that's fine—it's a bit more niche, but it's definitely also an extension of that one. Today, the problem I'll solve is: you have a token, key, or some object (e.g., some key to access a system) it's valid only for some time (e.g., an hour) - it has a lifetime you want to ensure users of that object don't overstay their welcome. 💥 Backgroun...| Sam Thorogood
Practical Python Modules I grew up writing a lot of Python, which I guess speaks to how old and unorganized it is. And since then, I've been primarily a JS developer—that ecosystem has its failings, but the rules around how things are imported inside "node_modules" are mostly well established, even despite its quirks. For modules, though—Python is a mess. But I think there's some simple knowledge that you might be missing. 🤔 So, You're Building A Package Just some package that has some...| Sam Thorogood
Focus Management in 2022 📺 I recently gave a talk! It's on <dialog> and the inert attribute, with a mention of <fieldset disabled>, too. You can find the talk on JSNation, who graciously hosted me and motivated me to get this done. 🎉 But also, it's just on YouTube here (albeit without my face and a snazzy intro/outro): This talk combines one of my quite popular blogposts—In Defence Of Dialog, including some great demos—with a bunch more new content about the other focus primitives y...| Sam Thorogood
Event-Driven JavaScript Development Every JS developer has written code to handle "click" listeners—press a button, tap a link—and you'll do something interesting. Events are core to the way we write for the web and use the DOM. 👆 But what if I were to tell you that you should and could be using event-driven development for yourself—not even in the DOM? 🤔 To do that, we can now subclass EventTarget, giving your code access to fire its own events, and listen to those events using ....| Sam Thorogood
Cross-Tab Title Hints Let's say you've built a website that shows items—maybe things you can buy online, or a catalogue of TV episodes. Your users are opening lots of tabs at once 📈 to compare and contrast, or decide what to buy, or whatever. Turns out, we can use just the hidden tabs as a surface to help the user out. But note that this is really a desktop-only feature, because tabs aren't really visible on mobile. 📱 So first! Play with the demo: Sorry, you can't see the demo here. A...| Sam Thorogood
Unit Testing React without Jest Jest is clearly a polished testing tool, but with the advent of Node.js 18, we really don't need it any more. Jest also has a huge surface area, is perhaps inexorably linked to Webpack, and needs its own binary—you can't just "run the tests" as a script. So it has some modern challenges. This blog post will teach you how to set up your code, rather than provide an all-in-one solution, and is not about React testing itself—just the environment where you can ...| Sam Thorogood
Three Fun Facts on Australian Federal Elections Some fun facts on voting in Australia, one of the world's few democracies to enforce (lightly) compulsary voting. (That isn't a fun fact—it's well-known and not really that interesting.) The Facts 1. We're a federation or federalist state The federal government exists at the behest of the states, not the other way around. It's conceivable but highly improbable that a state could secede: if all states seceeded, then the federation would arguabl...| Sam Thorogood
Post-Request/Response Apps Serverless or monolithic/'serverful' architectures are often presented as sides of the same coin: they're both just alternative ways to serve synchronous requests, for example, a HTTP server serving content, or handling API requests publicly or internally. But this is a naïve viewpoint, and we as developers now almost see 'serverless-like' development as the silver bullet for potentially enormous scalability, throwing away the imperative nature of writing long-live...| Sam Thorogood
Node.js can run TypeScript This is a fairly quick post, but it's impactful if you use Node.js. Node.js can now just run TypeScript locally, without needing tsx or a build step. How Node v22 has added an experimental flag, --experimental-transform-types. This supercedes a previous strip flag, because it supports code-based TypeScript features like enum. (Maybe there's some features still missing, but it's "good enough" for now.) To run a TypeScript file, you can now: $ node --experimental-tran...| Sam Thorogood
Some musings on CJS vs ESM and how to support old code| samthor.au
The AbortController is ostensibly for fetch, but it has some other ways we can use it too.| samthor.au