Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Compiled React SVGs: remove object.assign polyfill #21

Open
danielbeardsley opened this issue Apr 15, 2020 · 2 comments
Open

Compiled React SVGs: remove object.assign polyfill #21

danielbeardsley opened this issue Apr 15, 2020 · 2 comments

Comments

@danielbeardsley
Copy link
Member

Right now the compiled react form of each of these icons includes the Object.assign() polyfill (about 300 bytes).

See: https://unpkg.com/browse/@core-ds/[email protected]/24/AlertTriangle.js

This is repeated 126 times (once for every version of the component). Let's please exclude this polyfill as most users will have their own and we can save ~35KB of JS.

@davidrans
Copy link
Member

davidrans commented Jul 8, 2020

Looks like the polyfill.io script we use includes Object.assign in the list of "default" polyfills.

We include polyfill.io's default polyfills in the Guide Page template and the Cart Page template. There might be a few one-off places in the app that don't use one of those templates. Maybe we should move it somewhere more global?

Looks like this polyfill is necessary for IE 11: https://caniuse.com/#search=object.assign

@danielbeardsley
Copy link
Member Author

There might be a few one-off places in the app that don't use one of those templates

I doubt there's anyplace we use react that doesn't include the polyfill include. At the very least, the polyfills shouldn't need to be copied in every single icon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants