-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Adopt object spread and polyfill Object.assign #8283
Comments
Isn't this already done automatically in our rollup configuration at : mapbox-gl-js/build/rollup_plugins.js Line 20 in 42f00ac
|
@asheemmamoowala what this does is tell Buble to transpile object spreads to |
Addressed as part of the IE11 deprecation in v2. |
The issue here is no longer IE11 since GL JS no longer supports it, but some build systems fail when encountering the Object spread notation. See #11266 for an example. We probably don't need to polyfill Object.assign either. |
Currently we use a custom
extend
utility function becauseObject.assign
isn't supported in IE11.However, if we polyfilled
Object.assign
in IE, we could switch to object spread ({...obj}
) syntax across the code base, which provides many benefits:Object.assign
.extend
and all code that uses it in Flow is really hard, which I discovered while working on Start adopting Flow strict mode #8281. It's much easier with spreads because it syntactically indicates the full shape of an object from the start — no type conversions/refinements need to happen to transform an object through multiple extensions.The text was updated successfully, but these errors were encountered: