JSR isn’t another tool, it’s a fundamental shift

#​685 — April 25, 2024

Read on the Web

JavaScript Weekly

JSR is Not Another Package Manager — When Ryan created Node, JavaScript had no packages or standard module system. npm and CommonJS took off, and tools like Yarn or pnpm extended npm in certain areas, but in today’s ES modules era, it’s time for a transformation. JSR is not merely a new npm, but a shift in how packages are distributed, tailored for the modern era.

Ryan Dahl

Node.js v22 (Current) Released — The newest, cutting edge, major version of Node lands with some key enhancements. v22 becomes the new ‘current’ release (becoming active LTS in October). It adds support for require-ing ESM, gets a built-in WebSocket client, upgrades to V8 12.4, and includes a task runner (e.g. node –run task_name). This blog post takes a closer look.

Rafael Gonzaga

💡 If you’re a Node developer, be sure to subscribe to Node Weekly as well, where we go into more depth of server-side JavaScript each week.

Lydia Hallie Tests Your JavaScript Knowledge — Challenge your core knowledge with 50 interactive quiz questions covering topics like the event loop, scopes and closures, classes and prototypes, garbage collection, and more. After each question, you’ll get an in-depth visual explanation from Lydia to deepen your understanding of fundamental JS concepts.

Frontend Masters sponsor

pnpm 9.0: The Efficiency-Focused Package Managerpnpm has long been a fantastic option for folks looking to save disk space and CPU cycles (or for its great monorepo support) while maintaining most of what makes npm great. v9.0 drops Node 16 and 17 compatibility, honors the packageManager field in package.json, makes some default config changes, and adopts Lockfile v9.

pnpm

IN BRIEF:

🙈 Yesterday was JS Naked Day, a day to go entirely without JavaScript. Sadly we missed it.. 😏

🇫🇷 dotJS 2024 is a JavaScript conference taking place in Paris, France on June 27. The speaker roster so far is pretty compelling.

rcompat is an interesting JS interoperability and runtime compatibility layer for servers, so you can avoid the differences between Node, Deno and Bun.

RELEASES:

React Native 0.74

Electron 30.0 – Now with Chromium 124, V8 12.4, and Node.js 20.11.1.

Hexo 7.2 – Static site generator for blogging.

Ember 5.8, Ionic 8, SWC 1.5, Knip 5.10.0

📒 Articles & Tutorials

A Tale of Migrating a Project to Bun — Eric, an engineer at Render, walks through the steps of how he migrated his Sveld project to Bun (replacing Yarn and Vitest in the process), including some minor gotchas he encountered, and what the speed gains were.

Eric Liu

The Frontend Developer/Engineer Handbook 2024 — A guide to the current webdev landscape, covering how to get up to speed on topics like editors, CSS, UX, UI, the command line, tools and frameworks, perf, accessibility, etc.

Cody Lindley

3 Reasons to Use JavaScript Libraries for Graph Visualization — Easily add network visualization capabilities to your applications, while cutting down on dev time.

Linkurious sponsor

HTML Attributes vs DOM Properties — They’re different, but often coupled. Jake outlines the the difference, and why it matters.

Jake Archibald

▶  A Node.js Streams Masterclass — An hour-long odyssey with the creator of Fastify (and Node.js TSC member) into the world of streams. A stream is like an array over time.. we learn, before going into live coding and demos.

Matteo Collina

How I Fixed My Brutal TTFB (Time to First Byte) — All it took was two small changes to how data is fetched to reduce the p75 TTFB from 3.46s to just 704ms. Learn more.

Sentry sponsor

📄 The Problem with new URL(), and How URL.parse() Fixes That Kilian Valkhof

📄 The Intl.Segmenter Object is Now Part of Baseline – Interoperable, locale-sensitive text segmentation. Rachel Andrew

📄 Event Dispatch in Angular – Under-the-hood of the new event delegation system. Ramanathan and Wilkinson

📄 The Making of a TypeScript Feature: Inferring Type Predicates Dan Vanderkam

📄 Adding ESLint and Auto-Fixing an Existing TypeScript Project Daniel Doubrovkine

📺 Using TC39 Proposed Signals in React and Svelte Today – Jack Herrington

