From 9113db33e66a2d1fd9242794b010fde20b522aac Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Sat, 17 Oct 2026 08:23:09 -0700 Subject: [PATCH] Enable the new module registry by default from 2026-11-01 Compatibility decision: use the new JavaScript module registry for compatibility dates on or after 2026-11-01, including import.meta, URL-based resolution, import attribute validation, and Node.js require(esm) semantics. Earlier dates retain the opt-in behavior and legacy_module_registry remains an opt-out. Python Workers retain the legacy registry. Allow the scheduled Sunday date in the existing weekday guard. Remove the standalone server experimental-mode restriction so date-enabled Workers can start without --experimental. --- src/workerd/io/compatibility-date-test.c++ | 6 ++++-- src/workerd/io/compatibility-date.capnp | 3 ++- src/workerd/server/factory/worker-factory.c++ | 3 --- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/workerd/io/compatibility-date-test.c++ b/src/workerd/io/compatibility-date-test.c++ index ede8f3eed6b..b15d891ef46 100644 --- a/src/workerd/io/compatibility-date-test.c++ +++ b/src/workerd/io/compatibility-date-test.c++ @@ -590,8 +590,7 @@ KJ_TEST("encode to full flag list") { } KJ_TEST("compatibility dates must be Tuesday, Wednesday, or Thursday") { - // List of specific flags that are allowed to use non-conformant dates - // (already deployed and can't be changed for compatibility reasons) + // Specific flags with compatibility dates outside the normal release weekdays. kj::HashSet allowedFlagExceptions; allowedFlagExceptions.insertAll(std::initializer_list{ // Existing non-conformant dates that are already deployed @@ -649,6 +648,9 @@ KJ_TEST("compatibility dates must be Tuesday, Wednesday, or Thursday") { "pythonWorkers20250116"_kj, // 2025-09-29 (Monday) via impliedByAfterDate "removeNodejsCompatEOLv22"_kj, // 2027-04-30 (Friday) via impliedByAfterDate "removeNodejsCompatEOLv24"_kj, // 2028-04-30 (Sunday) via impliedByAfterDate + + // Scheduled default enablement on November 1, 2026 (Sunday). + "newModuleRegistry"_kj, }); // Helper function to suggest the next valid date (Tuesday, Wednesday, or Thursday) diff --git a/src/workerd/io/compatibility-date.capnp b/src/workerd/io/compatibility-date.capnp index bbac0edd1bf..55abdc7d72a 100644 --- a/src/workerd/io/compatibility-date.capnp +++ b/src/workerd/io/compatibility-date.capnp @@ -513,7 +513,8 @@ struct CompatibilityFlags @0x8f8c1b68151b6cef { newModuleRegistry @52 :Bool $compatEnableFlag("new_module_registry") - $compatDisableFlag("legacy_module_registry"); + $compatDisableFlag("legacy_module_registry") + $compatEnableDate("2026-11-01"); # Enables the new module registry implementation, which handles module # specifiers as URLs, implements import.meta (url/main/resolve), supports # import attributes, and allows a registry to be shared across isolate diff --git a/src/workerd/server/factory/worker-factory.c++ b/src/workerd/server/factory/worker-factory.c++ index c28d3e07e53..7a1550e7106 100644 --- a/src/workerd/server/factory/worker-factory.c++ +++ b/src/workerd/server/factory/worker-factory.c++ @@ -1569,9 +1569,6 @@ kj::Promise> factory_new_worker(const WorkerFactory& con bool usingNewModuleRegistry = isNewModuleRegistryEnabled(featureFlags); kj::Maybe> newModuleRegistry; if (usingNewModuleRegistry) { - KJ_REQUIRE(experimental, - "The new ModuleRegistry implementation is an experimental feature. " - "You must run workerd with `--experimental` to use this feature."); // Module URLs follow the virtual file system: a module at "/foo/bar/baz.js" in the bundle // is "file:///foo/bar/baz.js". const jsg::Url& bundleBase = workerFs->getBundleRoot();