From e275ffb511bb05ec3f71d9d96c7b94b69f02b9fd Mon Sep 17 00:00:00 2001 From: emily-shen <69125074+emily-shen@users.noreply.github.com> Date: Wed, 14 Jan 2026 11:31:19 +0000 Subject: [PATCH 1/4] add comment to media binding test (#11911) --- .../e2e/remote-binding/miniflare-remote-resources.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/wrangler/e2e/remote-binding/miniflare-remote-resources.test.ts b/packages/wrangler/e2e/remote-binding/miniflare-remote-resources.test.ts index 8a30b0ddafc9..0d8c25301737 100644 --- a/packages/wrangler/e2e/remote-binding/miniflare-remote-resources.test.ts +++ b/packages/wrangler/e2e/remote-binding/miniflare-remote-resources.test.ts @@ -347,6 +347,8 @@ const testCases: TestCase[] = [ }), expectFetchToMatch: [expect.stringContaining(`image/avif`)], }, + // TODO: re-enable when Media binding is stable again + // (this is an unreleased feature that temporarily broke in the course of development) // { // name: "Media", // scriptPath: "media.js", From d39777f1e354e8f3abd02164e76c2501e47e713f Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 14 Jan 2026 11:51:01 +0000 Subject: [PATCH 2/4] feat(unenv-preset): add support for native node:_stream_wrap module (#11799) * feat(unenv-preset): add support for native node:_stream_wrap module Co-Authored-By: pbacondarwin@cloudflare.com * fix: use backticks instead of backslash escapes in changeset Co-Authored-By: pbacondarwin@cloudflare.com * fix: include nodejs_compat in changeset example Co-Authored-By: pbacondarwin@cloudflare.com * fix: address reviewer feedback - simplify changeset, remove comments, add TODOs Co-Authored-By: pbacondarwin@cloudflare.com * fix: update testStreamWrap to check for JSStreamSocket export Co-Authored-By: pbacondarwin@cloudflare.com * fix: handle case where streamWrap import returns function directly Co-Authored-By: pbacondarwin@cloudflare.com * fixup! test --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Victor Berchet --- .changeset/native-stream-wrap-module.md | 5 +++ packages/unenv-preset/src/preset.ts | 39 +++++++++++++++++++ .../wrangler/e2e/unenv-preset/preset.test.ts | 25 ++++++++++++ .../wrangler/e2e/unenv-preset/worker/index.ts | 13 +++++++ 4 files changed, 82 insertions(+) create mode 100644 .changeset/native-stream-wrap-module.md diff --git a/.changeset/native-stream-wrap-module.md b/.changeset/native-stream-wrap-module.md new file mode 100644 index 000000000000..6b28766c717e --- /dev/null +++ b/.changeset/native-stream-wrap-module.md @@ -0,0 +1,5 @@ +--- +"@cloudflare/unenv-preset": minor +--- + +Add support for native `node:_stream_wrap` module when the `enable_nodejs_stream_wrap_module` compatibility flag is enabled. This feature is currently experimental and requires `nodejs_compat`, `experimental`, and `enable_nodejs_stream_wrap_module` compatibility flags to be set. diff --git a/packages/unenv-preset/src/preset.ts b/packages/unenv-preset/src/preset.ts index 44570156ba5f..38c10340fb86 100644 --- a/packages/unenv-preset/src/preset.ts +++ b/packages/unenv-preset/src/preset.ts @@ -82,6 +82,7 @@ export function getCloudflarePreset({ const inspectorOverrides = getInspectorOverrides(compat); const sqliteOverrides = getSqliteOverrides(compat); const dgramOverrides = getDgramOverrides(compat); + const streamWrapOverrides = getStreamWrapOverrides(compat); // "dynamic" as they depend on the compatibility date and flags const dynamicNativeModules = [ @@ -100,6 +101,7 @@ export function getCloudflarePreset({ ...inspectorOverrides.nativeModules, ...sqliteOverrides.nativeModules, ...dgramOverrides.nativeModules, + ...streamWrapOverrides.nativeModules, ]; // "dynamic" as they depend on the compatibility date and flags @@ -119,6 +121,7 @@ export function getCloudflarePreset({ ...inspectorOverrides.hybridModules, ...sqliteOverrides.hybridModules, ...dgramOverrides.hybridModules, + ...streamWrapOverrides.hybridModules, ]; return { @@ -713,3 +716,39 @@ function getDgramOverrides({ hybridModules: [], }; } + +/** + * Returns the overrides for `node:_stream_wrap` (unenv or workerd) + * + * The native _stream_wrap implementation: + * - is experimental and has no default enable date + * - can be enabled with the "enable_nodejs_stream_wrap_module" flag + * - can be disabled with the "disable_nodejs_stream_wrap_module" flag + */ +function getStreamWrapOverrides({ + compatibilityFlags, +}: { + compatibilityDate: string; + compatibilityFlags: string[]; +}): { nativeModules: string[]; hybridModules: string[] } { + const disabledByFlag = compatibilityFlags.includes( + "disable_nodejs_stream_wrap_module" + ); + + const enabledByFlag = + compatibilityFlags.includes("enable_nodejs_stream_wrap_module") && + compatibilityFlags.includes("experimental"); + + const enabled = enabledByFlag && !disabledByFlag; + + // When enabled, use the native `_stream_wrap` module from workerd + return enabled + ? { + nativeModules: ["_stream_wrap"], + hybridModules: [], + } + : { + nativeModules: [], + hybridModules: [], + }; +} diff --git a/packages/wrangler/e2e/unenv-preset/preset.test.ts b/packages/wrangler/e2e/unenv-preset/preset.test.ts index 78ccc05babaa..8d63b8164382 100644 --- a/packages/wrangler/e2e/unenv-preset/preset.test.ts +++ b/packages/wrangler/e2e/unenv-preset/preset.test.ts @@ -412,6 +412,8 @@ const localTestConfigs: TestConfig[] = [ ], // node:inspector and node:inspector/promises (experimental, no default enable date) [ + // TODO: add test for disabled by date (no date defined yet) + // TODO: add test for enabled by date (no date defined yet) { name: "inspector enabled by flag", compatibilityDate: "2024-09-23", @@ -420,6 +422,7 @@ const localTestConfigs: TestConfig[] = [ enable_nodejs_inspector_module: true, }, }, + // TODO: update the date past the default enable date (when defined) { name: "inspector disabled by flag", compatibilityDate: "2024-09-23", @@ -472,6 +475,28 @@ const localTestConfigs: TestConfig[] = [ }, }, ], + // node:_stream_wrap (experimental, no default enable date) + [ + // TODO: add test for disabled by date (no date defined yet) + // TODO: add test for enabled by date (no date defined yet) + { + name: "_stream_wrap enabled by flag", + compatibilityDate: "2024-09-23", + compatibilityFlags: ["enable_nodejs_stream_wrap_module", "experimental"], + expectRuntimeFlags: { + enable_nodejs_stream_wrap_module: true, + }, + }, + // TODO: update the date past the default enable date (when defined) + { + name: "_stream_wrap disabled by flag", + compatibilityDate: "2024-09-23", + compatibilityFlags: ["disable_nodejs_stream_wrap_module", "experimental"], + expectRuntimeFlags: { + enable_nodejs_stream_wrap_module: false, + }, + }, + ], ].flat() as TestConfig[]; describe.each(localTestConfigs)( diff --git a/packages/wrangler/e2e/unenv-preset/worker/index.ts b/packages/wrangler/e2e/unenv-preset/worker/index.ts index b96bb324e60e..377bec63eb5f 100644 --- a/packages/wrangler/e2e/unenv-preset/worker/index.ts +++ b/packages/wrangler/e2e/unenv-preset/worker/index.ts @@ -846,6 +846,19 @@ export const WorkerdTests: Record void> = { Socket: "function", }); }, + + async testStreamWrap() { + if (!getRuntimeFlagValue("enable_nodejs_stream_wrap_module")) { + // `node:_stream_wrap` is implemented as a mock in unenv + return; + } + + // @ts-expect-error TS2307 - _stream_wrap is an internal Node.js module without type declarations + const streamWrap = await import("node:_stream_wrap"); + + // `JSStreamSocket` is the default export of `node:_stream_wrap` + assertTypeOf(streamWrap, "default", "function"); + }, }; /** From c808a6f06a65e45a7b85df2f1a20b5368f80fbfb Mon Sep 17 00:00:00 2001 From: emily-shen <69125074+emily-shen@users.noreply.github.com> Date: Wed, 14 Jan 2026 12:12:32 +0000 Subject: [PATCH 3/4] skip changeset review on dependency updates (#11914) --- .github/dependabot.yml | 1 + .github/workflows/changeset-review.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 279bbe465503..6b305ec909be 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -19,6 +19,7 @@ updates: - "c3" - "dependencies" - "skip-pr-description-validation" + - "skip-changeset-review" # Check for workerd & workers-types updates for Miniflare - package-ecosystem: "npm" diff --git a/.github/workflows/changeset-review.yml b/.github/workflows/changeset-review.yml index 89cedc07f02c..7ee2be8372e2 100644 --- a/.github/workflows/changeset-review.yml +++ b/.github/workflows/changeset-review.yml @@ -62,6 +62,8 @@ jobs: 1. **Version Type**: Correct patch/minor/major (major forbidden for wrangler) 2. **Changelog Quality**: Meaningful descriptions with examples for features 3. **Markdown Headers**: No h1/h2/h3 headers (breaks changelog formatting) + 4. **Analytics**: If the change collects more analytics, it should be a minor even though there is no user-visible change + 5. **Dependabot**: Do not validate dependency update changesets for create-cloudflare If all changesets pass, just output "✅ All changesets look good" - no need for a detailed checklist. From 8520a9c16768b6e37af812cea37f01f9577dc39c Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 14 Jan 2026 14:35:44 +0100 Subject: [PATCH 4/4] =?UTF-8?q?test(unenv-preset):=20add=20compat=20date?= =?UTF-8?q?=20tests=20for=20module=20that=20have=20a=20defa=E2=80=A6=20(#1?= =?UTF-8?q?1912)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(unenv-preset): add compat date tests for module that have a default date * fixup! add wasi --- .../wrangler/e2e/unenv-preset/preset.test.ts | 100 ++++++++++++++---- 1 file changed, 78 insertions(+), 22 deletions(-) diff --git a/packages/wrangler/e2e/unenv-preset/preset.test.ts b/packages/wrangler/e2e/unenv-preset/preset.test.ts index 8d63b8164382..4a8a4e3ae5f2 100644 --- a/packages/wrangler/e2e/unenv-preset/preset.test.ts +++ b/packages/wrangler/e2e/unenv-preset/preset.test.ts @@ -269,8 +269,21 @@ const localTestConfigs: TestConfig[] = [ ], // node:punycode [ - // TODO: add test for disabled by date (2025-12-04) - // TODO: add test for enabled by date (2025-12-04) + { + name: "punycode enabled by date", + compatibilityDate: "2025-12-04", + compatibilityFlags: ["enable_nodejs_punycode_module"], + expectRuntimeFlags: { + enable_nodejs_punycode_module: true, + }, + }, + { + name: "punycode disabled by date", + compatibilityDate: "2024-09-23", + expectRuntimeFlags: { + enable_nodejs_punycode_module: false, + }, + }, { name: "punycode enabled by flag", compatibilityDate: "2024-09-23", @@ -279,10 +292,9 @@ const localTestConfigs: TestConfig[] = [ enable_nodejs_punycode_module: true, }, }, - // TODO: update the date past the default enable date (2025-12-04) { name: "punycode disabled by flag", - compatibilityDate: "2024-09-23", + compatibilityDate: "2025-12-04", compatibilityFlags: ["disable_nodejs_punycode_module"], expectRuntimeFlags: { enable_nodejs_punycode_module: false, @@ -291,8 +303,20 @@ const localTestConfigs: TestConfig[] = [ ], // node:cluster [ - // TODO: add test for disabled by date (2025-12-04) - // TODO: add test for enabled by date (2025-12-04) + { + name: "cluster enabled by date", + compatibilityDate: "2025-12-04", + expectRuntimeFlags: { + enable_nodejs_cluster_module: true, + }, + }, + { + name: "cluster disabled by date", + compatibilityDate: "2024-09-23", + expectRuntimeFlags: { + enable_nodejs_cluster_module: false, + }, + }, { name: "cluster enabled by flag", compatibilityDate: "2024-09-23", @@ -301,10 +325,9 @@ const localTestConfigs: TestConfig[] = [ enable_nodejs_cluster_module: true, }, }, - // TODO: update the date past the default enable date (2025-12-04) { name: "cluster disabled by flag", - compatibilityDate: "2024-09-23", + compatibilityDate: "2025-12-04", compatibilityFlags: ["disable_nodejs_cluster_module"], expectRuntimeFlags: { enable_nodejs_cluster_module: false, @@ -313,8 +336,20 @@ const localTestConfigs: TestConfig[] = [ ], // trace_events [ - // TODO: add test for disabled by date (2025-12-04) - // TODO: add test for enabled by date (2025-12-04) + { + name: "trace_events enabled by date", + compatibilityDate: "2025-12-04", + expectRuntimeFlags: { + enable_nodejs_trace_events_module: true, + }, + }, + { + name: "trace_events disabled by date", + compatibilityDate: "2024-09-23", + expectRuntimeFlags: { + enable_nodejs_trace_events_module: false, + }, + }, { name: "trace_events enabled by flag", compatibilityDate: "2024-09-23", @@ -323,10 +358,9 @@ const localTestConfigs: TestConfig[] = [ enable_nodejs_trace_events_module: true, }, }, - // TODO: update the date past the default enable date (2025-12-04) { name: "trace_events disabled by flag", - compatibilityDate: "2024-09-23", + compatibilityDate: "2025-12-04", compatibilityFlags: ["disable_nodejs_trace_events_module"], expectRuntimeFlags: { enable_nodejs_trace_events_module: false, @@ -335,8 +369,20 @@ const localTestConfigs: TestConfig[] = [ ], // domain [ - // TODO: add test for disabled by date (2025-12-04) - // TODO: add test for enabled by date (2025-12-04) + { + name: "domain enabled by date", + compatibilityDate: "2025-12-04", + expectRuntimeFlags: { + enable_nodejs_domain_module: true, + }, + }, + { + name: "domain disabled by date", + compatibilityDate: "2024-09-23", + expectRuntimeFlags: { + enable_nodejs_domain_module: false, + }, + }, { name: "domain enabled by flag", compatibilityDate: "2024-09-23", @@ -345,10 +391,9 @@ const localTestConfigs: TestConfig[] = [ enable_nodejs_domain_module: true, }, }, - // TODO: update the date past the default enable date (2025-12-04) { name: "domain disabled by flag", - compatibilityDate: "2024-09-23", + compatibilityDate: "2025-12-04", compatibilityFlags: ["disable_nodejs_domain_module"], expectRuntimeFlags: { enable_nodejs_domain_module: false, @@ -357,21 +402,32 @@ const localTestConfigs: TestConfig[] = [ ], // wasi [ - // TODO: add test for disabled by date (no date defined yet) - // TODO: add test for enabled by date (no date defined yet) + { + name: "wasi enabled by date", + compatibilityDate: "2025-12-04", + expectRuntimeFlags: { + enable_nodejs_wasi_module: true, + }, + }, + { + name: "wasi disabled by date", + compatibilityDate: "2024-09-23", + expectRuntimeFlags: { + enable_nodejs_wasi_module: false, + }, + }, { name: "wasi enabled by flag", compatibilityDate: "2024-09-23", - compatibilityFlags: ["enable_nodejs_wasi_module", "experimental"], + compatibilityFlags: ["enable_nodejs_wasi_module"], expectRuntimeFlags: { enable_nodejs_wasi_module: true, }, }, - // TODO: update the date past the default enable date (when defined) { name: "wasi disabled by flag", - compatibilityDate: "2024-09-23", - compatibilityFlags: ["disable_nodejs_wasi_module", "experimental"], + compatibilityDate: "2025-12-04", + compatibilityFlags: ["disable_nodejs_wasi_module"], expectRuntimeFlags: { enable_nodejs_wasi_module: false, },