Skip to content

Commit 76d9aa2

Browse files
authored
enable_nodejs_http_server_modules is no more experimental (#10463)
1 parent c4fde06 commit 76d9aa2

File tree

5 files changed

+30
-79
lines changed

5 files changed

+30
-79
lines changed

.changeset/bumpy-mice-follow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/unenv-preset": patch
3+
---
4+
5+
Remove experimental from the enable_nodejs_http_server_modules flag

packages/unenv-preset/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
},
5050
"peerDependencies": {
5151
"unenv": "2.0.0-rc.19",
52-
"workerd": "^1.20250802.0"
52+
"workerd": "^1.20250816.0"
5353
},
5454
"peerDependenciesMeta": {
5555
"workerd": {

packages/unenv-preset/src/preset.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,20 @@ function getHttpOverrides({
161161
return { nativeModules: [], hybridModules: [] };
162162
}
163163

164-
const httpServerEnabledByFlag =
165-
compatibilityFlags.includes("enable_nodejs_http_server_modules") &&
166-
compatibilityFlags.includes("experimental");
164+
const httpServerEnabledByFlag = compatibilityFlags.includes(
165+
"enable_nodejs_http_server_modules"
166+
);
167167

168168
const httpServerDisabledByFlag = compatibilityFlags.includes(
169169
"disable_nodejs_http_server_modules"
170170
);
171171

172+
const httpServerEnabledByDate = compatibilityDate >= "2025-09-01";
173+
172174
// Note that `httpServerEnabled` requires `httpEnabled`
173-
// TODO: add `httpServerEnabledByDate` when a default date is set
174175
const httpServerEnabled =
175-
httpServerEnabledByFlag && !httpServerDisabledByFlag;
176+
(httpServerEnabledByFlag || httpServerEnabledByDate) &&
177+
!httpServerDisabledByFlag;
176178

177179
// Override unenv base aliases with native and hybrid modules
178180
// `node:https` is fully implemented by workerd if both flags are enabled

packages/wrangler/e2e/unenv-preset/preset.test.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,62 +33,64 @@ const testConfigs: TestConfig[] = [
3333
[
3434
{
3535
name: "http disabled by date",
36-
compatibilityDate: "2025-07-26",
36+
compatibilityDate: "2024-09-23",
3737
expectRuntimeFlags: {
3838
enable_nodejs_http_modules: false,
3939
},
4040
},
4141
{
4242
name: "http disabled by flag",
43-
// TODO: use a date when http is enabled by default (> 2025-08-15)
44-
compatibilityDate: "2025-07-26",
43+
compatibilityDate: "2025-08-15",
4544
compatibilityFlags: ["disable_nodejs_http_modules"],
4645
expectRuntimeFlags: {
4746
enable_nodejs_http_modules: false,
4847
},
4948
},
50-
// TODO: add a config when http is enabled by default (> 2025-08-15)
5149
{
5250
name: "http enabled by flag",
53-
compatibilityDate: "2025-07-26",
51+
compatibilityDate: "2024-09-23",
5452
compatibilityFlags: ["enable_nodejs_http_modules"],
5553
expectRuntimeFlags: {
5654
enable_nodejs_http_modules: true,
5755
},
5856
},
57+
{
58+
name: "http enabled by date",
59+
compatibilityDate: "2025-08-15",
60+
expectRuntimeFlags: {
61+
enable_nodejs_http_modules: true,
62+
},
63+
},
5964
],
6065
// http client and server modules
6166
[
6267
{
6368
name: "http server disabled by date",
64-
compatibilityDate: "2025-07-26",
65-
compatibilityFlags: ["experimental"],
69+
compatibilityDate: "2024-09-23",
6670
expectRuntimeFlags: {
6771
enable_nodejs_http_modules: false,
6872
},
6973
},
70-
// TODO: add a config when http server is enabled by default (date no set yet)
74+
// TODO: add a config when http server is enabled by default (>= 2025-09-01)
7175
{
7276
name: "http server enabled by flag",
73-
compatibilityDate: "2025-07-26",
77+
compatibilityDate: "2024-09-23",
7478
compatibilityFlags: [
7579
"enable_nodejs_http_modules",
7680
"enable_nodejs_http_server_modules",
77-
"experimental",
7881
],
7982
expectRuntimeFlags: {
8083
enable_nodejs_http_modules: true,
8184
enable_nodejs_http_server_modules: true,
8285
},
8386
},
84-
// TODO: change the date pass the default enabled date (date not set yet)
87+
// TODO: change the date pass the default enabled date (>= 2025-09-01)
8588
{
8689
name: "http server disabled by flag",
87-
compatibilityDate: "2025-07-26",
90+
compatibilityDate: "2024-09-23",
8891
compatibilityFlags: [
8992
"enable_nodejs_http_modules",
9093
"disable_nodejs_http_server_modules",
91-
"experimental",
9294
],
9395
expectRuntimeFlags: {
9496
enable_nodejs_http_modules: true,

pnpm-lock.yaml

Lines changed: 2 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)