Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: react/react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b618bbb
Choose a base ref
...
head repository: react/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 07dde64
Choose a head ref
  • 5 commits
  • 175 files changed
  • 6 contributors

Commits on Oct 12, 2026

  1. [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]>
    zhoubiao188 and zhoubiao188 authored Oct 12, 2026
    Configuration menu
    Copy the full SHA
    259980d View commit details
    Browse the repository at this point in the history
  2. [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.
    Hmache authored Oct 12, 2026
    Configuration menu
    Copy the full SHA
    2f5370a View commit details
    Browse the repository at this point in the history
  3. Migrate all remaining facebook/react mentions (#37778)

    Best reviewed by commit.
    
    Mostly motivated to fix local GH artifact attestations. For everything
    else it just avoids a network hop.
    eps1lon authored Oct 12, 2026
    Configuration menu
    Copy the full SHA
    e8738f0 View commit details
    Browse the repository at this point in the history
  4. [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.
    skrabe authored Oct 12, 2026
    Configuration menu
    Copy the full SHA
    9f2e1f8 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2026

  1. [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.
    AdzerKI authored Oct 13, 2026
    Configuration menu
    Copy the full SHA
    07dde64 View commit details
    Browse the repository at this point in the history
Loading