javascript

  • Node 24, and a permission model I did not enable

    A runtime permission model that restricts filesystem and network access, read carefully and left off. A sandbox that has to be opened far enough for the workload is…

  • RegExp.escape, and the helper everybody had written

    Escaping a user-supplied string for use in a pattern, implemented from a Stack Overflow answer in every project since 2011. Four copies of a security-relevant one-liner, three of…

  • Promise.try, and a synchronous throw in an async chain

    A function that throws synchronously before returning a promise, and a caller whose .catch() never runs. A function that sometimes throws and sometimes returns a promise has two…

  • Set methods in ES2025, and the lodash import I removed

    Union, intersection and difference on Set, in the language, replacing four utility functions and a dependency. The array round trip was the idiom and it allocated twice for…

  • TypeScript 5.8, and a narrowing that finally worked

    Return type checking for conditional expressions, which resolved a pattern that had needed an assertion since 2021. Overloads with a boolean discriminant are a common shape and the…

  • 18 KB of JavaScript, and where the rest went

    A page that shipped 140 KB in 2024 and 18 KB in 2025, accounted for honestly. The largest saving is the widget nobody could convert, deferred rather than…

  • A block that stopped needing its own script

    An accordion block converted to directives a year ago, revisited to see whether the conversion held. The runtime being loaded by somebody else’s plugin changes the calculation for…

  • Import attributes for a JSON module

    Importing JSON with a syntax the runtime enforces, rather than with a bundler plugin that made it look like a module. The attribute is a security feature rather…

  • Tailwind 4, and the stylesheet we had already written

    4.0 in January, a CSS-first configuration, and a genuine reason to look again at a decision that had been made three times.

  • React 19, and reading the release notes as an outsider

    A major release in December for a library this codebase has been reducing its use of for three years. Writing down that a release does not apply is…