fix[react-devtools]: restore original args when recording errors#30091
Merged
hoxyq merged 1 commit intofacebook:mainfrom Jun 26, 2024
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
160aea7 to
238c154
Compare
238c154 to
23b6430
Compare
23b6430 to
1f9ce44
Compare
vzaidman
approved these changes
Jun 26, 2024
hoxyq
added a commit
that referenced
this pull request
Jul 3, 2024
## Summary Full list of changes, mostly fixes: * chore[react-devtools/renderer]: dont show strict mode warning for prod renderer builds ([hoxyq](https://github.com/hoxyq) in [#30158](#30158)) * chore[react-devtools/ui]: fix strict mode badge styles ([hoxyq](https://github.com/hoxyq) in [#30159](#30159)) * fix[react-devtools]: restore original args when recording errors ([hoxyq](https://github.com/hoxyq) in [#30091](#30091)) * Read constructor name more carefully ([LoganDark](https://github.com/LoganDark) in [#29954](#29954)) * refactor[react-devtools/extensions]: dont debounce cleanup logic on navigation ([hoxyq](https://github.com/hoxyq) in [#30027](#30027)) * lint: enable reportUnusedDisableDirectives and remove unused suppressions ([kassens](https://github.com/kassens) in [#28721](#28721)) * fix[react-devtools/extensions]: propagate globals from env ([hoxyq](https://github.com/hoxyq) in [#29963](#29963)) * refactor[react-devtools/tests]: use registered marks instead of cleared in tests ([hoxyq](https://github.com/hoxyq) in [#29929](#29929))
This was referenced Jul 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When DevTools frontend and backend are connected, we patch console in 2 places:
patch(), when renderer is attached to:patchForStrictMode(), when React notifies about that the next invocation is about to happed during StrictModepatchForStrictMode()will always be at the top of the patch stack, because it is called at runtime when React notifies React DevTools, because of this,patch()may receive already modified arguments (with stylings for dimming), we should attempt to restore the original argumentsHow did you test this change?
Look at yellow warnings on the element view: