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

Remove Promise polyfill #79

Closed
invliD opened this issue Mar 7, 2018 · 3 comments
Closed

Remove Promise polyfill #79

invliD opened this issue Mar 7, 2018 · 3 comments

Comments

@invliD
Copy link

invliD commented Mar 7, 2018

Instead of bringing in a Promise polyfill, this library should encourage users to bring their own if they need to support old browsers, but shouldn't make this assumption by itself.

In my case I do want that polyfill, but I'm already bringing my own, so this one would just unnecessarily increase my bundle size.

@lgarron
Copy link
Owner

lgarron commented Mar 7, 2018

The main point of this library is that it Just Works™️ across as many browsers as possible, so I want IE to work out of the box.

However, I'd be open to a PR with suitably designed way to opt out of shipping a separate polyfill fallback (note that the polyfill is not used in modern browsers as of #59, so the main remaining concern should be code bloat), e.g.

  • a build that outputs two JS files (in a way such that it's easy to use the correct one), or
  • avoids loading the polyfill if the module system can already guarantee one.

Examples of similar projects successfully supporting an optional polyfill like this would be useful to know.

@rcchen
Copy link
Contributor

rcchen commented Mar 8, 2018

One example of a project that successfully asks people to use their own polyfill is React. From JavaScript Environment Requirements for React:

React 16 depends on the collection types Map and Set. If you support older browsers and devices which may not yet provide these natively (e.g. IE < 11), consider including a global polyfill in your bundled application, such as core-js or babel-polyfill.

Seems fairly reasonable to have a BYOP (bring your own polyfill) stance if you need to support older browsers or are including your own polyfill already (ie. core-js) and don't need a duplicate.

@crazy4groovy
Copy link

crazy4groovy commented Mar 19, 2018

lgarron added a commit that referenced this issue Aug 1, 2018
- The default build used by `node`/`npm` no longer includes a bundled `Promise` polyfill. #79
  - The main benefit of this is that it reduces the build to ≈40% its previous size.
  - You can still use a version wiith the polyfill included. See `README.md` for instructions.
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

4 participants