Skip to content

Enable Node streams by default#94311

Merged
timneutkens merged 4 commits into
codex/node-stream-test-updatesfrom
codex/use-node-streams-default-on
Jun 2, 2026
Merged

Enable Node streams by default#94311
timneutkens merged 4 commits into
codex/node-stream-test-updatesfrom
codex/use-node-streams-default-on

Conversation

@timneutkens
Copy link
Copy Markdown
Contributor

@timneutkens timneutkens commented Jun 1, 2026

What?

Defaults experimental.useNodeStreams to true while keeping the experimental config flag and explicit false opt-out available. Removes redundant dedicated node-stream CI jobs because the ordinary path exercises Node streams after this change.

Depends on the standalone test compatibility update in #94347, which intentionally remains outside the Node streams PR stack.

Why?

Node streams can be exercised through the standard Node.js App Router test path once they are the default, allowing a smaller rollout before the larger follow-up that removes the flag and obsolete plumbing.

CI exposed one necessary compatibility fix for this intermediate state: projects with a next.config.* received the new default after raw experimental-feature processing, leaving the runtime stream selector on the web implementation while compiled app code selected Node stream helpers.

How?

  • Set defaultConfig.experimental.useNodeStreams to true.
  • Synchronize __NEXT_USE_NODE_STREAMS from the fully resolved config, including cached and standalone resolved configs, so defaults and adapter modifications are reflected at runtime.
  • Preserve the current public config/schema and explicit experimental: { useNodeStreams: false } opt-out; edge bundles continue to define the stream flag as false.
  • Remove the dedicated node-stream test jobs and now-unused manifest; the affected streaming assertion compatibility changes are isolated in Delay Node Fizz piping until after render task #94347.

Verification

Run before extracting the prerequisite assertion changes into #94347:

  • pnpm --filter=next types
  • pnpm --filter=next build
  • IS_WEBPACK_TEST=1 __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true pnpm test-start-webpack test/e2e/app-dir/ppr-root-param-fallback/ppr-root-param-fallback.test.ts
  • IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true pnpm test-start-turbo test/e2e/app-dir/ppr-root-param-fallback/ppr-root-param-fallback.test.ts
  • IS_WEBPACK_TEST=1 __NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true pnpm test-start-webpack test/e2e/app-dir/use-server-inserted-html/use-server-inserted-html.test.ts
  • pnpm test-dev-webpack test/e2e/app-dir/ppr-root-param-fallback/ppr-root-param-fallback.test.ts test/e2e/app-dir/use-server-inserted-html/use-server-inserted-html.test.ts
  • pnpm test-dev-turbo test/e2e/app-dir/ppr-root-param-fallback/ppr-root-param-fallback.test.ts test/e2e/app-dir/use-server-inserted-html/use-server-inserted-html.test.ts
  • pnpm test-start-webpack test/production/app-dir/use-node-streams-env-precedence/use-node-streams-env-precedence.test.ts
  • pnpm test-start-webpack test/e2e/app-dir/app/standalone.test.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Stats cancelled

Commit: 097ed49
View workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Tests Passed

Commit: 097ed49

@timneutkens timneutkens marked this pull request as ready for review June 1, 2026 16:48
@timneutkens timneutkens requested a review from unstubbable June 1, 2026 16:48
Copy link
Copy Markdown
Contributor

@unstubbable unstubbable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need any test changes in this PR? Shouldn't those tests already have been verified with Node streams in the specific jobs that this PR deletes?

@timneutkens timneutkens force-pushed the codex/use-node-streams-default-on branch 2 times, most recently from 5691661 to 94a44c2 Compare June 1, 2026 19:01
Comment thread packages/next/src/server/config.ts
@timneutkens timneutkens force-pushed the codex/use-node-streams-default-on branch from 6f1b5b1 to 47190a9 Compare June 2, 2026 11:48
@timneutkens timneutkens changed the base branch from canary to hl/fix-node-streams-debug-channel-close June 2, 2026 11:49
Base automatically changed from hl/fix-node-streams-debug-channel-close to canary June 2, 2026 12:46
Copy link
Copy Markdown
Contributor

@vercel vercel Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Leaving useNodeStreams enabled by default while reverting the two test files' node-stream assertions makes those e2e tests fail under the now-default node streams.

Fix on Vercel

@timneutkens timneutkens force-pushed the codex/use-node-streams-default-on branch from 3171e36 to 591c269 Compare June 2, 2026 17:57
@timneutkens timneutkens force-pushed the codex/use-node-streams-default-on branch from 591c269 to 097ed49 Compare June 2, 2026 18:05
@timneutkens timneutkens changed the base branch from canary to codex/node-stream-test-updates June 2, 2026 18:07
@timneutkens timneutkens requested a review from unstubbable June 2, 2026 19:14
@timneutkens timneutkens merged commit b92cf40 into canary Jun 2, 2026
242 of 245 checks passed
@timneutkens timneutkens deleted the codex/use-node-streams-default-on branch June 2, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants