How we rebuilt Cloudflare Workers’ module registry for Node.js compatibility
Blog post from Cloudflare
Cloudflare has rewritten workerd’s module registry, the open-source core of the Workers runtime, to improve Node.js compatibility, standards compliance, startup efficiency, and memory use, while retaining the existing registry for deployed Workers. Available through the explicit `new_module_registry` compatibility flag, the update supports `import.meta.url`, `import.meta.main`, and `import.meta.resolve()`, URL-based module specifiers with query strings and fragments, consistent `node:` built-in resolution, strict import-attribute validation, Node.js-style `require()` behavior for ES modules, uniform loading errors, lazy compilation, shared caching across V8 isolates, and WebAssembly source-phase imports. The changes address limitations of the prior filesystem-path-based registry, which eagerly compiled entire bundles and handled module features inconsistently, and may allow bundlers such as Rolldown to preserve more of an application’s module graph rather than transforming it extensively. Cloudflare also states that Workers now support all stable Node.js APIs relevant to serverless use, enable them by default, and allow application bundles up to 64 MiB on all plans without a compressed bundle-size limit.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Serverless | 1 | 1,212 | 276 | 100 | +42% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.