Can you understand this JavaScript?

#​727 — March 14, 2025

Read on the Web

JavaScript Weekly

A Perplexing JavaScript Parsing Puzzle — It looks deceptively simple – just 14 characters of JavaScript – but after working with JavaScript for 29 years, I got it wrong. A clue: it goes back to a browser-related quirk from 30 years ago..

Hillel Wayne

TypeScript’s Compiler to Get 10x Faster — TypeScript has shaken up the JavaScript ecosystem in recent years with an increasing number of developers relying on its strong typing and added structure. TypeScript’s compiler isn’t particularly fast, though, but the TypeScript team at Microsoft are changing that by porting it to Go!

Anders Hejlsberg (Microsoft)

💡 Dr. Axel Rauschmayer takes a closer look at the details behind the port.

Build a Secure Project Management — Learn a security-first approach to building web applications by building a secure project management platform with Next.js.

Clerk sponsor

IN BRIEF:

Node.js v20.19.0 (LTS) is a notable release for a maintenance branch of Node as an exception has been made to the maintenance policy for backporting require(esm) support, which is now enabled by default.

The latest version of Chrome (and preview versions of Firefox and Safari) support two new HTML attributes, command and commandfor, for adding declarative actions to HTML buttons without directly requiring JavaScript.

RELEASES:

Nuxt 3.16 – Popular Vue meta-framework. Now with a new create-nuxt tool for starting projects.

Bun 1.2.5 – Now with much better Node-API compatibility, CSRF generation and verification, plus numerous perf improvements and fixes.

Melange 5 – An OCaml-to-JavaScript compiler.

Astro 5.5, Transformers.js 3.4, Capacitor 7.1, Nuxt UI v3

📒 Articles & Tutorials

Building APIs with Next.js — A detailed, official introduction to the concepts behind using Next.js’ App Router and route handlers to build public APIs you can expose to web, mobile, and third-party clients.

Lee Robinson

How The New York Times Migrated from Enzyme to React Testing Library — A thorough look at the technical challenges and strategies the NYT used to perform a piecemeal upgrade of its React testing approach without disrupting either end users or other developers.

Felipe Buenaño (NYT Open Team)

Which AI Model Is Best for Fixing Unit Test Errors? Claude, o3-mini, GPT-4o? — Better context wins every time. Wallaby enters the chat to give AI what it needs – test coverage and runtime values – to debug smarter.

Wallaby Team sponsor

How ECMAScript Engines Optimize Your Variables — From the authors of the Boa JS Rust-powered JavaScript engine.

Boa Developers

📄 Use Cases for the Document Picture-in-Picture API – A way to open a floating, always-on-top window (‘picture-in-picture’) that can display arbitrary HTML content. Chrome only, though. Jad Joubran

📄 Using Intl.DurationFormat to Format Time Durations with Locale Support Trevor I. Lasn

📄 Learn Zod So You Can Trust Your Data and Your Types Diana MacDonald

📄 10 Hidden Gems in Angular That You Should Use IE 33

📄 Underrated Angular Features Armen Vardanyan

🛠 Code & Tools

Refractor 5.0: Robust Virtual Syntax Highlighting using Prism — Wraps the powerful Prism syntax highlighter to output objects instead of an HTML string so you can manipulate and render it as you wish (e.g. in a VDOM or at the terminal). Lowlight, by the same author, offers the same functionality but backed by highlight.js.

Titus Wormer

svg2pdf.js: SVG to PDF Conversion in the Browser — There’s an online playground to give you a feel for what it can do.

yWorks GmbH

🔒 Protect Against AI Bots, Fraud, and Abuse in Real Time — WorkOS Radar protects your app with advanced device fingerprinting — stop fake signups, free tier abuse, bot attacks and brute force attempts today.

WorkOS sponsor

⌘K: A Fast, Composable, Unstyled ‘Command Menu’ Control — The home page includes some neat examples in a variety of styles. GitHub repo. Needs React 18+.

Paco Coursey

🔎 Node Modules Inspector — A tool that runs pnpm inside your browser, “installs” a package, then analyzes its dependencies. This can be useful for analyzing packages you already use, but also for simplifying your own projects, as 11ty’s Zach Leatherman did here.

