-
Notifications
You must be signed in to change notification settings - Fork 47.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: reload to profile for Fusebox #31021
Add: reload to profile for Fusebox #31021
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
if (this._isProfiling === isProfiling) { | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are existing crashes reported on web:
Adding support for Fusebox in the PR encountered similar crashes.
These lines fix it for Fusebox; it could be the fix for web as well.
That's because onProfilingStatus
is called repeatedly on some occasions, e.g. multiple calls to getProfilingStatus
<!-- 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 Profiling fails sometimes because `onProfilingStatus` is called repeatedly on some occasions, e.g. multiple calls to `getProfilingStatus`. Subsequent calls should be a no-op if the profiling status hasn't changed. Reported via #30661 #28838. > [!TIP] > Hide whitespace changes on this PR <img width="328" alt="screenshot showing the UI controls for hiding whitespace changes on GitHub" src="https://github.com/user-attachments/assets/036385cf-2610-4e69-a717-17c05d7ef047"> ## 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. --> Tested as part of Fusebox implementation of reload-to-profile. #31021
daba3d8
to
4d2b22a
Compare
4d2b22a
to
4e24fb6
Compare
6be1977
to
d8da2b9
Compare
d8da2b9
to
78a15f4
Compare
#31048) <!-- 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 In preparation to support reload-to-profile in Fusebox (#31021), we need a way to check capability of different backends, e.g. web vs React Native. ## 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. --> * Default, e.g. existing web impl = no-op * Custom impl: is called
78a15f4
to
0dfe075
Compare
@@ -60,6 +63,7 @@ export function initialize( | |||
maybeSettingsOrSettingsPromise?: | |||
| DevToolsHookSettings | |||
| Promise<DevToolsHookSettings>, | |||
reloadAndProfileConfig: ReloadAndProfileConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this is unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is passed in from setUpReactDevTools.js https://www.internalfb.com/diff/D63233256?permalink=3800761013473689
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but this is unused in this function.
You are passing this in connectToDevTools
and in connectWithCustomMessagingProtocol
, and you are using it there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using it in all three places. initialize
needs the initial (heh) boolean values to pass onto renderer
, and the connect*
functions need the full *ConfigPersistence
to read & write the flags
Edit: LOL I see what you mean now 🤦♂️ Thanks for the permalink.
react/packages/react-devtools-core/src/backend.js
Lines 62 to 69 in ba97e6e
export function initialize( | |
maybeSettingsOrSettingsPromise?: | |
| DevToolsHookSettings | |
| Promise<DevToolsHookSettings>, | |
reloadAndProfileConfig: ReloadAndProfileConfig, | |
) { | |
installHook(window, maybeSettingsOrSettingsPromise); | |
} |
It got messed up during rebase. Fixed now
0dfe075
to
ba97e6e
Compare
ba97e6e
to
feace7e
Compare
**breaking change for canary users: Bumps peer dependency of React from `19.0.0-rc-778e1ed2-20240926` to `19.0.0-rc-3edc000d-20240926`** [diff facebook/react@778e1ed2...3edc000d](facebook/react@778e1ed...3edc000) <details> <summary>React upstream changes</summary> - facebook/react#31078 - facebook/react#31083 - facebook/react#31079 - facebook/react#31080 - facebook/react#31076 - facebook/react#31021 - facebook/react#31069 - facebook/react#31074 - facebook/react#31073 - facebook/react#31047 - facebook/react#31046 - facebook/react#31045 - facebook/react#31072 - facebook/react#30980 - facebook/react#30463 - facebook/react#30694 - facebook/react#31039 - facebook/react#31048 - facebook/react#31068 </details> --------- Co-authored-by: Josh Story <[email protected]>
…#70560) **breaking change for canary users: Bumps peer dependency of React from `19.0.0-rc-778e1ed2-20240926` to `19.0.0-rc-3edc000d-20240926`** [diff facebook/react@778e1ed2...3edc000d](facebook/react@778e1ed...3edc000) <details> <summary>React upstream changes</summary> - facebook/react#31078 - facebook/react#31083 - facebook/react#31079 - facebook/react#31080 - facebook/react#31076 - facebook/react#31021 - facebook/react#31069 - facebook/react#31074 - facebook/react#31073 - facebook/react#31047 - facebook/react#31046 - facebook/react#31045 - facebook/react#31072 - facebook/react#30980 - facebook/react#30463 - facebook/react#30694 - facebook/react#31039 - facebook/react#31048 - facebook/react#31068 </details> --------- Co-authored-by: Josh Story <[email protected]>
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under new architecture. Bridging for legacy Android and iOS will be added in follow-up diffs Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Reviewed By: hoxyq Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Reviewed By: hoxyq Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native) CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Reviewed By: hoxyq Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native) CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Reviewed By: hoxyq Differential Revision: D63233256
…6856) Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native) CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Reviewed By: hoxyq Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native) CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Reviewed By: hoxyq Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native) CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Reviewed By: hoxyq Differential Revision: D63233256
Summary: Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native) CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Reviewed By: hoxyq Differential Revision: D63233256
Summary: Pull Request resolved: #46856 Changelog: [General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native) CDT: facebookexperimental/rn-chrome-devtools-frontend#117 React: facebook/react#31021 This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++ Reviewed By: hoxyq Differential Revision: D63233256 fbshipit-source-id: f2f2814491e785b03af143cc26639ef178881fff
Changes in this release: * Fix React Compiler badging ([poteto](https://github.com/poteto) in [#31196](#31196)) * fix[react-devtools]: fixed timeline profiler tests ([hoxyq](https://github.com/hoxyq) in [#31261](#31261)) * fix[react-devtools]: record timeline data only when supported ([hoxyq](https://github.com/hoxyq) in [#31154](#31154)) * refactor[react-devtools]: flatten reload and profile config ([hoxyq](https://github.com/hoxyq) in [#31132](#31132)) * fix[react-devtools]: remove all listeners when Agent is shutdown ([hoxyq](https://github.com/hoxyq) in [#31151](#31151)) * fix[react-devtools]: removed redundant startProfiling call ([hoxyq](https://github.com/hoxyq) in [#31131](#31131)) * refactor[react-devtools/fiber/renderer]: optimize durations resolution ([hoxyq](https://github.com/hoxyq) in [#31118](#31118)) * fix[react-devtools]: update profiling status before receiving response from backend ([hoxyq](https://github.com/hoxyq) in [#31117](#31117)) * fix[react-devtools]: wrap key string in preformatted text html element ([hoxyq](https://github.com/hoxyq) in [#31153](#31153)) * chore[react-devtools]: drop legacy context tests ([hoxyq](https://github.com/hoxyq) in [#31059](#31059)) * chore[react-devtools]: add legacy mode error message to the ignore list for tests ([hoxyq](https://github.com/hoxyq) in [#31060](#31060)) * fix[react-devtools]: request hook initialization inside http server response ([hoxyq](https://github.com/hoxyq) in [#31102](#31102)) * [Flight] Serialize Server Components Props in DEV ([sebmarkbage](https://github.com/sebmarkbage) in [#31105](#31105)) * Add: reload to profile for Fusebox ([EdmondChuiHW](https://github.com/EdmondChuiHW) in [#31021](#31021)) * refactor: allow custom impl of backend realod-to-profile support check ([EdmondChuiHW](https://github.com/EdmondChuiHW) in [#31048](#31048)) * fix: use public instance in Fiber renderer and expose it from getInspectorDataForViewAtPoint ([hoxyq](https://github.com/hoxyq) in [#31068](#31068))
Summary
Add reload to profile for Fusebox
Stacked on #31048. See 6be1977
How did you test this change?
Test E2E in D63233256