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: 029e8bd6
Choose a base ref
...
head repository: facebook/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0ca3deeb
Choose a head ref
  • 11 commits
  • 34 files changed
  • 7 contributors

Commits on Mar 6, 2025

  1. Configuration menu
    Copy the full SHA
    9e9b54d View commit details
    Browse the repository at this point in the history
  2. docs(eslint-plugin-react-hooks): add changelog for 5.1.0 & 5.2.0 (#32536

    )
    
    <!--
      Thanks for submitting a pull request!
    We appreciate you spending the time to work on these changes. Please
    provide enough information so that others can review your pull request.
    The three fields below are mandatory.
    
    Before submitting a pull request, please make sure the following is
    done:
    
    1. Fork [the repository](https://github.com/facebook/react) and create
    your branch from `main`.
      2. Run `yarn` in the repository root.
    3. If you've fixed a bug or added code that should be tested, add tests!
    4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
    TestName` is helpful in development.
    5. Run `yarn test --prod` to test in the production environment. It
    supports the same options as `yarn test`.
    6. If you need a debugger, run `yarn test --debug --watch TestName`,
    open `chrome://inspect`, and press "Inspect".
    7. Format your code with
    [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
    8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
    check changed files.
      9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
      10. If you haven't already, complete the CLA.
    
    Learn more about contributing:
    https://reactjs.org/docs/how-to-contribute.html
    -->
    
    ## Summary
    
    <!--
    Explain the **motivation** for making this change. What existing problem
    does the pull request solve?
    -->
    
    Adds changelog entries for the last two minor releases of
    `eslint-plugin-react-hooks`. Fixes #31717.
    
    I chose to not include #31208 (8382581)
    and #32115 (fd2d279) in the changelog
    as they only changed internals that do not affect consumers of the
    plugin, and it doesn't seem like the changelog previously included such
    changes.
    
    Changes are sorted by importance (rather than by commit date), with the
    most important changes first.
    
    ## How did you test this change?
    
    <!--
    Demonstrate the code is solid. Example: The exact commands you ran and
    their output, screenshots / videos if the pull request changes the user
    interface.
    How exactly did you verify that your PR solves the issue you wanted to
    solve?
      If you leave this empty, your PR will very likely be closed.
    -->
    
    Docs only, nothing to test.
    Mathias-S authored Mar 6, 2025
    Configuration menu
    Copy the full SHA
    562f17e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f9d7808 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2025

  1. Fix asserts caused by OffscreenComponent rendering in React Native wi…

    …th passChildrenWhenCloningPersistedNodes (#32528)
    
    <!--
      Thanks for submitting a pull request!
    We appreciate you spending the time to work on these changes. Please
    provide enough information so that others can review your pull request.
    The three fields below are mandatory.
    
    Before submitting a pull request, please make sure the following is
    done:
    
    1. Fork [the repository](https://github.com/facebook/react) and create
    your branch from `main`.
      2. Run `yarn` in the repository root.
    3. If you've fixed a bug or added code that should be tested, add tests!
    4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
    TestName` is helpful in development.
    5. Run `yarn test --prod` to test in the production environment. It
    supports the same options as `yarn test`.
    6. If you need a debugger, run `yarn test --debug --watch TestName`,
    open `chrome://inspect`, and press "Inspect".
    7. Format your code with
    [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
    8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
    check changed files.
      9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
      10. If you haven't already, complete the CLA.
    
    Learn more about contributing:
    https://reactjs.org/docs/how-to-contribute.html
    -->
    
    ## Summary
    
    <!--
    Explain the **motivation** for making this change. What existing problem
    does the pull request solve?
    -->
    
    This PR fixes asserts when `passChildrenWhenCloningPersistedNodes` is
    enabled for React Native and OffscreenComponent child rendering unhides
    host components.
    
    Discussions around possible fixes for the asserts seen in React Native
    suggested changing the way we handle hiding/unhiding host components by
    updating the fiber state with the hidden host component instead of
    submitting a hidden clone Fabric and keeping the original as the current
    fiber.
    
    Implementing this fix would require holding onto the original styling of
    the hidden host component. The reconciler updates the styling by adding
    `display: none` to hide the contents. If the original host component was
    already hidden, the renderer would lose that information and remove the
    styling when showing the contents again.
    
    To reduce the changes required to make
    `passChildrenWhenCloningPersistedNodes` work, this PR falls back to the
    original cloning method when OffscreenComponents are part of the
    children needed to be added back. This effectively resolve the asserts
    triggered by the feature in RN and improves overall performance.
    
    ## How did you test this change?
    
    <!--
    Demonstrate the code is solid. Example: The exact commands you ran and
    their output, screenshots / videos if the pull request changes the user
    interface.
    How exactly did you verify that your PR solves the issue you wanted to
    solve?
      If you leave this empty, your PR will very likely be closed.
    -->
    
    This fix was tested by enabling `passChildrenWhenCloningPersistedNodes`
    in an app built with React Native that had a repro for triggering the
    asserts. The asserts do not occur anymore when using the changes in this
    PR.
    
    ---------
    
    Co-authored-by: Nick <lefever@meta.com>
    lenaic and Nick authored Mar 7, 2025
    Configuration menu
    Copy the full SHA
    cc68006 View commit details
    Browse the repository at this point in the history
  2. [compiler] Migrate compiler packages to tsup (#32550)

    Currently in the `compiler` workspace, we invoke esbuild directly to
    build most packages (with the exception of `snap`). This has been mostly
    fine, but does not allow us to do things like generate type declaration
    files.
    
    I would like #32416 to be able to consume the merged
    eslint-plugin-react-compiler from source rather than via npm, and one of
    the things that has come up from my exploration in that stack using the
    compiler from source is that babel-plugin-react-compiler is missing type
    declarations. This is primarily because React's build process uses
    rollup + rollup-plugin-typescript, which runs tsc. So the merged plugin
    needs to typecheck properly in order to build. An alternative might be
    to migrate to something like babel with rollup instead to simply strip
    types rather than typecheck before building. The minor downside of that
    approach is that we would need to manually maintain a d.ts file for
    eslint-plugin-react-hooks. For now I would like to see if this PR helps
    us make progress rather than go for the slightly worse alternative.
    
    [`tsup`](https://github.com/egoist/tsup) is esbuild based so build
    performance is comparable. It is slower when generating d.ts files, but
    it's still much faster than rollup which we used prior to esbuild. For
    now, I have turned off `dts` by default, and it is only passed when
    publishing on npm.
    
    If you want to also generate d.ts files you can run `yarn build --dts`.
    
    ```
    # BEFORE: build all compiler packages (esbuild)
    $ time yarn build
    
    ✨  Done in 15.61s.
    yarn build  13.82s user 1.54s system 96% cpu 15.842 total
    
    # ---
    
    # AFTER: build all compiler packages (tsup)
    $ time yarn build
    
    ✨  Done in 12.39s.
    yarn build  12.58s user 1.68s system 106% cpu 13.350 total
    
    # ---
    
    # AFTER: build all compiler packages and type declarations (tsup)
    $ time yarn build --dts
    
    ✨  Done in 30.69s.
    yarn build  43.57s user 3.20s system 150% cpu 31.061 total
    ```
    
    I still need to test if this unblocks #32416 but this stack can be
    landed independently though as we could probably just release type
    declarations on npm. No one should be using the compiler directly, but
    if they really wanted to, lack of type declarations would not stop them
    (cf React secret internals).
    
    Note that I still kept esbuild as we still use it directly for forgive.
    ---
    [//]: # (BEGIN SAPLING FOOTER)
    Stack created with [Sapling](https://sapling-scm.com). Best reviewed
    with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32550).
    * #32551
    * __->__ #32550
    poteto authored Mar 7, 2025
    Configuration menu
    Copy the full SHA
    00aa004 View commit details
    Browse the repository at this point in the history
  3. [ci] Fix incorrect condition (#32551)

    Fixes an incorrect condition for running tests in the compiler
    workspace.
    ---
    [//]: # (BEGIN SAPLING FOOTER)
    Stack created with [Sapling](https://sapling-scm.com). Best reviewed
    with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32551).
    * __->__ #32551
    * #32550
    poteto authored Mar 7, 2025
    Configuration menu
    Copy the full SHA
    d331ba0 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2025

  1. Make renameElementSymbol dynamic for native fb (#32566)

    Use variant to begin rolling this out internally.
    jackpope authored Mar 10, 2025
    Configuration menu
    Copy the full SHA
    50ab2dd View commit details
    Browse the repository at this point in the history
  2. Cancel finished view transitions Animations manually in fire-and-forg…

    …et too (#32545)
    
    Otherwise these can survive into the next View Transition and cause
    havoc to that transition.
    
    This was appearing as a flash in Safari in the fixture when going from
    A->B. This triggers a View Transition and at the same time the scroll
    position updates in an effect. That fires a scroll event which starts a
    gesture. This shouldn't really happen and the SwipeRecognizer should
    ideally ignore those but it's good to surface edge cases. That gesture
    is blocked on the View Transition finishing and then immediately after
    it starts a gesture View Transition. That gesture then picked up the
    former Animation from the previous transition which caused issues. This
    PR fixes that flash.
    sebmarkbage authored Mar 10, 2025
    Configuration menu
    Copy the full SHA
    a8c2bbd View commit details
    Browse the repository at this point in the history
  3. Enable moveBefore in experimental releases (#32549)

    Enabling feature detection of early DOM features in a framework is
    reckless. I'm not judging other frameworks (but also a little bit).
    Because if you do something like `if (moveBefore) moveBefore(a, b) else
    insertBefore(a, b)` like we do and then the implementation has to change
    there are still too many websites out there that it becomes impossible
    to change it. It would break the web. It would instead have to change to
    a different name. That's what happened with `contains` -> `includes`.
    Counter to popular belief it didn't have anything to do with patching
    prototypes. Therefore, ideally frameworks shouldn't start rely on it
    until there's two implementations so that there's time for feedback.
    
    That's why we didn't immediately enable this even in experimental.
    However, at this point there's probably enough feature detection and it
    has shipped long enough in Chrome that it's unlikely to be able to
    change at this point.
    
    We can enable it now. For now just in `@experimental` to see if we can
    flush out issues with it before bringing it to stable.
    sebmarkbage authored Mar 10, 2025
    Configuration menu
    Copy the full SHA
    696950a View commit details
    Browse the repository at this point in the history
  4. Check if a child is a new child before calling moveBefore (#32567)

    This fixes a critical issue with moveBefore. I was told that the
    disconnected -> connected case was going to be relaxed and not be an
    error but apparently that is not the case.
    
    This means that we can't use this for initial insertions. Only moves.
    
    Unfortunately React's internals doesn't distinguish these cases. This
    adds a hack that checks each nodes but this is pretty bad for
    performance. We should only call this in one or the other case.
    
    Given that we still need feature detection. Both of which means that
    these calls are no longer inlined and this extra code. I wonder if it's
    even worth it given that you can't even rely on it working anyway since
    not all browsers have it. Kind of don't want to ship this until all
    browsers have it.
    
    Even then we'd ideally refactor React to use separate code paths for
    initial insertion vs moves. Which leads to some unfortunate code
    duplication.
    sebmarkbage authored Mar 10, 2025
    Configuration menu
    Copy the full SHA
    99e1024 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2025

  1. [rcr] Fix incorrect output platform (#32569)

    Accidentally copypasted the wrong esbuild config.
    poteto authored Mar 11, 2025
    Configuration menu
    Copy the full SHA
    0ca3dee View commit details
    Browse the repository at this point in the history
Loading