Anthony Fu

PGlite: Run Postgres in WebAssembly — PGlite packages a WASM build of Postgres into a TypeScript library that can be run directly from Node.js (or Bun, Deno, and even the browser) and it’s only a few megabytes in size.

ElectricSQL / Neon

Gleam 1.9 – Type-safe functional programming language that targets both the Erlang VM and JavaScript runtime.

<css-doodle> 0.42 – Web component for drawing patterns with CSS.

Faker 9.6 – Generate fabricated data to your heart’s content.

Choices 11.1 – Configurable select box/text input plugin.

🕒 Spacetime 7.8 – Lightweight timezone library.

Ink 5.2 – Use React to build CLI apps.

📰 Classifieds

Meticulous automatically creates and maintains an E2E UI test suite with zero developer effort. Relied on by 1000s of orgs, including Dropbox, Lattice, Bilt Rewards and many more.

Current PDF setup slowing you down? Try Nutrient’s PDF SDK — it’s used by IBM, SAP, DocuSign and countless others to open, edit, and customize with ease across platforms.

👀 Give your eyes a break! MonoLisa is a font optimized for developers. Try now.

📢  Elsewhere

A quick roundup of some of other interesting updates or useful resources in the broader developer landscape:

A fantastic introduction to latency in IO devices (above) over on the PlanetScale blog, complete with very useful interactive diagrams built in JavaScript.

The Evil Martians explain things you can consider to make your open source project more popular.

🤖 Esteemed LLM-whisperer Simon Willison drops a ton of insights and tips on how he uses LLMs to help him write code.

The current state of JavaScript on the Web

#​726 — March 7, 2025

Read on the Web

JavaScript Weekly

A Report on How the Web is Really Using JavaScript — Each year, the HTTP Archive puts together the Web Almanac, a report on the ‘state of the Web’. The JavaScript section has just gone live and goes into depth on how much JS we’re using (or failing to use!), the popularity of TypeScript, loading methods, Web Worker use, and, yes, jQuery still leads the way!

HTTP Archive

Lynx: A Fresh Way to Build Apps from Web TechnologiesLynx is a new set of tools for building JavaScript-powered native and Web apps that draws inspiration from React Native but aims to be more modular and flexible (and eventually framework agnostic). It comes from, and is used by, TikTok, and comes with its own QuickJS-based JavaScript engine.

Xuan Huang and the Lynx Team

Build Dynamic Forms with a JSON-Powered White-Label Form Builder — Create fully customizable, JSON-driven forms in your JavaScript app with SurveyJS. Our drag-and-drop form-building UI component integrates seamlessly with React, Angular, Vue 3, and vanilla JS, plus has no backend restrictions. Perfect for form-heavy apps.

SurveyJS sponsor

Announcing TypeScript 5.8 — Four months in the making, TypeScript 5.8 lands with a strong Node focus. You can now use require() for ES modules in the nodenext module, there’s a new node18 module for developers who want to keep targeting Node 18, and most notably there’s now an –erasableSyntaxOnly option to ensure no TypeScript-only runtime semantics can be used.

Microsoft

IN BRIEF:

The Svelte team shares its latest monthly update of what’s new.

Straightforward examples of basic design patterns implemented in pure JavaScript.

🤖 The folks behind the State of JS survey are running State of Web Dev AI, a new survey focused on the use of AI in modern Web development.

RELEASES:

Electron 35.0 – You can now attach a preload script to Service Workers. Dependencies are also bumped to Chromium 134 and Node 22.14.

Angular 19.2 – We mentioned this last week but there’s now an official post with more details.

React Aria March Release – Adobe’s fantastic suite of React components.

zx 8.4 – Google’s tool for better Node shell scripting.

eslint-plugin-vue v10.0.0, Readability.js 0.6, NodeBB 4.1

📒 Articles & Tutorials

JavaScript Fatigue Strikes Back — A developer with ‘a decade away’ from writing JavaScript returns to find that one thing hasn’t changed: “Choosing the right JavaScript framework is hard, man.”

Allen Pike

Dr. Axel’s ‘Sales Pitch’ for TypeScript — As one of JavaScript’s most esteemed writers, if Dr. Axel can’t convince you of the value of TypeScript, who could?

