Skip to content

Add babel-plugin-transform-object-assign to transform Object.assign #225

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

Closed
wants to merge 1 commit into from

Conversation

nguquen
Copy link

@nguquen nguquen commented Apr 1, 2017

Add babel-plugin-transform-object-assign to transform Object.assign in extendReactClass.js

@gajus
Copy link
Owner

gajus commented Apr 1, 2017

Whats the reason?

@nguquen
Copy link
Author

nguquen commented Apr 1, 2017

If not, it will throw Object doesn't support property or method "assign" on IE 11, and we got blank page on IE 11 or old browsers.

@gajus
Copy link
Owner

gajus commented Apr 1, 2017

Polyfill-ing is not responsibility of react-css-modules.

Use https://polyfill.io/

@gajus gajus closed this Apr 1, 2017
@mirovelk
Copy link

mirovelk commented Sep 12, 2017

Transforming Object.assign is not the same as polyfilling. There are situations when polyfill in browser can't be used (is not allowed).

By having Object.assign in your code you are disabling testing in phantomjs as well (where Object.assign is not supported as well).

Most libraries use https://www.npmjs.com/package/object-assign or https://www.npmjs.com/package/babel-plugin-transform-object-assign to prevent these issues.

@transplier
Copy link

One of the advantages of css-modules is isolation. Given this, it seems odd to require the mutation of the host environment (polyfilling) in order to use css-modules, especially in library scenarios.

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.

4 participants