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: facebook/react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d85f86cf
Choose a base ref
...
head repository: facebook/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4a45ba92
Choose a head ref
  • 7 commits
  • 16 files changed
  • 3 contributors

Commits on May 14, 2025

  1. Don't consider Portals animating unless they're wrapped in a ViewTran…

    …sition (#33191)
    
    And that doesn't disable with `update="none"`.
    
    The principle here is that we want the content of a Portal to animate if
    other things are animating with it but if other things aren't animating
    then we don't.
    sebmarkbage authored May 14, 2025
    Configuration menu
    Copy the full SHA
    63d664b View commit details
    Browse the repository at this point in the history
  2. Claim the useId name space for every auto named ViewTransition (#33200)

    This is a partial revert of #33094. It's true that we don't need the
    server and client ViewTransition names to line up. However the server
    does need to be able to generate deterministic names for itself. The
    cheapest way to do that is using the useId algorithm. When it's used by
    the server, the client needs to also materialize an ID even if it
    doesn't use it.
    sebmarkbage authored May 14, 2025
    Configuration menu
    Copy the full SHA
    96eb84e View commit details
    Browse the repository at this point in the history

Commits on May 15, 2025

  1. [Fizz] Track whether we're in a fallback on FormatContext (#33194)

    Removes the `isFallback` flag on Tasks and tracks it on the
    formatContext instead.
    
    Less memory and avoids passing and tracking extra arguments to all the
    pushStartInstance branches that doesn't need it.
    
    We'll need to be able to track more Suspense related contexts on this
    for View Transitions anyway.
    sebmarkbage authored May 15, 2025
    Configuration menu
    Copy the full SHA
    3f67d08 View commit details
    Browse the repository at this point in the history
  2. [Fizz] Add vt- prefix attributes to annotate <ViewTransition> in HTML (

    …#33206)
    
    Stacked on #33194 and #33200.
    
    When Suspense boundaries reveal during streaming, the Fizz runtime will
    be responsible for animating the reveal if necessary (not in this PR).
    However, for the future runtime to know what to do it needs to know
    about the `<ViewTransition>` configuration to apply.
    
    Ofc, these are virtual nodes that disappear from the HTML. We could
    model them as comments like we do with other virtual nodes like Suspense
    and Activity. However, that doesn't let us target them with
    querySelector and CSS (for no-JS transitions). We also don't have to
    model every ViewTransition since not every combination can happen using
    only the server runtime. So instead this collapses `<ViewTransition>`
    and applies the configuration to the inner DOM nodes.
    
    ```js
    <ViewTransition name="hi">
      <div />
      <div />
    </ViewTransition>
    ```
    
    Becomes:
    
    ```html
    <div vt-name="hi" vt-update="auto"></div>
    <div vt-name="hi_1" vt-update="auto"></div>
    ```
    
    I use `vt-` prefix as opposed to `data-` to keep these virtual
    attributes away from user specific ones but we're effectively claiming
    this namespace.
    
    There are four triggers `vt-update`, `vt-enter`, `vt-exit` and
    `vt-share`. The server resolves which ones might apply to this DOM node.
    The value represents the class name (after resolving
    view-transition-type mappings) or `"auto"` if no specific class name is
    needed but this is still a trigger.
    
    The value can also be `"none"`. This is different from missing because
    for example an `vt-update="none"` will block mutations inside it from
    triggering the boundary where as a missing `vt-update` would bubble up
    to be handled by a parent.
    
    `vt-name` is technically only necessary when `vt-share` is specified to
    find a pair. However, since an explicit name can also be used to target
    specific CSS selectors, we include it even for other cases.
    
    We want to exclude as many of these annotations as possible.
    
    `vt-enter` can only affect the first DOM node inside a Suspense
    boundary's content since the reveal would cause it to enter but nothing
    deeper inside. Similarly `vt-exit` can only affect the first DOM node
    inside a fallback. So for every other case we can exclude them. (For
    future MPA ViewTransitions of the whole document it might also be
    something we annotate to children inside the `<body>` as well.) Ideally
    we'd only include `vt-enter` for Suspense boundaries that actually
    flushed a fallback but since we prepare all that content earlier it's
    hard to know.
    
    `vt-share` can be anywhere inside an fallback or content. Technically we
    don't have to include it outside the root most Suspense boundary or for
    boundaries that are inlined into the root shell. However, this is tricky
    to detect. It would also not be correct for future MPA ViewTransitions
    because in that case the shared scenario can affect anything in the two
    documents so it needs to be in every node everywhere which is
    effectively what we do. If a `share` class is specified but it has no
    explicit name, we can exclude it since it can't match anything.
    
    `vt-update` is only necessary if something below or a sibling might
    update like a Suspense boundary. However, since we don't know when
    rendering a segment if it'll later asynchronously add a Suspense
    boundary later we have to assume that anywhere might have a child. So
    these are always included. We collapse to use the inner most one when
    directly nested though since that's the one that ends up winning.
    
    There are some weird edge cases that can't be fully modeled by the lack
    of virtual nodes.
    sebmarkbage authored May 15, 2025
    Configuration menu
    Copy the full SHA
    65b5aae View commit details
    Browse the repository at this point in the history
  3. [compiler] Update changelog for 19.1.0-rc.2 (#33207)

    Update the changelog.
    poteto authored May 15, 2025
    Configuration menu
    Copy the full SHA
    203df2c View commit details
    Browse the repository at this point in the history
  4. [ci] Log author_association (#33213)

    For debugging purposes, log author_association
    poteto authored May 15, 2025
    Configuration menu
    Copy the full SHA
    08cb2d7 View commit details
    Browse the repository at this point in the history
  5. [sync] Fix noop for xplat (#33214)

    Noop detection for xplat syncs broke because `eslint-plugin-react-hooks`
    uses versions like:
    
    - `0.0.0-experimental-d85f86cf-20250514`
    
    But xplat expects them to be of the form:
    
    - `19.2.0-native-fb-63d664b2-20250514`
    
    This PR fixes the noop by ignoring
    `eslint-plugin-react-hooks/package.json` changes. This means we won't
    create a sync if only that package.json changes, but that should be rare
    and we can follow up with better detection if needed.
    
    [Example failed
    action](https://github.com/facebook/react/actions/runs/15032346805/job/42247414406):
    
    <img width="1031" alt="Screenshot 2025-05-15 at 11 31 17 AM"
    src="https://github.com/user-attachments/assets/d902079c-1afe-4e18-af1d-25e60e28929e"
    />
    
    I believe the regression was caused by
    #33104
    rickhanlonii authored May 15, 2025
    Configuration menu
    Copy the full SHA
    4a45ba9 View commit details
    Browse the repository at this point in the history
Loading