cloudflare / cloudflare/vinext
Support `experimental.useExperimentalReact` to opt into React's experimental channel
- Dominant language
- TypeScript
- Stars
- 8.8k
- Forks
- 406
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 120
Description
## Summary
Next.js added a new `experimental.useExperimentalReact` config option that opts the app into React's experimental release channel without requiring a side-effect feature like `experimental.taint` to be enabled. The experimental React build emits `` to hold first paint until the streamed shell is coherent, avoiding flicker from partially-streamed HTML.
Previously, opting into the experimental channel required enabling an unrelated feature (`taint`, `transitionIndicator`, or `gestureTransition`) as a side effect. The new flag is a direct opt-in.
## Behavior
- `experimental.useExperimentalReact: true` selects the `react@experimental` build (alongside the existing `taint`/`transitionIndicator`/`gestureTransition` triggers)
- It is opt-in only: an explicit `false` cannot disable the experimental channel when another feature still requires it (the taint APIs only exist in the experimental build); `assignDefaults` warns on that contradiction
- Feeds the existing `needsExperimentalReact` aggregation in `packages/next/src/lib/needs-experimental-react.ts`
## vinext implications
- Add the option to vinext's config schema/types so user configs don't error
- Decide whether to wire it up to a React channel switch (vinext currently doesn't ship the experimental React build by default); at minimum, accept the flag without crashing and document the support level
- If we do support it: validate the same contradiction-warning behavior when set to `false` alongside `taint`/`transitionIndicator`/`gestureTransition`
## Upstream
- Commit: vercel/next.js@71b70e01b89ad9105de4816c7a814e55340edb57
- PR: https://github.com/vercel/next.js/pull/94861
- Test: `test/e2e/app-dir/rsc-basic/rsc-basic-use-experimental-react.test.ts`
Contributor guide
Research direction
Start with vinext's config schema/types and existing handling for experimental options, then compare the upstream needs-experimental-react behavior and the named RSC test. Done means user configs accept experimental.useExperimentalReact without crashing, with the supported behavior documented; if React channel switching is implemented, verify the contradiction warning alongside the listed experimental features.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, react, typescript
- Domain
- tooling, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100