Skip to content
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

Make multiple build targets e.g. w/o Polyfills #37

Closed
bedeoverend opened this issue Sep 5, 2016 · 4 comments
Closed

Make multiple build targets e.g. w/o Polyfills #37

bedeoverend opened this issue Sep 5, 2016 · 4 comments

Comments

@bedeoverend
Copy link
Contributor

Simpla shouldn't come with browser polyfills bundled. Right now, it will automatically check and only bring in the polyfills if needed, but users may want to use a different polyfill, or may be importing their own polyfills that may just not have loaded in time. This is weighed up against the speed of install - having a one line script import will be incredibly useful for a lot of users. The best solution is therefore having multiple build targets that users can boot Simpla with, one including polyfills, the other not.

@bedeoverend
Copy link
Contributor Author

Should investigate usage of https://polyfill.io/v2/docs/ to reduce in bundled size

@madeleineostoja
Copy link

How is that different to modernizr and co?

@bedeoverend
Copy link
Contributor Author

AFAIK Modernizr just allows you to check if the document supports things either via appending classes, or using the JS interface.

A request to polyfill.io will return the actual polyfills based on your query. Plus by default it'll also only return those polyfills if it detects the requesting browser requires them. Does the detection via the UA in the request.

For example, using <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch"></script> and the user opens the page in Chrome, that will return an empty script, because polyfill.io knows Chrome already has that feature. But if the user is on Safari, the script will have the fetch polyfill in it.

@madeleineostoja
Copy link

This was decided against in #62 because once Simpla supports v1 Web Components specs/polyfills, promises (which are the only sizeable polyfill we rely on) will be handled by default for element users, and SDK users can always BYO promises.

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

No branches or pull requests

2 participants