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: 313332d1
Choose a base ref
...
head repository: facebook/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 63779030
Choose a head ref
  • 19 commits
  • 77 files changed
  • 8 contributors

Commits on Mar 26, 2025

  1. [ci] Skip yarn install on cache hit (#32757)

    We currently already do this in runtime_build_and_test, we can reuse the
    same technique in other workflows to speed them up.
    poteto authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5f232d7 View commit details
  2. [compiler][be] Test runner (snap) now uses tsup bundled plugin (#32758)

    Currently, `babel-plugin-react-compiler` is bundled with (almost) all
    external dependencies. This is because babel traversal and ast logic is
    not forward-compatible. Since `babel-plugin-react-compiler` needs to be
    compatible with babel pipelines across a wide semvar range, we (1) set
    this package's babel dependency to an early version and (2) inline babel
    libraries into our bundle.
    
    A few other packages in `react/compiler` depend on the compiler. This PR
    moves `snap`, our test fixture compiler and evaluator, to use the
    bundled version of `babel-plugin-react-compiler`. This decouples the
    babel version used by `snap` with the version used by
    `babel-plugin-react-compiler`, which means that `snap` now can test
    features from newer babel versions (see
    #32742).
    
    ---
    [//]: # (BEGIN SAPLING FOOTER)
    Stack created with [Sapling](https://sapling-scm.com). Best reviewed
    with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32758).
    * #32759
    * __->__ #32758
    mofeiZ authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    33999c4 View commit details
  3. [compiler][be] Playground now uses tsup bundled plugin (#32759)

    Followup to #32758.
    
    This moves playground to use the tsup bundled plugin instead of
    webpack-built `babel-plugin-react-compiler`.
    
    ---
    [//]: # (BEGIN SAPLING FOOTER)
    Stack created with [Sapling](https://sapling-scm.com). Best reviewed
    with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32759).
    * __->__ #32759
    * #32758
    mofeiZ authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2541146 View commit details
  4. Don't flush synchronous work if we're in the middle of a ViewTransiti…

    …on async sequence (#32760)
    
    Starting a View Transition is an async sequence. Since React can get a
    sync update in the middle of sequence we sometimes interrupt that
    sequence.
    
    Currently, we don't actually cancel the View Transition so it can just
    run as a partial. This ensures that we fully skip it when that happens,
    as well as warn.
    
    However, it's very easy to trigger this with just a setState in
    useLayoutEffect right now. Therefore if we're inside the preparing
    sequence of a startViewTransition, this delays work that would've
    normally flushed in a microtask. ~Maybe we want to do the same for
    Default work already scheduled through a scheduler Task.~ Edit: This was
    already done.
    
    `flushSync` currently will still lead to an interrupted View Transition
    (with a warning). There's a tradeoff here whether we want to try our
    best to preserve the guarantees of `flushSync` or favor the animation.
    It's already possible to suspend at the root with `flushSync` which
    means it's not always 100% guaranteed to commit anyway. We could treat
    it as suspended. But let's see how much this is a problem in practice.
    sebmarkbage authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a5297ec View commit details
  5. Rename <ViewTransition className="..."> to <ViewTransition default=".…

    ….."> (#32734)
    
    It was always confusing that this is not a CSS class but a
    view-transition-class.
    
    The `className` sticks out a bit among its siblings `enter`, `exit`,
    `update` and `share`. The idea is that the most specific definition
    override is the class name that gets applied and this prop is really
    just the fallback, catch-all or "any" that is applied if you didn't
    specify a more specific one.
    
    It has also since evolved not just to take a string but also a map of
    Transition Type to strings.
    
    The "class" is really the type of the value. We could add a suffix to
    all of them like `defaultClass`, `enterClass`, `exitClass`,
    `updateClass` and `shareClass`. However, this doesn't necessarily make
    sense with the mapping of Transition Type to string. It also makes it a
    bit too DOM centric. In React Native this might still be called a
    "class" but it might be represented by an object definition. We might
    even allow some kind of inline style form for the DOM too. Really this
    is about picking which "animation" that runs which can be a string or
    instance. "Animation" is too broad because there's also a concept of a
    CSS Animation and these are really sets of CSS animations (group,
    image-pair, old, new). It could maybe be `defaultTransition`,
    `enterTransition`, etc but that seems unnecessarily repetitive and still
    doesn't say anything about it being a class.
    
    We also already have the name "default" in the map of Transition Types.
    In fact you can now specify a default for default:
    
    ```
    <ViewTransition default={{"navigation-back": "slide-out", "default": "fade-in"}}>
    ```
    
    One thing I don't like about the name `"default"` is that it might be
    common to just apply a named class that does it matching to
    enter/exit/update in the CSS selectors (such as the `:only-child` rule)
    instead of doing that mapping to each one using React. In that can you
    end up specifying only `default={...}` a lot and then what is it the
    "default" for? It's more like "all". I think it's likely that you end up
    with either "default" or the specific forms instead of both at once.
    sebmarkbage authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e0c99c4 View commit details
  6. Add "auto" class to mean the built-in should run (#32761)

    Stacked on #32734
    
    In React a ViewTransition class of `"none"` doesn't just mean that it
    has no class but also that it has no ViewTransition name. The default
    (`null | undefined`) means that it has no specific class but should run
    with the default built-in animation. This adds this as an explicit
    string called `"auto"` as well.
    
    That way you can do `<ViewTransition default="foo" enter="auto">` to
    override the "foo" just for the "enter" trigger to be the default
    built-in animation. Where as if you just specified `null` it would be
    like not specifying enter at all which would trigger "foo".
    sebmarkbage authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fceb0f8 View commit details
  7. Add getComputedStyle helper to ViewTransition refs (#32751)

    This is also sometimes useful to read the style of the pseudo-element
    itself without an animation.
    sebmarkbage authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f134b39 View commit details
  8. s/HTML/text for text hydration mismatches (#32763)

    rickhanlonii authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3e88e97 View commit details
  9. Mark shouldStartViewTransition as true when there's an enter animation (

    #32764)
    
    Typically we mark the name of things that might animate in the snapshot
    phase. At the same time we track that should call startViewTransition
    too. However, we don't do this for "enter" since they're only marked
    later. Leading to having just an "enter" not to animate unless there's
    at least another update too.
    
    This tracks if there's a ViewTransitionComponent in the tree that
    enters. Luckily we know that from the static flag so we don't have to
    traverse it.
    sebmarkbage authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    4280563 View commit details

Commits on Mar 27, 2025

  1. [compiler] Fix inferEffectDependencies lint false positives (#32769)

    Currently, inferred effect dependencies are considered a
    "compiler-required" feature. This means that untransformed callsites
    should escalate to a build error.
    
    `ValidateNoUntransformedReferences` iterates 'special effect' callsites
    and checks that the compiler was able to successfully transform them.
    Prior to this PR, this relied on checking the number of arguments passed
    to this special effect.
    
    This obviously doesn't work with `noEmit: true`, which is used for our
    eslint plugin (this avoids mutating the babel program as other linters
    run with the same ast). This PR adds a set of `babel.SourceLocation`s to
    do best effort matching in this mode.
    mofeiZ authored Mar 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8039f1b View commit details

Commits on Mar 28, 2025

  1. feat(babel-plugin-react-compiler): support satisfies operator (#32742)

    Solve #29818
    
    ---------
    
    Co-authored-by: Rodrigo Faria <[email protected]>
    rodrigofariow and rodrigo-faria-cartrack authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ef4bc8b View commit details
  2. [release] Also split the onlyPackages param (#32777)

    I missed this the last time.
    ---
    [//]: # (BEGIN SAPLING FOOTER)
    Stack created with [Sapling](https://sapling-scm.com). Best reviewed
    with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32777).
    * #32778
    * __->__ #32777
    poteto authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1de32a5 View commit details
  3. [release] Don't lookup build-info.json when updating version numbers (#…

    …32778)
    
    From what we can see, `build-info.json` is a vestigal file that we were
    previously including in builds but are no longer since 2022 (see
    #23257, which removes
    `build-info.json` which would have broken
    scripts/release/build-release-locally-commands/add-build-info-json.js).
    
    Since this file is no longer built, instead of looking it up we default
    to the `version` that was passed in as an argument to
    scripts/release/prepare-release-from-npm.js. Since `version` is what is
    pulled from npm, there should only be 1 consistent version for all the
    packages that are pulled. Therefore, only 1 version (eg canary) needs to
    be replaced to the new stable version.
    ---
    [//]: # (BEGIN SAPLING FOOTER)
    Stack created with [Sapling](https://sapling-scm.com). Best reviewed
    with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32778).
    * __->__ #32778
    * #32777
    poteto authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1825990 View commit details
  4. [compiler][snap] Fix test filter + watch mode (#32780)

    Accidentally broke this when migrating our test runner to use the
    bundled build #32758
    
    The fix is pretty simple. File watcher should listen for changes in
    `packages/babel-plugin-react-compiler` instead of `cwd`, which is now
    `packages/snap`.
    mofeiZ authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    deb7859 View commit details
  5. Bump next prerelease version numbers (#32782)

    Updates the version numbers in the prerelease channels.
    poteto authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    50c5cdb View commit details
  6. Add changelog for 19.1.0 (#32781)

    mattcarrollcode authored Mar 28, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d726d69 View commit details
  7. Update 19.1 changelog to add owner stack context

    mattcarrollcode committed Mar 28, 2025
    Copy the full SHA
    18a1133 View commit details
  8. Fix changelog Owner Stack spelling consistency

    mattcarrollcode committed Mar 28, 2025
    Copy the full SHA
    095ce8a View commit details
  9. Update 19.1 changelog to remove confusing owner stack sentance

    mattcarrollcode committed Mar 28, 2025
    Copy the full SHA
    6377903 View commit details
Loading