Skip to content
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

Native Map detection in ReactComponentTreeHook fails with core-js #7593

Closed
sanniassin opened this issue Aug 28, 2016 · 6 comments
Closed

Native Map detection in ReactComponentTreeHook fails with core-js #7593

sanniassin opened this issue Aug 28, 2016 · 6 comments
Assignees

Comments

@sanniassin
Copy link

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Using polyfilled ES6 Map on browsers without native Map support

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar
https://jsfiddle.net/t5ht7mmb/1/isNative returns true on IE9

What is the expected behavior?
Using objects instead of Map. While isNative method has been implemented in #7491 it can't detect core-js polyfills. Look at discussion in comments here: lodash/lodash@e156459#diff-001d0647fb00f8336795faccdec19a31R11199

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
15.3.1

@gaearon gaearon self-assigned this Aug 28, 2016
@gaearon
Copy link
Collaborator

gaearon commented Aug 28, 2016

Do you have any suggestions on what we could do?

@sanniassin
Copy link
Author

Only ugly solutions like detecting feature availability in iframe

var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
return !!iframe.contentWindow.Map;

@gaearon
Copy link
Collaborator

gaearon commented Aug 28, 2016

Is running DEV builds on an old browser a major use case for you?
Is it noticeably slower with core-js polyfill?

@sanniassin
Copy link
Author

For me it's not a problem at all. I just wanted to attract attention to problem with nativeness detection and core-js if this detection will be used somewhere else in future.

@aweary
Copy link
Contributor

aweary commented Aug 29, 2016

I do think we want to use ES6 Maps in the production code path eventually, so It won't always be a dev-only issue

@gaearon
Copy link
Collaborator

gaearon commented Oct 4, 2017

We don't use that code anymore.

But also, React 16 explicitly asks you to polyfill Map because we use them elsewhere.

@gaearon gaearon closed this as completed Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants