diff --git a/src/content/compatibility-flags/cache-api-request-cf-overrides-cache-rules.md b/src/content/compatibility-flags/cache-api-request-cf-overrides-cache-rules.md new file mode 100644 index 00000000000..84dc72c3b20 --- /dev/null +++ b/src/content/compatibility-flags/cache-api-request-cf-overrides-cache-rules.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Cache API request `cf` overrides cache rules" +sort_date: "2025-05-19" +enable_date: "2025-05-19" +enable_flag: "cache_api_request_cf_overrides_cache_rules" +disable_flag: "no_cache_api_request_cf_overrides_cache_rules" +--- + +When `cache_api_request_cf_overrides_cache_rules` is enabled, cache settings specified in the `cf` object of a request passed to the [Cache API](/workers/runtime-apis/cache/) will override cache rules. This applies only to user-owned or grey-clouded sites. + +This is the Cache API counterpart to the [`request_cf_overrides_cache_rules`](/workers/configuration/compatibility-flags/#fetch-api-request-cf-overrides-cache-rules) flag, which applies to the `fetch()` API. diff --git a/src/content/compatibility-flags/enable-fast-jsg-struct.md b/src/content/compatibility-flags/enable-fast-jsg-struct.md new file mode 100644 index 00000000000..d697715bff9 --- /dev/null +++ b/src/content/compatibility-flags/enable-fast-jsg-struct.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable fast JSG struct optimization" +sort_date: "2025-12-03" +enable_date: "2025-12-03" +enable_flag: "enable_fast_jsg_struct" +disable_flag: "disable_fast_jsg_struct" +--- + +When `enable_fast_jsg_struct` is enabled, internal struct types used by Workers runtime APIs are constructed using a more efficient pattern that reduces object creation time. + +However, optional fields will be explicitly set to `undefined` rather than being omitted from the object entirely, which is an observable behavior change. Code that checks for the presence of a property using `"key" in obj` or `Object.hasOwn(obj, "key")` may behave differently, since optional fields that were previously absent will now be present with a value of `undefined`. + +To check for a value, prefer `obj.key !== undefined` over `"key" in obj`. diff --git a/src/content/compatibility-flags/enable-global-performance-classes.md b/src/content/compatibility-flags/enable-global-performance-classes.md new file mode 100644 index 00000000000..faf56dee4cd --- /dev/null +++ b/src/content/compatibility-flags/enable-global-performance-classes.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable global Performance classes" +sort_date: "2026-03-17" +enable_date: "2026-03-17" +enable_flag: "enable_global_performance_classes" +disable_flag: "disable_global_performance_classes" +--- + +When `enable_global_performance_classes` is enabled, the following classes are available on the global scope: `PerformanceEntry`, `PerformanceMark`, `PerformanceMeasure`, `PerformanceResourceTiming`, `PerformanceObserver`, and `PerformanceObserverEntryList`. + +These classes are also implicitly enabled by the `enable_nodejs_perf_hooks_module` flag. + +This flag is automatically enabled for Workers using a compatibility date of 2026-03-17 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. diff --git a/src/content/compatibility-flags/enable-nodejs-child-process-module.md b/src/content/compatibility-flags/enable-nodejs-child-process-module.md new file mode 100644 index 00000000000..7d5fb466c33 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-child-process-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:child_process` module" +sort_date: "2026-03-17" +enable_date: "2026-03-17" +enable_flag: "enable_nodejs_child_process_module" +disable_flag: "disable_nodejs_child_process_module" +--- + +The `enable_nodejs_child_process_module` flag enables the `node:child_process` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2026-03-17 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/child_process.html) for more details about the `node:child_process` API. diff --git a/src/content/compatibility-flags/enable-nodejs-cluster-module.md b/src/content/compatibility-flags/enable-nodejs-cluster-module.md new file mode 100644 index 00000000000..67bd2afd135 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-cluster-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:cluster` module" +sort_date: "2025-12-04" +enable_date: "2025-12-04" +enable_flag: "enable_nodejs_cluster_module" +disable_flag: "disable_nodejs_cluster_module" +--- + +The `enable_nodejs_cluster_module` flag enables the `node:cluster` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2025-12-04 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/cluster.html) for more details about the `node:cluster` API. diff --git a/src/content/compatibility-flags/enable-nodejs-console-module.md b/src/content/compatibility-flags/enable-nodejs-console-module.md new file mode 100644 index 00000000000..ae894644c10 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-console-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:console` module" +sort_date: "2025-09-21" +enable_date: "2025-09-21" +enable_flag: "enable_nodejs_console_module" +disable_flag: "disable_nodejs_console_module" +--- + +The `enable_nodejs_console_module` flag enables the `node:console` module in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2025-09-21 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/console.html) for more details about the `node:console` API. diff --git a/src/content/compatibility-flags/enable-nodejs-dgram-module.md b/src/content/compatibility-flags/enable-nodejs-dgram-module.md new file mode 100644 index 00000000000..c1c135ee878 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-dgram-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:dgram` module" +sort_date: "2026-01-29" +enable_date: "2026-01-29" +enable_flag: "enable_nodejs_dgram_module" +disable_flag: "disable_nodejs_dgram_module" +--- + +The `enable_nodejs_dgram_module` flag enables the `node:dgram` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2026-01-29 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/dgram.html) for more details about the `node:dgram` API. diff --git a/src/content/compatibility-flags/enable-nodejs-domain-module.md b/src/content/compatibility-flags/enable-nodejs-domain-module.md new file mode 100644 index 00000000000..92e26afeb4b --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-domain-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:domain` module" +sort_date: "2025-12-04" +enable_date: "2025-12-04" +enable_flag: "enable_nodejs_domain_module" +disable_flag: "disable_nodejs_domain_module" +--- + +The `enable_nodejs_domain_module` flag enables the `node:domain` module stub in Workers. Note that `node:domain` is deprecated in Node.js itself. + +This flag is automatically enabled for Workers using a compatibility date of 2025-12-04 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/domain.html) for more details about the `node:domain` API. diff --git a/src/content/compatibility-flags/enable-nodejs-fs-module.md b/src/content/compatibility-flags/enable-nodejs-fs-module.md new file mode 100644 index 00000000000..951b83e8006 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-fs-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:fs` module" +sort_date: "2025-09-15" +enable_date: "2025-09-15" +enable_flag: "enable_nodejs_fs_module" +disable_flag: "disable_nodejs_fs_module" +--- + +The `enable_nodejs_fs_module` flag enables the `node:fs` module in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2025-09-15 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/fs.html) for more details about the `node:fs` API. diff --git a/src/content/compatibility-flags/enable-nodejs-global-timers.md b/src/content/compatibility-flags/enable-nodejs-global-timers.md new file mode 100644 index 00000000000..f1e9a0cd340 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-global-timers.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable Node.js-compatible global timers" +sort_date: "2026-02-10" +enable_date: "2026-02-10" +enable_flag: "enable_nodejs_global_timers" +disable_flag: "no_nodejs_global_timers" +--- + +When `enable_nodejs_global_timers` is enabled, `setTimeout`, `setInterval`, `clearTimeout`, and `clearInterval` return Node.js-compatible `Timeout` objects with methods like `refresh()`, `ref()`, `unref()`, and `hasRef()`, matching the behavior of `node:timers`. + +This flag requires [`nodejs_compat`](/workers/runtime-apis/nodejs/) to be enabled and is automatically enabled for Workers using a compatibility date of 2026-02-10 or later when `nodejs_compat` is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/timers.html) for more details about the timer APIs. diff --git a/src/content/compatibility-flags/enable-nodejs-http2-module.md b/src/content/compatibility-flags/enable-nodejs-http2-module.md new file mode 100644 index 00000000000..877edb2bfdf --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-http2-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:http2` module" +sort_date: "2025-09-01" +enable_date: "2025-09-01" +enable_flag: "enable_nodejs_http2_module" +disable_flag: "disable_nodejs_http2_module" +--- + +The `enable_nodejs_http2_module` flag enables the `node:http2` module stubs in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2025-09-01 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/http2.html) for more details about the `node:http2` API. diff --git a/src/content/compatibility-flags/enable-nodejs-inspector-module.md b/src/content/compatibility-flags/enable-nodejs-inspector-module.md new file mode 100644 index 00000000000..9edb7174d53 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-inspector-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:inspector` module" +sort_date: "2026-01-29" +enable_date: "2026-01-29" +enable_flag: "enable_nodejs_inspector_module" +disable_flag: "disable_nodejs_inspector_module" +--- + +The `enable_nodejs_inspector_module` flag enables the `node:inspector` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2026-01-29 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/inspector.html) for more details about the `node:inspector` API. diff --git a/src/content/compatibility-flags/enable-nodejs-os-module.md b/src/content/compatibility-flags/enable-nodejs-os-module.md new file mode 100644 index 00000000000..6546889cfd9 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-os-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:os` module" +sort_date: "2025-09-15" +enable_date: "2025-09-15" +enable_flag: "enable_nodejs_os_module" +disable_flag: "disable_nodejs_os_module" +--- + +The `enable_nodejs_os_module` flag enables the `node:os` module in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2025-09-15 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/os.html) for more details about the `node:os` API. diff --git a/src/content/compatibility-flags/enable-nodejs-perf-hooks-module.md b/src/content/compatibility-flags/enable-nodejs-perf-hooks-module.md new file mode 100644 index 00000000000..bc3594a455f --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-perf-hooks-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:perf_hooks` module" +sort_date: "2026-03-17" +enable_date: "2026-03-17" +enable_flag: "enable_nodejs_perf_hooks_module" +disable_flag: "disable_nodejs_perf_hooks_module" +--- + +The `enable_nodejs_perf_hooks_module` flag enables the `node:perf_hooks` module in Workers. This flag also implicitly enables global Performance classes (`PerformanceEntry`, `PerformanceMark`, `PerformanceMeasure`, `PerformanceResourceTiming`, `PerformanceObserver`, and `PerformanceObserverEntryList`). + +This flag is automatically enabled for Workers using a compatibility date of 2026-03-17 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/perf_hooks.html) for more details about the `node:perf_hooks` API. diff --git a/src/content/compatibility-flags/enable-nodejs-punycode-module.md b/src/content/compatibility-flags/enable-nodejs-punycode-module.md new file mode 100644 index 00000000000..a7029fcb41f --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-punycode-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:punycode` module" +sort_date: "2025-12-04" +enable_date: "2025-12-04" +enable_flag: "enable_nodejs_punycode_module" +disable_flag: "disable_nodejs_punycode_module" +--- + +The `enable_nodejs_punycode_module` flag enables the `node:punycode` module in Workers. Note that `node:punycode` is deprecated in Node.js itself. + +This flag is automatically enabled for Workers using a compatibility date of 2025-12-04 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/punycode.html) for more details about the `node:punycode` API. diff --git a/src/content/compatibility-flags/enable-nodejs-readline-module.md b/src/content/compatibility-flags/enable-nodejs-readline-module.md new file mode 100644 index 00000000000..4e8891ac033 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-readline-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:readline` module" +sort_date: "2026-03-17" +enable_date: "2026-03-17" +enable_flag: "enable_nodejs_readline_module" +disable_flag: "disable_nodejs_readline_module" +--- + +The `enable_nodejs_readline_module` flag enables the `node:readline` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2026-03-17 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/readline.html) for more details about the `node:readline` API. diff --git a/src/content/compatibility-flags/enable-nodejs-repl-module.md b/src/content/compatibility-flags/enable-nodejs-repl-module.md new file mode 100644 index 00000000000..2b8530d3fb3 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-repl-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:repl` module" +sort_date: "2026-03-17" +enable_date: "2026-03-17" +enable_flag: "enable_nodejs_repl_module" +disable_flag: "disable_nodejs_repl_module" +--- + +The `enable_nodejs_repl_module` flag enables the `node:repl` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2026-03-17 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/repl.html) for more details about the `node:repl` API. diff --git a/src/content/compatibility-flags/enable-nodejs-sqlite-module.md b/src/content/compatibility-flags/enable-nodejs-sqlite-module.md new file mode 100644 index 00000000000..f24379a9c5a --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-sqlite-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:sqlite` module" +sort_date: "2026-01-29" +enable_date: "2026-01-29" +enable_flag: "enable_nodejs_sqlite_module" +disable_flag: "disable_nodejs_sqlite_module" +--- + +The `enable_nodejs_sqlite_module` flag enables the `node:sqlite` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2026-01-29 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/sqlite.html) for more details about the `node:sqlite` API. diff --git a/src/content/compatibility-flags/enable-nodejs-stream-wrap-module.md b/src/content/compatibility-flags/enable-nodejs-stream-wrap-module.md new file mode 100644 index 00000000000..c5d478b5a7c --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-stream-wrap-module.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:_stream_wrap` module" +sort_date: "2026-01-29" +enable_date: "2026-01-29" +enable_flag: "enable_nodejs_stream_wrap_module" +disable_flag: "disable_nodejs_stream_wrap_module" +--- + +The `enable_nodejs_stream_wrap_module` flag enables the `node:_stream_wrap` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2026-01-29 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. diff --git a/src/content/compatibility-flags/enable-nodejs-trace-events-module.md b/src/content/compatibility-flags/enable-nodejs-trace-events-module.md new file mode 100644 index 00000000000..bb91a73b0ae --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-trace-events-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:trace_events` module" +sort_date: "2025-12-04" +enable_date: "2025-12-04" +enable_flag: "enable_nodejs_trace_events_module" +disable_flag: "disable_nodejs_trace_events_module" +--- + +The `enable_nodejs_trace_events_module` flag enables the `node:trace_events` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2025-12-04 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/tracing.html) for more details about the `node:trace_events` API. diff --git a/src/content/compatibility-flags/enable-nodejs-tty-module.md b/src/content/compatibility-flags/enable-nodejs-tty-module.md new file mode 100644 index 00000000000..dcd7af27dd2 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-tty-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:tty` module" +sort_date: "2026-03-17" +enable_date: "2026-03-17" +enable_flag: "enable_nodejs_tty_module" +disable_flag: "disable_nodejs_tty_module" +--- + +The `enable_nodejs_tty_module` flag enables the `node:tty` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2026-03-17 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/tty.html) for more details about the `node:tty` API. diff --git a/src/content/compatibility-flags/enable-nodejs-v8-module.md b/src/content/compatibility-flags/enable-nodejs-v8-module.md new file mode 100644 index 00000000000..a5bfc70e2f1 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-v8-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:v8` module" +sort_date: "2026-03-17" +enable_date: "2026-03-17" +enable_flag: "enable_nodejs_v8_module" +disable_flag: "disable_nodejs_v8_module" +--- + +The `enable_nodejs_v8_module` flag enables the `node:v8` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2026-03-17 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/v8.html) for more details about the `node:v8` API. diff --git a/src/content/compatibility-flags/enable-nodejs-vm-module.md b/src/content/compatibility-flags/enable-nodejs-vm-module.md new file mode 100644 index 00000000000..44955998207 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-vm-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:vm` module" +sort_date: "2025-10-01" +enable_date: "2025-10-01" +enable_flag: "enable_nodejs_vm_module" +disable_flag: "disable_nodejs_vm_module" +--- + +The `enable_nodejs_vm_module` flag enables the `node:vm` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2025-10-01 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/vm.html) for more details about the `node:vm` API. diff --git a/src/content/compatibility-flags/enable-nodejs-wasi-module.md b/src/content/compatibility-flags/enable-nodejs-wasi-module.md new file mode 100644 index 00000000000..118ee8358ea --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-wasi-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:wasi` module" +sort_date: "2025-12-04" +enable_date: "2025-12-04" +enable_flag: "enable_nodejs_wasi_module" +disable_flag: "disable_nodejs_wasi_module" +--- + +The `enable_nodejs_wasi_module` flag enables the `node:wasi` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2025-12-04 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/wasi.html) for more details about the `node:wasi` API. diff --git a/src/content/compatibility-flags/enable-nodejs-worker-threads-module.md b/src/content/compatibility-flags/enable-nodejs-worker-threads-module.md new file mode 100644 index 00000000000..97d6286b1d8 --- /dev/null +++ b/src/content/compatibility-flags/enable-nodejs-worker-threads-module.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:worker_threads` module" +sort_date: "2026-03-17" +enable_date: "2026-03-17" +enable_flag: "enable_nodejs_worker_threads_module" +disable_flag: "disable_nodejs_worker_threads_module" +--- + +The `enable_nodejs_worker_threads_module` flag enables the `node:worker_threads` module stub in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2026-03-17 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/worker_threads.html) for more details about the `node:worker_threads` API. diff --git a/src/content/compatibility-flags/enable-validate-workflow-entrypoint.md b/src/content/compatibility-flags/enable-validate-workflow-entrypoint.md new file mode 100644 index 00000000000..d90d553a7df --- /dev/null +++ b/src/content/compatibility-flags/enable-validate-workflow-entrypoint.md @@ -0,0 +1,14 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable workflow entrypoint validation" +sort_date: "2025-09-20" +enable_date: "2025-09-20" +enable_flag: "enable_validate_workflow_entrypoint" +disable_flag: "disable_validate_workflow_entrypoint" +--- + +When `enable_validate_workflow_entrypoint` is enabled, additional validation checks are performed to ensure that [Workflows](/workflows/) are defined and used correctly. This helps catch configuration errors at upload time rather than at runtime. diff --git a/src/content/compatibility-flags/encoder-stream-spec-compliant-backpressure.md b/src/content/compatibility-flags/encoder-stream-spec-compliant-backpressure.md new file mode 100644 index 00000000000..3e36f324ca4 --- /dev/null +++ b/src/content/compatibility-flags/encoder-stream-spec-compliant-backpressure.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Spec-compliant TextEncoderStream/TextDecoderStream backpressure" +sort_date: "2026-03-24" +enable_date: "2026-03-24" +enable_flag: "encoder_stream_spec_compliant_backpressure" +disable_flag: "no_encoder_stream_spec_compliant_backpressure" +--- + +When `encoder_stream_spec_compliant_backpressure` is enabled, `TextEncoderStream` and `TextDecoderStream` use a readable-side high water mark of 0, as specified by the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/). + +With a high water mark of 0, the readable side starts with backpressure applied, so writes correctly block until a reader pulls. Previously, the high water mark defaulted to 1, which caused `pull()` to fire at startup, clearing backpressure before any write occurred. diff --git a/src/content/compatibility-flags/enhanced-error-serialization.md b/src/content/compatibility-flags/enhanced-error-serialization.md new file mode 100644 index 00000000000..d7896aec351 --- /dev/null +++ b/src/content/compatibility-flags/enhanced-error-serialization.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enhanced error serialization" +sort_date: "2026-04-21" +enable_date: "2026-04-21" +enable_flag: "enhanced_error_serialization" +disable_flag: "legacy_error_serialization" +--- + +When `enhanced_error_serialization` is enabled, errors serialized using `structuredClone()` or V8 serialization support more error types and include own properties on the error object. + +Note that when enabled, deserialization of errors will not preserve the original stack trace by default. + +Previously, only basic `Error` types were serialized, and own properties added to error objects were lost during serialization. diff --git a/src/content/compatibility-flags/fetch-iterable-type-support-override-adjustment.md b/src/content/compatibility-flags/fetch-iterable-type-support-override-adjustment.md new file mode 100644 index 00000000000..757b3eff5d4 --- /dev/null +++ b/src/content/compatibility-flags/fetch-iterable-type-support-override-adjustment.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Fetch iterable body respects toString/toPrimitive overrides" +sort_date: "2026-01-15" +enable_date: "2026-01-15" +enable_flag: "fetch_iterable_type_support_override_adjustment" +disable_flag: "no_fetch_iterable_type_support_override_adjustment" +--- + +When `fetch_iterable_type_support_override_adjustment` is enabled, objects passed as the body of a `fetch()` `Request` or `Response` that are sync iterable but also have a custom `toString` or `Symbol.toPrimitive` method will not be treated as iterables. Instead, they will fall through to being handled as stringified objects, matching the previous behavior for such objects. + +This flag refines the behavior introduced by the `fetch_iterable_type_support` flag and is automatically enabled when `fetch_iterable_type_support` is enabled after 2026-01-15. diff --git a/src/content/compatibility-flags/fetch-iterable-type-support.md b/src/content/compatibility-flags/fetch-iterable-type-support.md new file mode 100644 index 00000000000..73c60028c82 --- /dev/null +++ b/src/content/compatibility-flags/fetch-iterable-type-support.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Support iterables as fetch Request/Response body" +sort_date: "2026-02-19" +enable_date: "2026-02-19" +enable_flag: "fetch_iterable_type_support" +disable_flag: "no_fetch_iterable_type_support" +--- + +When `fetch_iterable_type_support` is enabled, sync and async iterables can be passed as the body of a `fetch()` `Request` or `Response` and will be properly iterated over. + +Previously, sync iterables like Arrays would be accepted but stringified (e.g., `[1, 2, 3]` would become `"1,2,3"`), and async iterables would be treated as regular objects and not iterated at all. With this flag enabled, iterables are properly consumed as streaming body content. + +Note that Arrays will now be treated as iterables instead of being stringified, which is a breaking change for code that relied on the previous behavior. diff --git a/src/content/compatibility-flags/handle-cross-request-promise-resolution.md b/src/content/compatibility-flags/handle-cross-request-promise-resolution.md new file mode 100644 index 00000000000..b1d9b934df2 --- /dev/null +++ b/src/content/compatibility-flags/handle-cross-request-promise-resolution.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Handle cross-request promise resolution correctly" +sort_date: "2024-10-14" +enable_date: "2024-10-14" +enable_flag: "handle_cross_request_promise_resolution" +disable_flag: "no_handle_cross_request_promise_resolution" +--- + +Historically, it was possible to resolve a promise from an incorrect request context, which could lead to promise continuations being scheduled in the wrong context, causing errors and difficult-to-diagnose bugs. + +With `handle_cross_request_promise_resolution` enabled, promise continuations are scheduled to run in the correct request context if it is still alive, or dropped with a warning if the correct context has already ended. diff --git a/src/content/compatibility-flags/internal-writable-stream-abort-clears-queue.md b/src/content/compatibility-flags/internal-writable-stream-abort-clears-queue.md new file mode 100644 index 00000000000..4486df305db --- /dev/null +++ b/src/content/compatibility-flags/internal-writable-stream-abort-clears-queue.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "WritableStream abort clears pending write queue" +sort_date: "2024-09-02" +enable_date: "2024-09-02" +enable_flag: "internal_writable_stream_abort_clears_queue" +disable_flag: "internal_writable_stream_abort_does_not_clear_queue" +--- + +When using the original WritableStream implementation ("internal" streams), the `abort()` operation was previously handled lazily, meaning that the queue of pending writes would not be cleared until the next time the queue was processed. This behavior could cause the stream to hang if the consumer stopped consuming. + +With `internal_writable_stream_abort_clears_queue` enabled, the queue is cleared immediately upon `abort()`, preventing hangs in cases where the consumer has stopped processing writes. diff --git a/src/content/compatibility-flags/nodejs-zlib.md b/src/content/compatibility-flags/nodejs-zlib.md new file mode 100644 index 00000000000..d82e2c4f199 --- /dev/null +++ b/src/content/compatibility-flags/nodejs-zlib.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enable `node:zlib` module" +sort_date: "2024-09-23" +enable_date: "2024-09-23" +enable_flag: "nodejs_zlib" +disable_flag: "no_nodejs_zlib" +--- + +The `nodejs_zlib` flag enables the `node:zlib` module in Workers. + +This flag is automatically enabled for Workers using a compatibility date of 2024-09-23 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. + +See the [Node.js documentation](https://nodejs.org/docs/latest/api/zlib.html) for more details about the `node:zlib` API. diff --git a/src/content/compatibility-flags/queue-expose-error-codes.md b/src/content/compatibility-flags/queue-expose-error-codes.md new file mode 100644 index 00000000000..3f0a7ab8253 --- /dev/null +++ b/src/content/compatibility-flags/queue-expose-error-codes.md @@ -0,0 +1,14 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Expose error codes in Queue operations" +sort_date: "2026-03-12" +enable_date: "2026-03-12" +enable_flag: "queue_expose_error_codes" +disable_flag: "no_queue_expose_error_codes" +--- + +When `queue_expose_error_codes` is enabled, [Queue](/queues/) operations will include detailed error information, including error codes and causes, making it easier to handle and diagnose queue-related errors programmatically. diff --git a/src/content/compatibility-flags/remove-nodejs-compat-eol-v22.md b/src/content/compatibility-flags/remove-nodejs-compat-eol-v22.md new file mode 100644 index 00000000000..1b7818bef94 --- /dev/null +++ b/src/content/compatibility-flags/remove-nodejs-compat-eol-v22.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Remove Node.js 22.x end-of-life APIs" +sort_date: "2027-04-30" +enable_date: "2027-04-30" +enable_flag: "remove_nodejs_compat_eol_v22" +disable_flag: "add_nodejs_compat_eol_v22" +--- + +When `remove_nodejs_compat_eol_v22` is enabled, APIs that reached end-of-life in Node.js 22.x are removed. + +This flag is automatically enabled when the `remove_nodejs_compat_eol` flag is enabled after 2027-04-30. diff --git a/src/content/compatibility-flags/remove-nodejs-compat-eol-v23.md b/src/content/compatibility-flags/remove-nodejs-compat-eol-v23.md new file mode 100644 index 00000000000..d3197acd93a --- /dev/null +++ b/src/content/compatibility-flags/remove-nodejs-compat-eol-v23.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Remove Node.js 23.x end-of-life APIs" +sort_date: "2025-09-01" +enable_date: "2025-09-01" +enable_flag: "remove_nodejs_compat_eol_v23" +disable_flag: "add_nodejs_compat_eol_v23" +--- + +When `remove_nodejs_compat_eol_v23` is enabled, APIs that reached end-of-life in Node.js 23.x (EOL June 2025) are removed. + +This flag is automatically enabled when the `remove_nodejs_compat_eol_v24` flag is enabled after 2025-09-01. diff --git a/src/content/compatibility-flags/remove-nodejs-compat-eol-v24.md b/src/content/compatibility-flags/remove-nodejs-compat-eol-v24.md new file mode 100644 index 00000000000..558cd8fa3b4 --- /dev/null +++ b/src/content/compatibility-flags/remove-nodejs-compat-eol-v24.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Remove Node.js 24.x end-of-life APIs" +sort_date: "2028-04-30" +enable_date: "2028-04-30" +enable_flag: "remove_nodejs_compat_eol_v24" +disable_flag: "add_nodejs_compat_eol_v24" +--- + +When `remove_nodejs_compat_eol_v24` is enabled, APIs that reached end-of-life in Node.js 24.x are removed. + +This flag is automatically enabled when the `remove_nodejs_compat_eol` flag is enabled after 2028-04-30. diff --git a/src/content/compatibility-flags/remove-nodejs-compat-eol.md b/src/content/compatibility-flags/remove-nodejs-compat-eol.md new file mode 100644 index 00000000000..ffe1da77f3a --- /dev/null +++ b/src/content/compatibility-flags/remove-nodejs-compat-eol.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Remove end-of-life Node.js APIs" +sort_date: "2025-09-01" +enable_date: "2025-09-01" +enable_flag: "remove_nodejs_compat_eol" +disable_flag: "add_nodejs_compat_eol" +--- + +When `remove_nodejs_compat_eol` is enabled, APIs that have reached End-of-Life in Node.js will be removed for Workers. When disabled, the APIs are present but might still be non-functional stubs. + +This flag is a roll-up flag. As additional APIs reach EOL in specific Node.js versions, new version-specific compat flags are added (such as `remove_nodejs_compat_eol_v22`, `remove_nodejs_compat_eol_v23`, and `remove_nodejs_compat_eol_v24`) that are implied by this flag after their respective dates. + +This flag is automatically enabled for Workers using a compatibility date of 2025-09-01 or later when [`nodejs_compat`](/workers/runtime-apis/nodejs/) is enabled. diff --git a/src/content/compatibility-flags/require-returns-default-export.md b/src/content/compatibility-flags/require-returns-default-export.md new file mode 100644 index 00000000000..78652de0dd9 --- /dev/null +++ b/src/content/compatibility-flags/require-returns-default-export.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "`require()` returns default export" +sort_date: "2026-01-22" +enable_date: "2026-01-22" +enable_flag: "require_returns_default_export" +disable_flag: "require_returns_namespace" +--- + +When `require_returns_default_export` is enabled, `require()` will return the default export of a module if it exists. If the default export does not exist, it falls back to returning a mutable copy of the module namespace object. + +This matches the behavior that Node.js uses for `require(esm)`, where the default export is returned when available. This flag is useful for frameworks like Next.js that expect to be able to patch module exports. + +Previously, `require()` always returned the module namespace object (an object like `{default: module.exports}`). diff --git a/src/content/compatibility-flags/strip-authorization-on-cross-origin-redirect.md b/src/content/compatibility-flags/strip-authorization-on-cross-origin-redirect.md new file mode 100644 index 00000000000..5585a9e72b6 --- /dev/null +++ b/src/content/compatibility-flags/strip-authorization-on-cross-origin-redirect.md @@ -0,0 +1,20 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Strip Authorization header on cross-origin redirects" +sort_date: "2025-09-01" +enable_date: "2025-09-01" +enable_flag: "strip_authorization_on_cross_origin_redirect" +disable_flag: "retain_authorization_on_cross_origin_redirect" +--- + +When `strip_authorization_on_cross_origin_redirect` is enabled, the `Authorization` header is automatically removed when following a redirect to a different origin. This behavior is required by the current [Fetch API specification](https://fetch.spec.whatwg.org/). + +This requirement was added to the Fetch spec in 2022, after Cloudflare Workers originally implemented its fetch handling. Workers did not originally implement this requirement, so the new behavior is gated behind a compatibility flag. + +The old behavior was not inherently insecure, and could be desirable in some circumstances. For example, if an API that requires authorization wishes to redirect to a new hostname while having the client send along their credentials. Under the new behavior, such a redirect will not include credentials automatically. However, the old behavior could lead to unintentional credential leakage when redirecting to untrusted origins. + +To retain the old behavior, set the `retain_authorization_on_cross_origin_redirect` flag. diff --git a/src/content/compatibility-flags/strip-bom-in-read-all-text.md b/src/content/compatibility-flags/strip-bom-in-read-all-text.md new file mode 100644 index 00000000000..56284f4f516 --- /dev/null +++ b/src/content/compatibility-flags/strip-bom-in-read-all-text.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Strip UTF-8 BOM in stream `readAllText()`" +sort_date: "2026-01-13" +enable_date: "2026-01-13" +enable_flag: "strip_bom_in_read_all_text" +disable_flag: "do_not_strip_bom_in_read_all_text" +--- + +When `strip_bom_in_read_all_text` is enabled, the `readAllText()` method on streams will strip a leading UTF-8 Byte Order Mark (BOM) if present, matching the expected behavior per web platform standards. + +Previously, the BOM was included in the returned string, which could cause unexpected behavior when parsing text content. diff --git a/src/content/compatibility-flags/text-decoder-cjk-decoder.md b/src/content/compatibility-flags/text-decoder-cjk-decoder.md new file mode 100644 index 00000000000..9af649ad6d8 --- /dev/null +++ b/src/content/compatibility-flags/text-decoder-cjk-decoder.md @@ -0,0 +1,14 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Dedicated CJK TextDecoder implementation" +sort_date: "2026-03-03" +enable_date: "2026-03-03" +enable_flag: "text_decoder_cjk_decoder" +disable_flag: "disable_text_decoder_cjk_decoder" +--- + +When `text_decoder_cjk_decoder` is enabled, a dedicated CJK `TextDecoder` implementation is used for CJK encoding overrides and Big5 lead-byte handling, instead of the legacy ICU-only code path. This improves spec compliance for CJK text decoding. diff --git a/src/content/compatibility-flags/text-decoder-replace-surrogates.md b/src/content/compatibility-flags/text-decoder-replace-surrogates.md new file mode 100644 index 00000000000..588763a9495 --- /dev/null +++ b/src/content/compatibility-flags/text-decoder-replace-surrogates.md @@ -0,0 +1,14 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "TextDecoder replaces lone surrogates" +sort_date: "2026-02-24" +enable_date: "2026-02-24" +enable_flag: "text_decoder_replace_surrogates" +disable_flag: "disable_text_decoder_replace_surrogates" +--- + +When `text_decoder_replace_surrogates` is enabled, the UTF-16le `TextDecoder` will replace lone surrogates with U+FFFD (the Unicode replacement character) as required by the [Encoding Standard](https://encoding.spec.whatwg.org/). Previously, lone surrogates were passed through unchanged, producing non-well-formed strings. diff --git a/src/content/compatibility-flags/unhandled-rejection-after-microtask-checkpoint.md b/src/content/compatibility-flags/unhandled-rejection-after-microtask-checkpoint.md new file mode 100644 index 00000000000..e8283b83a1a --- /dev/null +++ b/src/content/compatibility-flags/unhandled-rejection-after-microtask-checkpoint.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Defer unhandled rejection processing to after microtask checkpoint" +sort_date: "2026-03-03" +enable_date: "2026-03-03" +enable_flag: "unhandled_rejection_after_microtask_checkpoint" +disable_flag: "no_unhandled_rejection_after_microtask_checkpoint" +--- + +When `unhandled_rejection_after_microtask_checkpoint` is enabled, `unhandledrejection` event processing is deferred until the microtask checkpoint completes. This avoids misfires on multi-tick promise chains where a rejection handler is added in a later microtask. + +Previously, unhandled rejection processing could fire prematurely before all microtasks in the current checkpoint had been processed, leading to false `unhandledrejection` events for promises that were actually handled. diff --git a/src/content/compatibility-flags/urlpattern-standard.md b/src/content/compatibility-flags/urlpattern-standard.md new file mode 100644 index 00000000000..b6c5e54384f --- /dev/null +++ b/src/content/compatibility-flags/urlpattern-standard.md @@ -0,0 +1,18 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Spec-compliant URLPattern implementation" +sort_date: "2025-05-01" +enable_date: "2025-05-01" +enable_flag: "urlpattern_standard" +disable_flag: "urlpattern_original" +--- + +The original `URLPattern` implementation was not fully compliant with the [WHATWG URLPattern Standard](https://urlpattern.spec.whatwg.org/), leading to a number of issues reported by users. + +With `urlpattern_standard` enabled, Workers uses a spec-compliant URLPattern implementation. This is a breaking change from the original behavior, so it is gated behind a compatibility flag. + +If you are using `URLPattern` and encounter unexpected behavior changes after updating your compatibility date, you can set `urlpattern_original` to revert to the previous implementation. diff --git a/src/content/compatibility-flags/websocket-close-reason-byte-limit.md b/src/content/compatibility-flags/websocket-close-reason-byte-limit.md new file mode 100644 index 00000000000..40251136fc8 --- /dev/null +++ b/src/content/compatibility-flags/websocket-close-reason-byte-limit.md @@ -0,0 +1,16 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Enforce WebSocket close reason byte limit" +sort_date: "2026-03-03" +enable_date: "2026-03-03" +enable_flag: "websocket_close_reason_byte_limit" +disable_flag: "no_websocket_close_reason_byte_limit" +--- + +When `websocket_close_reason_byte_limit` is enabled, `WebSocket.close()` throws a `SyntaxError` `DOMException` if the `reason` string exceeds 123 bytes when UTF-8 encoded, as required by the [WHATWG WebSocket spec](https://websockets.spec.whatwg.org/) and [RFC 6455 Section 5.5](https://www.rfc-editor.org/rfc/rfc6455#section-5.5). + +Previously, Workers allowed arbitrarily long close reasons without validation. diff --git a/src/content/compatibility-flags/writable-stream-spec-compliant-writer.md b/src/content/compatibility-flags/writable-stream-spec-compliant-writer.md new file mode 100644 index 00000000000..d845ffbce54 --- /dev/null +++ b/src/content/compatibility-flags/writable-stream-spec-compliant-writer.md @@ -0,0 +1,14 @@ +--- +_build: + publishResources: false + render: never + list: never + +name: "Spec-compliant WritableStream writer behavior" +sort_date: "2026-03-24" +enable_date: "2026-03-24" +enable_flag: "writable_stream_spec_compliant_writer" +disable_flag: "no_writable_stream_spec_compliant_writer" +--- + +When `writable_stream_spec_compliant_writer` is enabled, several `WritableStream` spec compliance issues around writer lock and release behavior are fixed to match the [WHATWG Streams Standard](https://streams.spec.whatwg.org/).