Skip to content

Commit 8938faf

Browse files
jasnellvicb
andauthored
Update recently added compatibility flags (#24083)
* Update recently added compatibility flags * Update src/content/compatibility-flags/enable-nodejs-http-modules.md Co-authored-by: Victor Berchet <[email protected]> * Update src/content/compatibility-flags/enable-nodejs-http-modules.md --------- Co-authored-by: Victor Berchet <[email protected]>
1 parent 3a31ac0 commit 8938faf

12 files changed

+233
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
_build:
3+
publishResources: false
4+
render: never
5+
list: never
6+
7+
name: "Enable eval during startup"
8+
sort_date: "2025-06-01"
9+
enable_date: "2025-06-01"
10+
enable_flag: "allow_eval_during_startup"
11+
disable_flag: "disallow_eval_during_startup"
12+
---
13+
14+
When the `allow_eval_during_startup` flag is set, Workers can use `eval()`
15+
and `new Function(text)` during the startup phase of a Worker script. This
16+
allows for dynamic code execution at the beginning of a Worker lifecycle.
17+
18+
When the `disallow_eval_during_startup` flag is set, using `eval()` or
19+
`new Function(text)` during the startup phase will throw an error.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
_build:
3+
publishResources: false
4+
render: never
5+
list: never
6+
7+
name: "Bind AsyncLocalStorage snapshots to the request"
8+
sort_date: "2025-06-16"
9+
enable_date: "2025-06-16"
10+
enable_flag: "bind_asynclocalstorage_snapshot_to_request"
11+
disable_flag: "do_not_bind_asynclocalstorage_snapshot_to"
12+
---
13+
14+
The AsyncLocalStorage frame can capture values that are bound to the
15+
current request context. This is not always in the users control since we use
16+
the ALS storage frame to propagate internal trace spans as well as
17+
user-provided values. When the `bind_asynclocalstorage_snapshot_to_request`
18+
flag is set, the runtime binds the snapshot / bound functions to the current
19+
request context and will throw an error if the bound functions are called
20+
outside of the request in which they were created.
21+
22+
The `do_not_bind_asynclocalstorage_snapshot_to` flag disables this behavior.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
_build:
3+
publishResources: false
4+
render: never
5+
list: never
6+
7+
name: "Disallowing importable environment"
8+
sort_date: "2025-05-05"
9+
enable_flag: "disallow_importable_env"
10+
disable_flag: "allow_importable_env"
11+
---
12+
13+
When the `disallow_importable_env` flag is enabled, Workers will not allow importing the
14+
environment variables via the `cloudflare:workers` module and will not populate the
15+
environment variables in the global `process.env` object when Node.js compatibility is
16+
enabled.
17+
18+
There is no default enabled date for this flag.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
_build:
3+
publishResources: false
4+
render: never
5+
list: never
6+
7+
name: "Enable `navigator.language`"
8+
sort_date: "2025-05-19"
9+
enable_date: "2025-05-19"
10+
enable_flag: "enable_navigator_language"
11+
disable_flag: "disable_navigator_language"
12+
---
13+
14+
When the `enable_navigator_language` flag is set, the `navigator.language` property
15+
will be available in Workers. For now, the value of `navigator.language` will
16+
always be `en`.
17+
18+
When the `disable_navigator_language` flag is set, the `navigator.language` property
19+
will not be available.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
_build:
3+
publishResources: false
4+
render: never
5+
list: never
6+
7+
name: "Enable availability of `node:http` and `node:https` modules"
8+
sort_date: "2025-08-15"
9+
enable_date: "2025-08-15"
10+
enable_flag: "enable_nodejs_http_modules"
11+
disable_flag: "disable_nodejs_http_modules"
12+
---
13+
14+
The `enable_nodejs_http_modules` flag enables the availability of Node.js
15+
`node:http` and `node:https` modules in Workers (client APIS only).
16+
17+
The `disable_nodejs_http_modules` flag disables the availability of these
18+
modules.
19+
20+
This enables compatibility with Node.js libraries and existing code that
21+
use the standard node:http and node:https APIs for making HTTP requests.
22+
The available functionality includes:
23+
24+
* `http.request()` and `https.request()` for making HTTP/HTTPS requests
25+
* `http.get()` and `https.get()` for making GET requests
26+
* Request and response objects with standard Node.js APIs
27+
* Support for standard HTTP methods, headers, and options
28+
29+
See the [Node.js documentation](https://nodejs.org/docs/latest/api/http.html)
30+
for more details about the Node.js APIs.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
_build:
3+
publishResources: false
4+
render: never
5+
list: never
6+
7+
name: "Expose global MessageChannel and MessagePort"
8+
sort_date: "2025-08-15"
9+
enable_date: "2025-08-15"
10+
enable_flag: "expose_global_message_channel"
11+
disable_flag: "no_expose_global_message_channel"
12+
---
13+
14+
When the `expose_global_message_channel` flag is set, Workers will expose
15+
the `MessageChannel` and `MessagePort` constructors globally.
16+
17+
When the `no_expose_global_message_channel` flag is set, Workers will not
18+
expose these.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
_build:
3+
publishResources: false
4+
render: never
5+
list: never
6+
7+
name: "Pedantic Web Platform Tests (WPT) compliance"
8+
sort_date: "2025-07-15"
9+
enable_flag: "pedantic_wpt"
10+
disable_flag: "non_pedantic_wpt"
11+
---
12+
13+
The `pedantic_wpt` flag enables strict compliance with Web Platform Tests (WPT)
14+
in Workers. Initially this only effects `Event` and `EventTarget` APIs but
15+
will be expanded to other APIs in the future. There is no default enable
16+
date for this flag.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
_build:
3+
publishResources: false
4+
render: never
5+
list: never
6+
7+
name: "Disable global handlers for Python Workers"
8+
sort_date: "2025-08-14"
9+
enable_date: "2025-08-14"
10+
enable_flag: "python_no_global_handlers"
11+
disable_flag: "disable_python_no_global_handlers"
12+
---
13+
14+
When the `python_no_global_handlers` flag is set, Python Workers will disable
15+
the global handlers and enforce their use via default entrypoint classes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
_build:
3+
publishResources: false
4+
render: never
5+
list: never
6+
7+
name: "Passthrough AbortSignal of incoming request to subrequests"
8+
sort_date: "2025-05-05"
9+
enable_flag: "request_signal_passthrough"
10+
disable_flag: "no_request_signal_passthrough"
11+
---
12+
13+
When the `request_signal_passthrough` flag set, the `AbortSignal` of an incoming
14+
request will be passed through to subrequests when the request is forwarded to
15+
a subrequest using the `fetch()` API.
16+
17+
The the `no_request_signal_passthrough` flag is set, the `AbortSignal` of the
18+
incoming request will not be passed through.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
_build:
3+
publishResources: false
4+
render: never
5+
list: never
6+
7+
name: "Set the `this` value of EventTarget event handlers"
8+
sort_date: "2025-08-01"
9+
enable_date: "2025-08-01"
10+
enable_flag: "set_event_target_this"
11+
disable_flag: "no_set_event_target_this"
12+
---
13+
14+
When the `set_event_target_this` flag is se, Workers will set the `this` value
15+
of event handlers to the `EventTarget` instance that the event is being
16+
dispatched on. This is compliant with the specification.
17+
18+
When then `no_set_event_target_this` flag is set, Workers will not set the
19+
`this` value of event handlers, and it will be `undefined` instead.

0 commit comments

Comments
 (0)