Usage of Object.assign breaks compatibility with IE 11
m-lautenbach opened this issue · 3 comments
See this line:
redux-optimistic-ui/src/index.js
Line 93 in 778e5ec
Could this be avoided?
We usually use lodash to express things like that.
Well that'a annoying.
Are you sure your IE11 isn't in compatibility mode?
Babel no longer transpiles Object.assign
. If you want to, you can make your own build:
https://babeljs.io/docs/plugins/transform-object-assign/.
Alternatively (and this is the recommended choice) you use the object.assign.shim()
from a couple years ago. That way your other packages (which I guarantee are also using Object.assign
) will be OK.
They don't, that's why we noticed it is done in redux-optimistic-ui
.
Probably because it's not supported by any IE version: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Browser_compatibility
This library broke our IE support.
Would you consider changing that part?
a shim is definitely what you want then, either babel-polyfill
or the one listed above. By shimming inside the package, the package gets bigger, which means the folks who use something like babel-polyfill
are sending redundant bytes over the wire & there's no way they can avoid it. By shimming outside the package, the developer only sends 1 polyfill over the wire & all dependencies use that 1, keeping payloads as small as possible.