Skip to content

feat(config): support experimental.useExperimentalReact (#2109)#2167

Open
Divkix wants to merge 2 commits into
cloudflare:mainfrom
Divkix:fix/issue-2109
Open

feat(config): support experimental.useExperimentalReact (#2109)#2167
Divkix wants to merge 2 commits into
cloudflare:mainfrom
Divkix:fix/issue-2109

Conversation

@Divkix

@Divkix Divkix commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements experimental.useExperimentalReact from Next.js (vercel/next.js#94861, closes #2109).

Next.js added experimental.useExperimentalReact as a direct opt-in to React's experimental release channel, replacing the need to enable an unrelated feature (taint/transitionIndicator/gestureTransition) as a side effect. The experimental React build emits <link rel="expect"> to hold first paint until the streamed shell is coherent.

vinext does not ship React's experimental build (and no existing flag like taint drives a React-channel switch), so this change matches the precedent set by appShells/cachedNavigations: accept the flag for config compatibility and replicate the assignDefaults contradiction warning, rather than wiring up a channel switch.

Changes

  • config/next-config.ts
    • Add the typed experimental.useExperimentalReact?: boolean option with a doc-comment porting Next.js's description and documenting vinext's support level.
    • Replicate Next.js's assignDefaults warning: when useExperimentalReact is explicitly false but taint / transitionIndicator / gestureTransition still require the experimental channel, warn (an explicit false cannot disable the channel those features require).
  • tests/next-config.test.ts — add coverage for accepting the flag (true/false without throwing), the contradiction warning (single + multiple dependents), and the no-warn cases. Ported from Next.js' rsc-basic-use-experimental-react.test.ts.

Support level

useExperimentalReact is accepted so user configs don't error, but it has no functional effect today because vinext does not ship React's experimental build. This is documented in the type doc-comment and surfaced in the warning text.

Verification

  • vp test run tests/next-config.test.ts — 208 passed
  • vp check — format, lint, and type checks clean

Upstream

@pkg-pr-new

pkg-pr-new Bot commented Jun 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@2167
npm i https://pkg.pr.new/vinext@2167

commit: 08713ed

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 08713ed against base 42f8700.

0 improved · 4 regressed · 2 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) Next.js 185.6 KB 185.6 KB ⚫ 0.0%
Client bundle size (gzip) vinext 129.9 KB 129.9 KB ⚫ -0.0%
Dev server cold start Next.js 2.26 s 2.45 s 🔴 +8.4%
Dev server cold start vinext 2.44 s 2.67 s 🔴 +9.5%
Production build time Next.js 3.98 s 4.37 s 🔴 +9.8%
Production build time vinext 2.66 s 2.89 s 🔴 +8.7%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5%

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.

Support experimental.useExperimentalReact to opt into React's experimental channel

1 participant