Babel

Babel is a transpiler for Javascript which provides the highest level of feature inclusion from ES6 and produces the backward compatible code. This allows developers to use news features supported by ES6 and still run their code on current or even older browsers.

What is Babel?

Babel essentially is Ecmascript6 to Ecmascript5 transpiler. As we saw earlier, trasnpiler is a tool that converts a higher level language to a lower level language. In this case, it converts the code to Javascript which is understood by all modern browsers. At the same time, it allows developers to use latest features from the ES6 specs even though they are yet to be supported by the browsers.

Representative image - JS Developers are preferring Babel now.
Representative image – JS Developers are preferring Babel now.

Background

Babel was developed by an Australian developer Sebastian McKenzie and has worked hard to ensure that this transpiler can handle all the new syntax that ES6 brings. It also supports React’s JSX extensions and Flow Type Annotations.

Babel commonly gets compared with other transpilers such as CoffeeScript and TypeScript. While the latter two are only languages, the former one has become an ecosystem and a platform. It allows plugins to be written and included to enhance the functionality and thus developer productivity.

Additionally, it has also started support for ES7 or ES2016 keywords such as async and await. You can find a great example how this makes the code concise in this article.

How to use Babel with your code?

Follow this tutorial to learn how to use Babel in your code.

Related Links

Related Keywords

Transpilers, TypeScript, ES6, ES5

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.