8

Is there any type of list of what features the babel-polyfill supports? We just started using babel and i'm wondering if some of the dependencies we currently rely on can be eliminated like es6-promises & whatwg-fetch. If babel-polyfill supported promises of course there would be no need to include es6-promises.

coding4fun
  • 8,038
  • 13
  • 58
  • 85
  • 5
    OMG i get so sick of some of the downvote happy people here. Just because a question seems stupid question to you because you know the technology well doesn't mean its a stupid question. Someone people are just getting into this technology and these are really valid questions. I figured it out and answered my own question and i think i needs to remain because i'm sure i'm not the first one to ask their self this question and really if you down vote then you should at least comment why its a stupid question. – coding4fun Jul 18 '16 at 16:49
  • I agree with you, this information is hard to find from a simple Google search, unless you know what you're looking for (i.e. "core.js"). Your answer helped me, thanks. – user162097 Oct 21 '16 at 14:40

1 Answers1

5

I think after some research i figured it out. Babel-Polyfill is pretty much core.js + Regenerator Runtime . Look at those projects individually to see what features will be polyfilled. For example, at the time of this writing core.js:

Fetch:

window.fetch is not a cross-platform feature, in some environments it makes no sense. For this reason, I don't think it should be in core-js. Looking at a large number of requests it may be added in the future. Now you can use, for example, this polyfill.

Promises:

Modular standard library for JavaScript. Includes polyfills for ECMAScript 5, ECMAScript 6: promises, symbols, collections, iterators, typed arrays, ECMAScript 7+ proposals, setImmediate, etc.

So i need whatwg-fetch but i don't need es6-promises. Tested in IE11 (which doesn't have promises) so it appears to be working.

coding4fun
  • 8,038
  • 13
  • 58
  • 85