Skip to content

Conversation

@sheerun
Copy link

@sheerun sheerun commented Apr 21, 2016

I get it WeakMap sometimes fails to load, but avoiding it completely is too harsh, especially I imagine native implementation can be faster than O(n) lookup.

function addProxy(Component, proxy) {
allProxies.push([Component, proxy]);
if (!global.WeakMap) {
global.WeakMap = class WeakMap {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can’t modify globals. This would really catch users by surprise.

@gaearon
Copy link
Owner

gaearon commented May 1, 2016

I’m fairly sure this is almost never a bottleneck compared to the actual work updating the component tree.

I think we can take something like this, but it has to not override the globals. Maybe defining something like ComponentMap that either uses an array or a WeakMap would be fine.

@gaearon
Copy link
Owner

gaearon commented May 1, 2016

Also please note 1.x branch will not be maintained anymore. Please send PRs against the next branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants