feat(config): support experimental.useExperimentalReact (#2109)#2167
Open
Divkix wants to merge 2 commits into
Open
feat(config): support experimental.useExperimentalReact (#2109)#2167Divkix wants to merge 2 commits into
Divkix wants to merge 2 commits into
Conversation
…lse contradiction (cloudflare#2109)
commit: |
Contributor
Performance benchmarksCompared 0 improved · 4 regressed · 2 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements
experimental.useExperimentalReactfrom Next.js (vercel/next.js#94861, closes #2109).Next.js added
experimental.useExperimentalReactas 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
taintdrives a React-channel switch), so this change matches the precedent set byappShells/cachedNavigations: accept the flag for config compatibility and replicate theassignDefaultscontradiction warning, rather than wiring up a channel switch.Changes
config/next-config.tsexperimental.useExperimentalReact?: booleanoption with a doc-comment porting Next.js's description and documenting vinext's support level.assignDefaultswarning: whenuseExperimentalReactis explicitlyfalsebuttaint/transitionIndicator/gestureTransitionstill require the experimental channel, warn (an explicitfalsecannot disable the channel those features require).tests/next-config.test.ts— add coverage for accepting the flag (true/falsewithout 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
useExperimentalReactis 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 passedvp check— format, lint, and type checks cleanUpstream