📄 Quirks of Escaping JavaScript for a script Tag James Fisher

🛠 Code & Tools

📊 Unovis: A Modular Data Visualization Framework — Works with React, Angular, Svelte, Vue or plain old JS/TS. Handles all sorts of things from Sankey diagrams to maps, graphs, chord diagrams, and traditional line/area charts. The v1.4 release adds support for annotating visualizations in a flexible way. There’s a gallery of examples (with code) if you want to dig in.

F5, Inc.

Transformational Auth & Identity | Userfront — “Compared to our previous experiences in the security/auth space, Userfront is an order of magnitude simpler to use.”

Userfront sponsor

ReScript 11.1 Released with Improved JSX SupportReScript is an OCaml-inspired, typed language that compiles to JavaScript and has a JSX transform built into the language. JSX support was previously solely for React use cases, but now works with Vue, Preact, and other approaches too.

The ReScript Project

typed-xlsx: Feature-Rich Type-Safe Excel Reporting — Define a strongly typed spreadsheet schema, then populate and work with the sheets directly from JS/TS, such as for generating reports for users – example code. Wraps around SheetJS. GitHub repo.

Cyprien Thao

Devalue 5.0: Like JSON.stringify, But..“Gets the job done when JSON.stringify can’t.” Namely, it can handle cyclical and repeated references, regular expressions, Map and Set, custom types, and more.

Rich Harris

imask.js 7.6.0: A Vanilla JavaScript Input Mask — Prevent users from entering invalid values. Has plugins for Vue, Angular, React, Svelte, and Solid, as needed.

imaskjs

browser-or-node 3.0: Figure Out Where Your Code is Running — Provides a simple way to tell if your code is currently running in a browser, in Node, in a Web Worker, or in Deno. Works with both ESM and CJS imports.

Dinesh Pandiyan

MistCSS 0.4 – Create components using only CSS, i.e. JS-from-CSS. v0.4 adds Hono and CSS variable support.

Accessible Autocomplete 3.0 – The UK government’s very own autocompleting input component. (Examples.)

Mercurius 14.1 – Implement GraphQL servers and gateways on Fastify.

Vision Camera 4.0 – Advanced camera control for React Native.

webdav-client 5.6 – WebDAV client library for Node & browsers.

🐍 JSPyBridge 1.2 – Run Python from Node or vice versa.

MUI X 7.3 – Popular React component suite.

Visualizing algorithms

#​684 — April 18, 2024

Read on the Web

JavaScript Weekly

Quill 2.0: A Powerful Rich Text Editor for the Web — A major release and significant modernization for the open source WYSIWYG editor. In Announcing Quill 2.0, we learn about Quill’s transition to TypeScript and improved use of modern browser features, but there’s more going on too, such as its ESM packaging. Want to play with some code? There’s a playground.

Slab Inc.

Airbnb’s Extensive JavaScript Style Guide — It’s been years since we mentioned this popular, opinionated style guide, but it keeps getting little tweaks and repairs and remains a handy resource nonetheless.

Airbnb

WorkOS: Enterprise-Grade Auth for Modern SaaS Apps — WorkOS supports both the foundational auth and complex enterprise features like SSO. It provides flexible and easy-to-use APIs, helping companies like Vercel, Loom, and Webflow become Enterprise Ready. Best of all, WorkOS User Management supports up to 1 million MAUs for free.

WorkOS sponsor

Upgrading jQuery: Working Towards a Healthy Web — jQuery remains all over the Web, and the jQuery team and OpenJS Foundation have joined forces to make sure sites get up to date. Their ‘Healthy Web Checkup’ tool can tell you if the version of jQuery on a site is outdated (.. most likely ‘yes’ 😅).

Timmy Willison (jQuery)

Biome v1.7: Faster Formatting and Linting, Now Even Easier to Migrate ToBiome is an increasingly compelling, all-in-one JavaScript, TypeScript and JSX Prettier-compatible formatter and linter. v1.7 makes it easier to migrate to from ESLint and Prettier, can emit machine-readable JSON reports, and has some rule updates.

Biome Core Team

IN BRIEF:

🤡 ▶️ Interview with Senior JS Developer 2024 is a satirical(?) take on the state of modern development and increasingly complex ecosystems. Watch to either laugh or cry. (6 minutes.)

