Skip to content
NewA calmer, faster ZeroHour
Otherinfo

How we rebuilt Cloudflare Workers’ module registry for Node.js compatibility

Cloudflare Blogby Logan Gatlin ()10 min read3
AI summary · glm-5.3-flashSummaries by Vani AI

Cloudflare rewrote the Workers (workerd) module registry for Node.js-compatible URL-based module resolution, shipped behind the new_module_registry flag with a 64 MiB bundle limit.

Cloudflare rebuilt the module registry in workerd, the open-source Workers runtime, so module specifiers are resolved as URLs and ESM, CommonJS, and WebAssembly modules follow Node.js semantics. The change is enabled with the new_module_registry compatibility flag and adds import.meta.resolve(), require(esm), import attributes validation, lazy compilation, and cross-isolate cache sharing. It also lifts the compressed bundle size limit to 64 MiB on all plans; the legacy registry implementation remains available.

Key facts
  • New registry treats specifiers as real URLs, fixing import.meta.url and require(esm) behavior.
  • Modules compile lazily and caches are shared across V8 isolates, improving performance.
  • Compressed bundle limit raised to 64 MiB on all plans; opt-in via new_module_registry flag.
Analyze this story with Vani AIImpact, who is affected and what defenders should do, in a new chat

From the original article

10 min read at blog.cloudflare.com

Workers now enables Node. js compatibility by default, supports applications up to 64 mebibytes, and adds a URL-based module registry with import. meta, lazy compilation, shared code caches, and clearer errors.

Cloudflare Blog

By Logan Gatlin · blog.cloudflare.com

Read the full article at Cloudflare Blog

A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.