-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
DevTools: fix backend activation #26779
Conversation
// skip if already attached | ||
if (renderer.attached) { | ||
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.
Frontend side of devtools needs renderer-attached
event to be emitted. With this check this will never happen and agent
will not receive operations from hook.
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.
cc @mondaychen
Are there any cases I am missing where we really need this check?
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.
Ah yes, I think this was something I missed. Let's remove it now.
List of changes: * DevTools: fix backend activation ([hoxyq](https://github.com/hoxyq) in [#26779](#26779)) * fix[dynamic-scripts-injection]: unregister content scripts before registration ([hoxyq](https://github.com/hoxyq) in [#26765](#26765))
Summary: List of changes: * DevTools: fix backend activation ([hoxyq](https://github.com/hoxyq) in [#26779](facebook/react#26779)) * fix[dynamic-scripts-injection]: unregister content scripts before registration ([hoxyq](https://github.com/hoxyq) in [#26765](facebook/react#26765)) DiffTrain build for commit facebook/react@783e7fc. Changelog: [Internal] << DO NOT EDIT BELOW THIS LINE >> Reviewed By: sammy-SC Differential Revision: D45575104 Pulled By: tyao1 fbshipit-source-id: c065eb8f1f200170f611b5becc0332109f22ef71
Fixes a bug where `useFormStatus` crashed during SSR. Includes the following upstream changes: - [16d053d59](https://github.com/facebook/react/commits/16d053d59) Add useFormStatus to server rendering stub ([vercel#26788](facebook/react#26788)) (Andrew Clark) - [efb381bbf](https://github.com/facebook/react/commits/efb381bbf) [Release Script] Print a hint where to get the token ([vercel#26783](facebook/react#26783)) (dan) - [b00e27342](https://github.com/facebook/react/commits/b00e27342) Use native scheduler if defined in global scope ([vercel#26554](facebook/react#26554)) (Samuel Susla) - [783e7fcfa](https://github.com/facebook/react/commits/783e7fcfa) React DevTools 4.27.6 -> 4.27.7 ([vercel#26780](facebook/react#26780)) (Ruslan Lesiutin) - [377c5175f](https://github.com/facebook/react/commits/377c5175f) DevTools: fix backend activation ([vercel#26779](facebook/react#26779)) (Ruslan Lesiutin)
Summary: List of changes: * DevTools: fix backend activation ([hoxyq](https://github.com/hoxyq) in [facebook#26779](facebook/react#26779)) * fix[dynamic-scripts-injection]: unregister content scripts before registration ([hoxyq](https://github.com/hoxyq) in [facebook#26765](facebook/react#26765)) DiffTrain build for commit facebook/react@783e7fc. Changelog: [Internal] << DO NOT EDIT BELOW THIS LINE >> Reviewed By: sammy-SC Differential Revision: D45575104 Pulled By: tyao1 fbshipit-source-id: c065eb8f1f200170f611b5becc0332109f22ef71
Fixes a bug where `useFormStatus` crashed during SSR. Includes the following upstream changes: - [16d053d59](https://github.com/facebook/react/commits/16d053d59) Add useFormStatus to server rendering stub ([vercel#26788](facebook/react#26788)) (Andrew Clark) - [efb381bbf](https://github.com/facebook/react/commits/efb381bbf) [Release Script] Print a hint where to get the token ([vercel#26783](facebook/react#26783)) (dan) - [b00e27342](https://github.com/facebook/react/commits/b00e27342) Use native scheduler if defined in global scope ([vercel#26554](facebook/react#26554)) (Samuel Susla) - [783e7fcfa](https://github.com/facebook/react/commits/783e7fcfa) React DevTools 4.27.6 -> 4.27.7 ([vercel#26780](facebook/react#26780)) (Ruslan Lesiutin) - [377c5175f](https://github.com/facebook/react/commits/377c5175f) DevTools: fix backend activation ([vercel#26779](facebook/react#26779)) (Ruslan Lesiutin)
Fixes a bug where `useFormStatus` crashed during SSR. Includes the following upstream changes: - [16d053d59](https://github.com/facebook/react/commits/16d053d59) Add useFormStatus to server rendering stub ([vercel#26788](facebook/react#26788)) (Andrew Clark) - [efb381bbf](https://github.com/facebook/react/commits/efb381bbf) [Release Script] Print a hint where to get the token ([vercel#26783](facebook/react#26783)) (dan) - [b00e27342](https://github.com/facebook/react/commits/b00e27342) Use native scheduler if defined in global scope ([vercel#26554](facebook/react#26554)) (Samuel Susla) - [783e7fcfa](https://github.com/facebook/react/commits/783e7fcfa) React DevTools 4.27.6 -> 4.27.7 ([vercel#26780](facebook/react#26780)) (Ruslan Lesiutin) - [377c5175f](https://github.com/facebook/react/commits/377c5175f) DevTools: fix backend activation ([vercel#26779](facebook/react#26779)) (Ruslan Lesiutin)
Fixes a bug where `useFormStatus` crashed during SSR. Includes the following upstream changes: - [16d053d59](https://github.com/facebook/react/commits/16d053d59) Add useFormStatus to server rendering stub ([#26788](facebook/react#26788)) (Andrew Clark) - [efb381bbf](https://github.com/facebook/react/commits/efb381bbf) [Release Script] Print a hint where to get the token ([#26783](facebook/react#26783)) (dan) - [b00e27342](https://github.com/facebook/react/commits/b00e27342) Use native scheduler if defined in global scope ([#26554](facebook/react#26554)) (Samuel Susla) - [783e7fcfa](https://github.com/facebook/react/commits/783e7fcfa) React DevTools 4.27.6 -> 4.27.7 ([#26780](facebook/react#26780)) (Ruslan Lesiutin) - [377c5175f](https://github.com/facebook/react/commits/377c5175f) DevTools: fix backend activation ([#26779](facebook/react#26779)) (Ruslan Lesiutin)
…erers (#26807) ## Summary Initially reported in #26797. Was not able to reproduce the exact same problem, but found this case: 1. Open corresponding codepen from the issue in debug mode 2. Open components tab of the extension 3. Refresh the page Received multiple errors: - Warning in the Console tab: Invalid renderer id "2". - Error in the Components tab: Uncaught Error: Cannot add node "3" because a node with that id is already in the Store. This problem has occurred after landing a fix in #26779. Looks like Chrome is keeping the injected scripts (the backend in this case) and we start backend twice.
…erers (#26807) Summary: ## Summary Initially reported in facebook/react#26797. Was not able to reproduce the exact same problem, but found this case: 1. Open corresponding codepen from the issue in debug mode 2. Open components tab of the extension 3. Refresh the page Received multiple errors: - Warning in the Console tab: Invalid renderer id "2". - Error in the Components tab: Uncaught Error: Cannot add node "3" because a node with that id is already in the Store. This problem has occurred after landing a fix in facebook/react#26779. Looks like Chrome is keeping the injected scripts (the backend in this case) and we start backend twice. DiffTrain build for commit facebook/react@67a05d0. Reviewed By: javache Differential Revision: D45815160 Pulled By: hoxyq fbshipit-source-id: 99f3c45009b07a0fb89f0674ccfb24f170cdb29d
## Summary We have a case: 1. Open components tab 2. Close Chrome / Firefox devtools window completely 3. Reopen browser devtools panel 4. Open components tab Currently, in version 4.27.6, we cannot load the components tree. This PR contains two changes: - non-functional refactoring in `react-devtools-shared/src/devtools/store.js`: removed some redundant type castings. - fixed backend manager logic (introduced in facebook#26615) to activate already registered backends. Looks like frontend of devtools also depends on `renderer-attached` event, without it component tree won't load. ## How did you test this change? This fixes the case mentioned prior. Currently in 4.27.6 version it is not working, we need to refresh the page to make it work. I've tested this in several environments: chrome, firefox, standalone with RN application.
List of changes: * DevTools: fix backend activation ([hoxyq](https://github.com/hoxyq) in [facebook#26779](facebook#26779)) * fix[dynamic-scripts-injection]: unregister content scripts before registration ([hoxyq](https://github.com/hoxyq) in [facebook#26765](facebook#26765))
…erers (facebook#26807) ## Summary Initially reported in facebook#26797. Was not able to reproduce the exact same problem, but found this case: 1. Open corresponding codepen from the issue in debug mode 2. Open components tab of the extension 3. Refresh the page Received multiple errors: - Warning in the Console tab: Invalid renderer id "2". - Error in the Components tab: Uncaught Error: Cannot add node "3" because a node with that id is already in the Store. This problem has occurred after landing a fix in facebook#26779. Looks like Chrome is keeping the injected scripts (the backend in this case) and we start backend twice.
## Summary We have a case: 1. Open components tab 2. Close Chrome / Firefox devtools window completely 3. Reopen browser devtools panel 4. Open components tab Currently, in version 4.27.6, we cannot load the components tree. This PR contains two changes: - non-functional refactoring in `react-devtools-shared/src/devtools/store.js`: removed some redundant type castings. - fixed backend manager logic (introduced in #26615) to activate already registered backends. Looks like frontend of devtools also depends on `renderer-attached` event, without it component tree won't load. ## How did you test this change? This fixes the case mentioned prior. Currently in 4.27.6 version it is not working, we need to refresh the page to make it work. I've tested this in several environments: chrome, firefox, standalone with RN application. DiffTrain build for commit 377c517.
Summary
We have a case:
Currently, in version 4.27.6, we cannot load the components tree.
This PR contains two changes:
react-devtools-shared/src/devtools/store.js
: removed some redundant type castings.renderer-attached
event, without it component tree won't load.How did you test this change?
This fixes the case mentioned prior. Currently in 4.27.6 version it is not working, we need to refresh the page to make it work.
I've tested this in several environments: chrome, firefox, standalone with RN application.