📺 Bartek Szwej has put together a list of 300 JavaScript-related videos from the past year, ordered by their YouTube view count.

f(x) (a.k.a. fx) is a great CLI tool for viewing JSON data. It now includes a JS engine so you can process JSON with JavaScript one-liners at the terminal, too.

Joyee Cheung shares a trip report from Node.js’s latest collaboration summit, touching on the topics the Node team is thinking about lately.

The folks at Deno go into depth about how they built JSR, the newest JavaScript registry, and how it can operate at scale.

“Much faster JSX element creation” is on the way for React developers.

📒 Articles & Tutorials

Building a CLI from Scratch with TypeScript and oclifoclif is a mature CLI tool development framework maintained by Salesforce. This tutorial goes from zero to something that works.

Josh Cunningham

Qwik vs. Next.js: Which is Right for Your Next Web Project? — A point by point faceoff between Qwik vs Next.js and why the author thinks Qwik takes the gold medal.

Samuel Mendenhall (Cisco)

RAG to Riches Developer Quest — Interact with AI-enhanced bots and learn to build your own RAG chatbot with Atlas Vector Search and Node.js.

MongoDB sponsor

CSS in React Server Components — An exploration of compatibility issues between React Server Components and CSS-in-JS libraries like styled-components.

Josh W Comeau

Profiling Node.js Performance with Chrome’s Performance Panel — Learn how to profile Node performance with Chrome’s Performance panel. (The JS Profiler is going away in Chrome 124, so you’ll need to become familiar with the newer approach.)

Chrome for Developers

📄 Keeping Up with the Node-ish Ecosystem – How Mux updated its legacy Node SDK to work with new JS runtimes. Dylan Jhaveri (Mux)

📄 Building an Interactive 3D Event Badge with React Three Fiber Paul Henschel (Vercel)

📄 A Deep Dive into Rspack and Webpack Tree Shaking hardfist

📄 Things I Like Better in Vue Than in React Jaydev Mahadevan

📄 Converting Plain Text To Encoded HTML With Vanilla JS Alexis Kypridemos

🛠 Code & Tools

TresJS: Build 3D Experiences with Vue.js — Create 3D scenes with Vue components and Three.js. Think React-three-fiber but more.. Vue flavored. There’s an online playground if you want to give it a quick spin (literally).

Alvaro Sabu

Next.js 14.2 Released — Approaching its eighth birthday, Next.js has passed 1 million monthly active developers and landed a release with support for using Turbopack to improve local development, memory usage, CSS and caching optimizations, improved error messages, and more.

Delba de Oliveira and Tim Neutkens

Porkbun — The Best Domain Registrar for JavaScript Developers — JavaScript developers choose Porkbun to register their domains. Get .dev, .app, or .foo for just $5 from Porkbun now.

Porkbun sponsor

Otto 0.4: A JavaScript Parser and Interpreter in Go — A JavaScript parser and interpreter written natively in Go (yes, we have a newsletter for that) which could be of interest if you want to add scripting to Go apps.

Robert Krimen

Wedges: A Collection of UI Components for React — Built and used by the folks at Lemon Squeezy, this is a well thought, aesthetically pleasing set of Radix UI and Tailwind CSS based components. You can also download a Figma file of them to use when mocking up layouts. GitHub repo.

Lemon Squeezy

HyperFormula: A Headless Spreadsheet System — A headless spreadsheet system – it provides the parsing, evaluation and representation of a spreadsheet, with you providing the UI, if you need one. Boasts ‘nearly full compatibility’ with Excel. Note the dual GPLv3 and commercial licensing.

Handsoncode

svelte-dnd-action: An Action-Based Drag and Drop Container for Svelte — Makes the bold claim that it “supports almost every imaginable drag and drop use-case, any input device and is fully accessible.”

Isaac Hagoel

⚙️ Zoompinch: A Natural Feeling ‘Pinch to Zoom’ for Vue 3 – Expected to come in React and Web Component variants in time. Maurice Conrad

⚙️ Craft.js – A React framework for building drag and drop page editors. Prev Wong

