Skip to content

[Fresh] Fall back to Map/Set if Weak equivalents are not available#15907

Merged
gaearon merged 2 commits intofacebook:masterfrom
gaearon:fresh-old
Jun 17, 2019
Merged

[Fresh] Fall back to Map/Set if Weak equivalents are not available#15907
gaearon merged 2 commits intofacebook:masterfrom
gaearon:fresh-old

Conversation

@gaearon
Copy link
Copy Markdown
Collaborator

@gaearon gaearon commented Jun 17, 2019

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 WeakMap and WeakSet to 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.

@sizebot
Copy link
Copy Markdown

sizebot commented Jun 17, 2019

No significant bundle size changes to report.

Generated by 🚫 dangerJS

@gaearon gaearon merged commit cd98e63 into facebook:master Jun 17, 2019
@gaearon gaearon deleted the fresh-old branch June 17, 2019 15:00
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants