-
Notifications
You must be signed in to change notification settings - Fork 50.2k
Comparing changes
Open a pull request
base repository: facebook/react
base: 06d0b89e
head repository: facebook/react
compare: 187dd6a7
- 18 commits
- 78 files changed
- 7 contributors
Commits on Aug 1, 2024
-
Cloned flag to avoid extra clones in persistent renderer (#27647)
Persistent renderers used the `Update` effect flag to check if a subtree needs to be cloned. In some cases, that causes extra renders, such as when a layout effect is triggered which only has an effect on the JS side, but doesn't update the host components. It's been a bit tricky to find the right places where this needs to be set and I'm not 100% sure I got all the cases even though the tests passed.
Configuration menu - View commit details
-
Copy full SHA for 5fb67fa - Browse repository at this point
Copy the full SHA 5fb67faView commit details
Commits on Aug 2, 2024
-
chore[react-devtools]: add global for native and use it to fork backe…
…nd implementation (#30533) Adding `__IS_NATIVE__` global, which will be used for forking backend implementation. Will only be set to `true` for `react-devtools-core` package, which is used by `react-native`. Ideally, we should name it `react-devtools-native`, and keep `react-devtools-core` as host-agnostic. With this change, the next release of `react-devtools-core` should append component stack as Error object, not as string, and should add `(<anonymous>)` suffix to component stack frames.
Configuration menu - View commit details
-
Copy full SHA for 8269d55 - Browse repository at this point
Copy the full SHA 8269d55View commit details -
[compiler] Validate against setState in useMemo (resubmit of #30552)
ghstack failed to land #30552 properly, resubmitting Developers sometimes use `useMemo()` as a way to conditionally execute code, including conditionally calling setState. However, the compiler may remove existing useMemo calls if they are not necessary, which _should_ always be a safe optimization. If the useMemo has side effects (eg sets state), then this isn't safe. This PR improves ValidateNoSetStateInRender to disallow any setState in useMemo (even if it's conditional), expanding on the previous check for unconditional setState in render. Note that the approach uses the StartMemoize/FinishMemoize instructions added in DropManualMemo to know whether a particular setState call is within a useMemo or not. This means enabling the validation in DropManualMemo when the setState validation is enabled, but that's fine since that validation is on everywhere by default (_except_ for in fixtures, which we have a todo for) ghstack-source-id: 65bb328 Pull Request resolved: #30583
Configuration menu - View commit details
-
Copy full SHA for 1db4d6c - Browse repository at this point
Copy the full SHA 1db4d6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a5a5816 - Browse repository at this point
Copy the full SHA a5a5816View commit details -
Configuration menu - View commit details
-
Copy full SHA for ce60785 - Browse repository at this point
Copy the full SHA ce60785View commit details -
Configuration menu - View commit details
-
Copy full SHA for f5f9899 - Browse repository at this point
Copy the full SHA f5f9899View commit details -
Configuration menu - View commit details
-
Copy full SHA for bae18b4 - Browse repository at this point
Copy the full SHA bae18b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 47337a8 - Browse repository at this point
Copy the full SHA 47337a8View commit details -
[DevTools] Allow Highlighting/Inspect HostSingletons/Hoistables and R…
…esources (#30584) Basically the new Float types needs to be supported. Resources are a bit special because they're a DOM specific type but we can expect any other implementation using resources to provide and instance on this field if needed. There's a slightly related case for the reverse lookup. You can already select a singleton or hoistable (that's not a resource) in the browser elements panel and it'll select the corresponding node in the RDT Components panel. That works because it uses the same mechanism as event dispatching and those need to be able to receive events. However, you can't select a resource. Because that's conceptually one to many. We could in principle just search the tree for the first one or keep a map of currently mounted resources and just pick the first fiber that created it. So that you can select a resource and see what created it. Particularly useful when there's only one Fiber which is most of the time. --------- Co-authored-by: Ruslan Lesiutin <rdlesyutin@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for ed94ea1 - Browse repository at this point
Copy the full SHA ed94ea1View commit details -
[DevTools] Rename mountFiberRecursively/updateFiberRecursively (#30586)
This is just for clarity at first. Before: - mountFiberRecursively accepts a set of children and flag that says whether to just do one - updateFiberRecursively accepts a fiber and loops over its children - unmountFiberChildrenRecursively accepts a fiber and loops over its children After: - mountFiberRecursively accepts a Fiber and calls mountChildrenRecursively - updateFiberRecursively accepts a Fiber and calls updateChildrenRecursively - unmountFiberRecursively accepts a Fiber and calls unmountChildrenRecursively - mountChildrenRecursively accepts a set of children and loops over each one - updateChildrenRecursively accepts a set of children and loops over each one - unmountChildrenRecursively accepts a set of children and loops over each one So now there's one place where things happens for the single item and one place where we do the loop.
Configuration menu - View commit details
-
Copy full SHA for aa8469f - Browse repository at this point
Copy the full SHA aa8469fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3af905d - Browse repository at this point
Copy the full SHA 3af905dView commit details -
[DevTools] Track DOM nodes to Fiber map for HostHoistable Resources (#…
…30590) Follow up from #30584. You can already select a singleton or hoistable (that's not a resource) in the browser elements panel and it'll select the corresponding node in the RDT Components panel. That works because it uses the same mechanism as event dispatching and those need to be able to receive events. However, you can't select a resource. Because that's conceptually one to many. This keeps track of which fiber is acquiring which resource so we can find all the corresponding instances. E.g. now you can select the `<link rel="stylesheet">` in the Flight fixture in the Element panel and then the component that rendered it in the Components panel will be selected. If we had a concept multi-selection we could potentially select all of them. This similar to how a Server Component can be rendered in more than one place and if we want to select all matching ones. It's kind of weird though and both cases are edge cases. Notably imperative preloads do have elements that don't have any corresponding component but that's ok. So they'll just select `<head>`. Maybe in dev we could track the owners of those.
Configuration menu - View commit details
-
Copy full SHA for 8a70d31 - Browse repository at this point
Copy the full SHA 8a70d31View commit details
Commits on Aug 3, 2024
-
[Flight] Warn for keyless fragments in an array (#30588)
Conceptually this is the same as rendering this as if it was a built-in Server Component.
Configuration menu - View commit details
-
Copy full SHA for ba6a9e9 - Browse repository at this point
Copy the full SHA ba6a9e9View commit details
Commits on Aug 5, 2024
-
chore[packages/react-devtools]: remove unused index.js (#30579)
This is unused. See #30533 (comment). Ran a fresh build of `react-devtools` via `yarn start` in `packages/react-devtools` to validate that it is still works with React Native.
Configuration menu - View commit details
-
Copy full SHA for 6750423 - Browse repository at this point
Copy the full SHA 6750423View commit details -
Fix typos in Turbopack configuration and in Node.js loader error mess…
…ages (#30593) <!-- 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 Just fixing some copy-paste typos. ## How did you test this change? Untested.
Configuration menu - View commit details
-
Copy full SHA for c0ee8e9 - Browse repository at this point
Copy the full SHA c0ee8e9View commit details -
Remove flag enableUseDeferredValueInitialArg (#30595)
This is enabled everywhere for a while and I don't think we'd be backing this out of 19. Seems like it's good to clean up to me.
Configuration menu - View commit details
-
Copy full SHA for 6590358 - Browse repository at this point
Copy the full SHA 6590358View commit details
Commits on Aug 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for eb1d52b - Browse repository at this point
Copy the full SHA eb1d52bView commit details -
Replace NodeJS 21 with 22 in devEngines field (#30598)
21 is EOL and 22 is stable now. Homebrew installs 22 by default as well which is the practical reason for me to update this.
Configuration menu - View commit details
-
Copy full SHA for 187dd6a - Browse repository at this point
Copy the full SHA 187dd6aView 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 06d0b89e...187dd6a7