[Fresh] Fall back to Map/Set if Weak equivalents are not available#15907
Merged
gaearon merged 2 commits intofacebook:masterfrom Jun 17, 2019
Merged
[Fresh] Fall back to Map/Set if Weak equivalents are not available#15907gaearon merged 2 commits intofacebook:masterfrom
gaearon merged 2 commits intofacebook:masterfrom
Conversation
threepointone
approved these changes
Jun 17, 2019
|
No significant bundle size changes to report. Generated by 🚫 dangerJS |
gaearon
added a commit
to gaearon/react
that referenced
this pull request
Jun 19, 2019
…acebook#15907) * Fall back to Map/Set if Weak equivalents are not available * Fix Prettier vs Flow fighting
rickhanlonii
pushed a commit
to rickhanlonii/react
that referenced
this pull request
Jun 25, 2019
…acebook#15907) * Fall back to Map/Set if Weak equivalents are not available * Fix Prettier vs Flow fighting
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.
I'm running into this in an older RN environment. Modern ones look fine (including the today's RN open source). So this is a temporary solution until everything is modern internally.
We rely on
WeakMapandWeakSetto avoid holding onto previous versions of any type after a hot reload edit. So this change makes us leak some memory in old environments. I think it's fine because it only affects really old environments (e.g. IE) and the cost is DEV-only (and only comes into play if you actually do a hot reload).The Flow issues are the same we've ran into before. It's a Flow bug but I don't know if it'll get fixed.