⚙️ Kotekan – A simple React framework built on Bun and supporting React Server Components. Benedikt Müller

⚙️ Cytoscape.js 3.29 – Graph theory/network visualization and analysis library.

⚙️ Tailwind Next.js Starter Blog 2.2 – A blogging starter template.

⚙️ RxDB 15.18 – Offline-first, reactive database for JS apps.

⚙️ JZZ 1.8.2 – MIDI library for Node and browsers.

⚙️ Ember.js 5.8

⏳ A Blast from the Past

Visualizing Algorithms — This fantastic post is now ten years old, but I revisited it recently and it’s such a joy. Mike Bostock (of D3.js fame) visually guides us through some algorithms using both demos and code.

Mike Bostock

An easy way to experiment with signals

#​683 — April 11, 2024

Read on the Web

JavaScript Weekly

Frontend Development Beyond React: Svelte — A surprisingly thorough article going deep into one developer’s research into using Svelte to build modern front-end apps. If you’ve never experimented with Svelte, this is a good primer to the key concepts, tradeoffs, and techniques involved.

Héla Ben Khalfallah

🛠 A JS Bin to Play with the TC39 Signals Proposal — Last week, we featured the proposal to add signals to JavaScript and by way of a polyfill, you can get experimenting with it right now.

NullVoxPopuli

Add Excel-Like Spreadsheet Functionality to Your JavaScript Apps — SpreadJS is the industry-leading JavaScript spreadsheet for adding advanced spreadsheet features to your enterprise apps. Build finance, analysis, budget, and other apps. Excel I/O, 500+ calc functions, tables, charts, and more. View demos now.

SpreadJS from MESCIUS inc sponsor

zx v8.0: Write Better Shell Scripts with Node — A popular way to make shell scripting a more pleasant experience in Node with useful wrappers around child_process, argument escaping, and sensible defaults. v8.0 makes zx 20x smaller, faster, makes it easier to kill processes, pass input to commands & more.

Google

IN BRIEF:

Val Town is a fantastic online platform for writing and deploying TypeScript functions right from the browser and has just raised $5.5m in funding.

The set methods proposal advanced to stage 4 at TC39 this week. Promise.try and Math.sumPrecise have advanced to stage 2.7.

🚗 What happens if 𝕏 you hack a car with JavaScript?

Cloudflare has added a JS-native RPC to Cloudflare Workers.

A recap of Angular developments at the recent ngConf 2024 event.

RELEASES:

ESLint 9.0 – A significant release with lots of cleanups, a new no-useless-assignment rule, and numerous tweaks and changes.

VitePress 1.1 – Vite & Vue-powered static site generator.

npm 10.5.2 – It’s now 𝕏 faster to run scripts, though we’re talking milliseconds nowadays.

Node.js April 10 Security Releases – Including v18.20.2 (LTS), v20.12.1 (LTS), and v21.7.3 (Current).

We mentioned Gulp 5’s release last week, but missed the announcing Gulp v5 post explaining why it’s a big deal.

📒 Articles & Tutorials

On Developing Figma Plugins — Some interesting observations on the experience of creating Figma plugins in JavaScript, including how they’re sandboxed and some implementation details of the author’s own plugin.

Tom MacWright

React Server Components in a Nutshell — A quick overview of RSCs not all about Next.js, comparing the approach taken by several frameworks before sharing thoughts on the tech and why the smaller Waku framework is worth a look.

Paul Scanlon (The New Stack)

Using AI-Powered Autofix to Fix Your Broken Code — Join Sentry live on April 25th, to preview Autofix and learn how we are using ML to prioritize issues and alerts.

Sentry sponsor

Some DevTools Tips and Tricks — Most developers barely scratch the surface of what DevTools can accomplish, says the author, who shares ten tips here.

Pankaj Parashar

📄 Object Structure in JavaScript Engines – You rarely need to know how objects are internally represented in JavaScript engines, but if you want to.. Frontend Almanac

📄 The Easiest Way to Build Reactive Local-First Apps, with TinyBase and PowerSync Benedikt Müller

📄 Building an Article Recommendation System with Upstash, Fly and OpenAI Rishi Raj Jain

📄 Browser Security Bugs That Aren’t: JavaScript in PDFs ericlaw

📄 Exploring Authentication in Next.js Robin Wieruch

🛠 Code & Tools

Madge 7.0: Create Graphs From Your Module Dependencies — A tool for generating a visual graph of module dependencies, finding circular dependencies, and discovering other useful info.

Patrik Henningsson

PythonMonkey: A JavaScript Engine in the Python VM — If you need to use Python but also want to run JavaScript, this gives you a way to do it with the Mozilla SpiderMonkey JS engine embedded into the Python runtime with Python providing the host environment.

Distributive

❤️ Loving console.log Is Easy, but Hate 😡 Losing Context to View Messy Output — Developer productivity tools Wallaby.js, Quokka.js and Console Ninja show console.log values and errors right next to your code.

Wallaby Team sponsor

Faces.js: A Library for Generating Vector-Based Cartoon Faces — The end results are somewhat reminiscent of how the Nintendo Wii generates random Miis. Faces are drawn as SVGs with each also represented by a JavaScript object so you can draw them again later.

ZenGM

Color.js 0.5: ‘Let’s Get Serious About Color’ — A fantastic library for working with colors in the browser, following the latest specs. It’s even been used by browsers to test their CSS Color 4/5 implementations.

Lea Verou and Chris Lilley

Preview.js: Preview UI Components Instantly in Your IDE — Namely, VS Code or JetBrain IDEs, out of the box. Compatible with components built for React, Vue, Svelte and Solid.

Zenc Labs Pty

Kosko: Organize Kubernetes Manifests in JavaScriptVersion 4.1 has just been released with a new plugin system.

Tommy Chen

Transformational Auth & Identity | Userfront — “Compared to our previous experiences in the security/auth space, Userfront is an order of magnitude simpler to use.”

Userfront sponsor

Mikro ORM 6.2 – TypeScript ORM for Node.js based on Data Mapper. SQL Server and libSQL/Turso join the list of supported databases.

Rspack 0.6 – Fast Rust-based web bundler.

Pixi.js 8.1 – The fast WebGL and WebGPU 2D graphics engine switches back to WebGL by default due to immature browser support.

Jotai 2.8 – Simple, flexible state management for React.

DOMPurify 2.5 – Fast, tolerant XSS sanitizer for HTML and SVG.

Reveal.js 5.1 – Framework for building presentations in HTML.

Xterm.js 5.5 – Create terminal experiences on the Web.

TIFF 6.0 – Pure JS TIFF image decoder.

Shiki 1.3 – Powerful syntax highlighter.

🛞 It’s wheely good..

Remember the iPod’s click wheel? It’s back. In JavaScript form!

A signal boost for JavaScript

#​682 — April 4, 2024

Read on the Web

JavaScript Weekly

A Proposal to Add Signals to JavaScript — A (very) early stage proposal for bringing a new feature to ECMAScript/JavaScript: signals! The proposal brings aboard ideas from a swathe of popular frameworks and aims to align everyone and get us on the same page when it comes to working with state and making updates based upon changes to state. Rob writes more about the proposal here.

Rob Eisenberg and Daniel Ehrenberg

Build a RAG Chatbot App with MongoDB and Node.js — Embark on the RAG to Riches Developer Quest — a month of innovation, learning, and exclusive rewards awaits you. You’ll interact with AI-enhanced bots and learn how to build your own with Atlas Vector Search and Node.js. Register now!

MongoDB sponsor

JS-Torch: A PyTorch-Like Library for JavaScript — Python’s PyTorch is one of the gold standards amongst machine learning libraries but this project brings some of its features directly into the JavaScript world. Here’s a live browser-based demo. Early days but this could become a big deal.

Eduardo Leao

Bun 1.1 Released: Now Supports Windows Too — With the lighthearted codename of Bundows, the alternative server side runtime now runs directly on Windows 10 and up (plus WSL, macOS and Linux, of course). This is a key step in its adoption, with even features like Bun Shell happy on Windows out of the box. Node compatibility continues to improve with support for node:http2 and IPC support between Bun and Node processes.

The Entire Bun Team

IN BRIEF:

Samuel Groß of the V8 team explains the V8 Sandbox, a security mechanism designed to prevent memory corruption in the V8 engine impacting other memory in the process.