Dr. Axel Rauschmayer

Instrument, Monitor, Fix: A Hands-On Debugging Class — Join us for a hands-on session where you’ll build it, watch it break, debug it, and go from “no idea what’s wrong” to fixing issues.

Sentry sponsor

Reimplementing Crossy Road in JavaScript — Two well put together tutorials so far covering reimplementing Crossy Road with either Three.js or React Three Fiber. In both written or video form.

Hunor Márton Borbély

Node Just Added TypeScript Support. What Does That Mean for Deno? — The Deno team, who went all in on TypeScript from day one, reflects on the continued increase in levels of support for TypeScript in Node and how their approaches differ.

Andy Jiang and Ryan Dahl

📄 Creating an Image Comparison Slider in 6 Lines of JavaScript Muffin Man

📄 Is Biome Ready to Replace Prettier and ESLint? Nicolas Pendon

📄 Speeding Up the JS Ecosystem with Rust and JavaScript Plugins Marvin Hagemeister

📄 JavaScript Best Practice: Use return await Tamás Sallai

🛠 Code & Tools

TanStack Form v1.0: Headless, Type-Safe Form State Management — A type-safe, framework agnostic (React, Vue, Angular, Solid and Lit are all supported out of the box), headless and isomorphic way to create and work with forms, with this v1.0 release over two years in the making. If you already use things like Formik or React Hook Form and are wondering how it differs, here’s a comparison table.

Tanner Linsley

PDFSlick 2.2: View and Interact with PDF Documents — A full-featured PDF viewer for React, Solid, Svelte and other JS apps. Built on top of PDF.js, it uses Zustand to provide a reactive store for documents. Demo.

Vancho Stojkov

🔒 Protect Against AI Bots, Fraud, and Abuse in Real Time — WorkOS Radar protects your app with advanced device fingerprinting — stop fake signups, free tier abuse, bot attacks and brute force attempts today.

WorkOS sponsor

Electron App Boilerplate with Modern Dependencies — A basic template app that uses React 19, Tailwind CSS 4, shadcn/ui, Electron Vite, Biome, and includes a GitHub Actions release workflow.

Dalton Menezes

Fable: A F# to JavaScript Compiler — If you fancy F#’s flavor of almost-entirely-functional development, this could be for you. GitHub repo.

Fable

React Data Table: Responsive Dynamic Table Component — Simple and clean, but flexible. Includes features like column sorting and pagination out of the box. Lots of demos and code examples. GitHub repo.

John Betancur

🖼️ Cropper.js 2.0 – JavaScript image cropping control. There’s an online playground where you get a feel for all its features.

📈 Perspective 3.4 – Streaming data viz and analytics component. The core is written in C++ and compiled to WebAssembly. The homepage shows it off well.

Happy DOM 17.3 – Cross-runtime JS implementation of a web browser sans UI.

EasyMDE 2.20 – A simple Markdown editor control. Demo.

LogTape 0.9 – Simple logging library for all major JS runtimes.

📰 Classifieds

Meticulous automatically creates and maintains an E2E UI test suite with zero developer effort. Relied on by 1000s of orgs, including Dropbox, Lattice, Bilt Rewards and many more.

Meet Harmony – An open source library for composing consistent and highly performant platforms from independent business features.

🏎️ Cut Integration Time – CarsXE’s API ensures minimal setup and faster deployment for your project. Learn more.

Working with in-app PDFs can be frustrating. Try Nutrient’s PDF SDK which handles problems effortlessly, so you don’t have to spend time fixing them. Used by ~1 billion end users in more than 150 different countries.

📢  Elsewhere

A quick roundup of some of other interesting updates or useful resources in the broader developer landscape:

🗓️ endoflife.date is a handy, updated source of ‘end-of-life’ dates for hundreds of open source projects, including Angular, Node.js, and Vue. A great resource.

Dive into WebGPU is a fantastic four part series on using the Web’s most modern graphics API for creating striking visual effects.

FerretDB 2.0 is an interesting open source MongoDB alternative built on top of Postgres.

A look at initial support for functions in CSS. Currently an experimental Chrome Canary feature only.