Closed Mustack closed 7 years ago
Without an internal Object.assign
reimplementation:
Estimating dist/stampit.umd.min.js: 5.16 KB, GZIP : 1.8 KB
With it:
Estimating dist/stampit.umd.min.js: 5.26 KB, GZIP : 1.84 KB
The implementation look like this:
export const assign = Object.assign || function assign(to) {
for (let s = 1; s < arguments.length; s += 1) {
const from = arguments[s];
for (const key in from) {
to[key] = from[key];
}
}
return to;
};
I know it's unsafe, but works for the internal object merging.
I would rather release stampit v3 with this thing, but we should clearly state that "IE11 unit tests where never run, we do not have an ability to run stampit tests in IE11".
(Going to cross post this to the other thread.)
Another proposed fix is in #321
Aaand done! Released v3.2.0. https://github.com/stampit-org/stampit/releases/tag/v3.2.0 Not polyfiling anymore.
Stampit makes use of Object.assign(), which is not supported in IE11. I propose that a library be used to address this:
https://www.npmjs.com/package/object-assign
I'll make a PR soon. I need this for my library because I need IE11 support and I would rather not have to force downstream developers to include a polyfill.