Skip to content

Devtools: improve getID guard #19364

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

Merged
merged 1 commit into from
Jul 15, 2020
Merged

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Jul 15, 2020

Today I ran into an issue where I saw invalid value used as weak map key when debugging an internal issue. Unfortunately, I wasn't able to reproduce it but looking through the code. However, I did notice there was a guard in the devtools code that could be strengthened, and thus helping narrow down a codepath that leads to us setting an invalid WeakMap key.

@trueadm trueadm requested a review from bvaughn July 15, 2020 11:25
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jul 15, 2020
@sizebot
Copy link

sizebot commented Jul 15, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 9587365

@sizebot
Copy link

sizebot commented Jul 15, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 9587365

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9587365:

Sandbox Source
React Configuration

@bvaughn
Copy link
Contributor

bvaughn commented Jul 15, 2020

Just to clarify, the place this check was strengthened only impacts v15 React, which FB would not be running.

Still seems fine to do though :)

@trueadm
Copy link
Contributor Author

trueadm commented Jul 15, 2020

@bvaughn Ah my bad. I'll take another look later at the other codepaths too :)

@trueadm trueadm merged commit 45eef8b into facebook:master Jul 15, 2020
@bvaughn
Copy link
Contributor

bvaughn commented Jul 15, 2020

Just FYI backend/renderer.js is used for v16 and backend/legacy/renderer.js is used for v15.

@trueadm trueadm deleted the enforce-devtools-guard branch July 15, 2020 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants