Repository navigation
Comparing changes
Open a pull request
base repository: react/react
base: b618bbb4
head repository: react/react
compare: 07dde64d
- 5 commits
- 175 files changed
- 6 contributors
Commits on Oct 12, 2026
-
[Fiber] Fix DEV crash when use() is passed a non-extensible thenable (#…
…37796) Fixes #37795 ## Summary In DEV, `trackUsedThenable` infers async debug info for a used thenable by attaching a `_debugInfo` expando: ```js if (__DEV__ && thenable._debugInfo === undefined) { ... thenable._debugInfo = [{awaited: ioInfo}]; // throws on non-extensible objects ``` If the thenable was made non-extensible — e.g. a userspace-instrumented thenable (one that already carries a `status`) frozen by an immutable cache before being passed to `use()` — the assignment throws `TypeError: Cannot add property _debugInfo, object is not extensible` from inside React, crashing the render in development while the same code works in production. Since #37772 landed the `enableAsyncDebugInfo` flag for OSS, this path runs for every `use(thenable)` call in DEV, so such thenables now crash where they previously unwrapped fine. This PR skips the debug-info inference when the thenable doesn't allow new properties, mirroring the existing guard for frozen values in Flight's `addAsyncInfo` (`ReactFlightClient.js`), which already skips `_debugInfo` for frozen values ("Debug info is dropped for frozen elements"). Debug info is simply dropped for such thenables; `use()` unwraps the value normally. Note: a *non-instrumented* frozen promise (`use(Object.freeze(promise))`) still hits the pre-existing `pendingThenable.status = 'pending'` assignment in the `default` branch, which requires a different fix (e.g. a WeakMap fallback) — I've flagged that separately in the issue. ## How did you test this change? - Added a regression test in `ReactUse-test.js` (frozen, userspace-instrumented thenable passed to `use()`), which fails on `main` with `TypeError: Cannot add property _debugInfo, object is not extensible` at `ReactFiberThenable.js:192` and passes with this fix. - `yarn test packages/react-reconciler` — 77 suites, 1147 tests passed. - `yarn test packages/react-reconciler/src/__tests__/ReactUse-test.js` in both dev and `--prod` modes — 51 tests passed each. - Related suites pass: `ReactSuspense-test.internal.js`, `ReactSuspenseWithNoopRenderer-test.js`, `ReactLazy-test.internal.js`, `ReactConditionalUseWarning-test.js`, `ReactFlightAsyncDebugInfo-test.js`. - `npx eslint` and `npx prettier --check` clean on both changed files; `yarn flow dom-node` passes. Co-authored-by: zhoubiao188 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 259980d - Browse repository at this point
Copy the full SHA 259980dView commit details -
[compiler] Don't treat comparing a ref-reading function as a ref acce…
…ss (#37688) ## Summary Fixes a false positive in the `react-hooks/refs` validation (`ValidateNoRefAccessInRender`). Fixes #37521. Comparing a function with `===` / `!==` was reported as "Cannot access refs during render" whenever that function reads a ref when called, for example a `useCallback` that closes over `ref.current`: ```js const sampleFunc = useCallback(() => { ref.current = /* ... */; }, []); return sampleFunc !== other ? 'different' : 'same'; ``` A binary operator never invokes its operands, so comparing function identity cannot read `.current`. The `BinaryExpression` case validated its operands with `validateNoRefValueAccess`, which treats a `Structure` type carrying `fn.readRefEffect` the same as an actual ref value. This switches it to `validateNoDirectRefValueAccess`, which only flags a direct `RefValue` operand, so `ref.current === x` still errors while `fn !== otherFn` no longer does. ## How did you test this change? - Added the regression fixture `allow-comparing-ref-accessing-function-identity` (input + `.expect.md`) reproducing the pattern from the issue; it now compiles without error and the eval result is `"different"`. - Direct `ref.current` comparisons continue to error (existing fixtures unchanged). - Ran the full compiler snapshot suite with `yarn snap`: 1828 tests, no regressions. - Ported the same change to the Rust compiler (`validate_no_ref_access_in_render.rs`): `yarn snap --rust` passes all 1828 fixtures against the Rust backend, and `scripts/test-rust-port.sh ValidateNoRefAccessInRender` reports no TS/Rust divergence.
Configuration menu - View commit details
-
Copy full SHA for 2f5370a - Browse repository at this point
Copy the full SHA 2f5370aView commit details -
Migrate all remaining
facebook/reactmentions (#37778)Best reviewed by commit. Mostly motivated to fix local GH artifact attestations. For everything else it just avoids a network hop.
Configuration menu - View commit details
-
Copy full SHA for e8738f0 - Browse repository at this point
Copy the full SHA e8738f0View commit details -
[DOM] Stop hiding siblings after a dehydrated Activity (#37814)
Fixes #37813. ## Summary `hideOrUnhideDehydratedBoundary` accepts an Activity instance but only recognizes Suspense markers. Hiding a dehydrated Activity walked past its `<!--/&-->` and set `display: none` on every following sibling in the parent, outside the hidden tree. Those siblings stayed hidden after the Activity was shown again. The walk now ends at `<!--/&-->` and counts `<!--&-->` for depth, matching `clearHydrationBoundary`. ## How did you test this change? The first commit adds a test to `ReactDOMServerPartialHydrationActivity-test` that pins down the current behavior: an Activity containing a dehydrated Activity (with a nested Activity inside it) is hidden, and the sibling after it ends up hidden too, and stays hidden after the Activity is shown again. It passes on `main`. The second commit is the fix, and flips the sibling assertions. With only the end-marker half of the fix, the test fails on the content after the nested Activity, so the depth counting is covered too. Ran: - `yarn test` and `yarn test --prod` for `ReactDOMServerPartialHydration*`, `ReactDOMActivity*` and `ReactDOMFizzSuspenseList`: all pass, at both commits for the new test. - `yarn test -r=stable` (dev and prod) for the new test, and `-r=stable` for `ReactDOMServerPartialHydration*`: all pass. - `yarn flow dom-node`, `yarn flow dom-browser`, `yarn linc`, `yarn prettier`: clean.
Configuration menu - View commit details
-
Copy full SHA for 9f2e1f8 - Browse repository at this point
Copy the full SHA 9f2e1f8View commit details
Commits on Oct 13, 2026
-
[Fizz] Postpone a task aborted while rendering from where it started (#…
…37710) ## Summary Fixes #37709 When a prerender is aborted while a retried render task is on the stack, `retryRenderTask` resets the segment to where the attempt started, but `task.keyPath` and `task.childIndex` are left at the innermost child that was rendering. `abortUnwoundTask` then postpones the task at that child's slot under its parent element, and the resume renders only that child into the boundary's segment. This restores the key path and child index the attempt started from before finishing the abort, so the postponed hole covers the whole discarded attempt. `task.node` stays as is, since DEV async debug info reads it for the owner stack. ## How did you test this change? The first commit adds a test to `ReactDOMFizzStaticBrowser-test` that aborts the prerender from a component rendered by a retried task and resumes it, asserting the current output (`<div>World</div>`). The second commit is the fix and updates the assertion to the whole `<section>`. `yarn test packages/react-dom/src/__tests__/ReactDOMFizz packages/react-server` passes with and without `-r=experimental`. With `--prod`, `ReactServer › has Owner Stacks in DEV when aborted` fails the same way on main. Prettier, ESLint and `yarn flow dom-node` are clean.
Configuration menu - View commit details
-
Copy full SHA for 07dde64 - Browse repository at this point
Copy the full SHA 07dde64View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff b618bbb4...07dde64d