Svelte’s Rich Harris is ‘shaken up’ after a misunderstanding around ‘self-closing’ HTML tags and their effect on Svelte.

🤡 There was a curious JS-themed April Fools prank where a .js TLD for domain names was ‘announced’. Sadly, it’s not true, but there is js.org if you want something vaguely similar.

An official update on the merging of Angular and Wiz.

RELEASES:

Deno 1.42 – The alternative JS runtime adds first class support for JSR and improves Node.js compatibility further.

Babylon.js 7 (homepage) – Key release of the popular rendering engine.

Node.js April 3 Security Releases – Includes 18.20.1, 20.12.121.7.2.

Docusaurus 3.2 – Popular content/docs site generator.

Gulp 5.0

📒 Articles & Tutorials

What Even Is a JSON Number? — Despite the presence of standards around JSON, the answer is more complicated than you’d think, particularly when it comes to interfacing with other ecosystems and languages that aren’t JavaScript.

Brian Terlson

The History of JS Interop in Dart — About twelve years ago, Google introduced Dart, a language which initially seemed set to take over a lot of JavaScript’s use cases, but which eventually found its own niche (notably with Flutter). JS interoperability has remained important, though, and with Dart 3.3 has gotten significantly better.

Sigmund Cherem (Google)

Everything I’ve Learned About Scaling Designs Systems (With Examples) — I’ve learned a lot about what it takes to build, maintain, and scale design systems initiatives at large companies.

StackBlitz sponsor

The BFCache Explained — The back/forward cache (‘bfcache’) is a browser optimization that makes going back and forward in the browser a faster experience – it’s been present for years and usually leaves you alone as a JavaScript developer, but there are things worth being aware of.

Sabatino Masala

Running OCR Against PDFs and Images Directly in the Browser — A look behind the scenes at creating a simple tool using JavaScript to perform OCR against images and PDFs dragged on to the page.

Simon Willison

The Easy Way to Access the Last Array Element

Ignace Maes

A Comparison of JavaScript CRDTs

Alexis Métaireau

🛠 Code & Tools

Cally: Small, Feature-Rich Calendar Components — A collection of open-source calendar components for selecting single dates or date ranges. Framework-agnostic, themeable, localizable, and accessible (it even has an accessibility statement showing its commitment to this area).

Nick Williams

📊 Counterscale: Scalable Web Analytics You Can Run on Cloudflare — A simple web analytics tracker and dashboard that’s designed to be easy to deploy and maintain by hosting it on Cloudflare (for free too, up to a certain level).

Ben Vinegar

Product for Engineers: A Newsletter Helping Flex Your Product Muscle — Subscribe for free to get curated advice on building great products and best practices of top startups.

PostHog sponsor

🎵 Tonal.js: A Music Theory Library — Packed with functions to manipulate tonal elements of music like notes, intervals, chords, scales, modes, and keys, and used as the basis of other music related projects. GitHub repo.

danigb

Fancy-ANSI: Convert ANSI Text to HTML — If, for some reason, you want to convert text with ANSI escape codes into HTML.. Lots of examples on the homepage. GitHub repo.

Andres Morey

Dioma: Dependency Injection Container for Vanilla JS and TS — No decorators, no annotations, no magic, no dependencies – you just add the static scope property to your class and use inject to get an instance.

Eugene Daragan

svelte-zoomable-circles: Svelte Component for Browsing Hierarchical Data — A Svelte component for displaying and browsing hierarchical data using zoomable circles. Live demo.

Tyler Berbert

VineJS 2.0 – Form data validation library for Node.js.

PGlite 0.1.1 – Lightweight Postgres packaged as WASM into a TypeScript library for the browser, Node.js, Bun and Deno. Now supports Postgres array types.

TS-Pattern 5.1 – Pattern matching library with smart type inference.

ical.js 2.0 – Parser for ICS (RFC5545) and vCard (RFC6350) data.

Minimatch 9.0.4 – Glob matching function – used by npm itself.

vue-tel-input 9.0 – Telephone number input for Vue. (Demo.)

OverlayScrollbars 2.7 – JS custom scrollbar plugin.

Octokit.js 3.2 – ‘Batteries-included’ GitHub SDK.