4

I am unable to find a defined set of features that Babel compiler cannot compile. I know that there is babel-polyfill and core.js but I need to know the exact names of es2015 features which babel compiler cannot compile.

Any help would be appreciated.

Thanks

1 Answer 1

5

There is an amazing site that gives you all the information you will want on transpiler compatibility, browser and even mobile support.

Have a look at this.

The second column is for Babel. The categories are on the left. If you click the little right arrow symbol you can even see the tests that provide compliance - I think that is an fabulous feature!

The latest release of Babel has improved their numbers. It was just over 50% prior to latest. Now they are at 71% (Feb 21, 2017).

You can even switch to see what ES5 support is still lacking or look into the future with leading edge changes (2016+).


In terms of the core.js polyfills, this link provides an index on the feature support provided. This is broken out in terms of features, and if you navigate to one of them you will be taken to a list of the modules that provide the new capabilities. Each of these modules can be packaged separately, so you can pick and choose what you want if the size of the script is of concern. See this link for more details on using only selected modules.

4
  • nice one but I don't know how to check if the feature gets compiled to es5 or core.js is needed as polyfill on runtime. I want to know the features for which polyfill is a must (i.e.- features that cannot be compiled). I may have missed something from your answer but please guide me. Feb 21, 2017 at 19:42
  • Babel is just a syntax converter, so you will require the core.js at runtime. There is an npm module babel-polyfill that you can include in your projects to get the 71% support indicated int he link. Check out this for further info.
    – rasmeister
    Feb 21, 2017 at 19:53
  • problem is that the babel-polyfill's file size is about 85kb after minification. And I don't need all the features except Promises, const, arrow function, let, class and constructor. Thats why I wanted to know which features can't be compiled by babel compiler as I don't want to include 85kb file when my application starts. Feb 21, 2017 at 19:58
  • 1
    You can use the babel-runtime. Any of the new language features (like Promises) will require this. Other constructs (like const) can be converted to es5 syntax and require no runtime. Not sure about the list for that though.
    – rasmeister
    Feb 21, 2017 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.