-
Notifications
You must be signed in to change notification settings - Fork 50.7k
Comparing changes
Open a pull request
base repository: facebook/react
base: 029e8bd6
head repository: facebook/react
compare: 0ca3deeb
- 11 commits
- 34 files changed
- 7 contributors
Commits on Mar 6, 2025
-
Configuration menu - View commit details
-
Copy full SHA for 9e9b54d - Browse repository at this point
Copy the full SHA 9e9b54dView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 562f17e - Browse repository at this point
Copy the full SHA 562f17eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f9d7808 - Browse repository at this point
Copy the full SHA f9d7808View commit details
Commits on Mar 7, 2025
-
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>
Configuration menu - View commit details
-
Copy full SHA for cc68006 - Browse repository at this point
Copy the full SHA cc68006View commit details -
[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
Configuration menu - View commit details
-
Copy full SHA for 00aa004 - Browse repository at this point
Copy the full SHA 00aa004View commit details -
[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
Configuration menu - View commit details
-
Copy full SHA for d331ba0 - Browse repository at this point
Copy the full SHA d331ba0View commit details
Commits on Mar 10, 2025
-
Make renameElementSymbol dynamic for native fb (#32566)
Use variant to begin rolling this out internally.
Configuration menu - View commit details
-
Copy full SHA for 50ab2dd - Browse repository at this point
Copy the full SHA 50ab2ddView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for a8c2bbd - Browse repository at this point
Copy the full SHA a8c2bbdView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 696950a - Browse repository at this point
Copy the full SHA 696950aView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 99e1024 - Browse repository at this point
Copy the full SHA 99e1024View commit details
Commits on Mar 11, 2025
-
[rcr] Fix incorrect output platform (#32569)
Accidentally copypasted the wrong esbuild config.
Configuration menu - View commit details
-
Copy full SHA for 0ca3dee - Browse repository at this point
Copy the full SHA 0ca3deeView 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 029e8bd6...0ca3deeb