Babel 6 More Than A JavaScript Modernizer
Written by Ian Elliot   
Monday, 02 November 2015

Babel 6 is a JavaScript compiler that targets JavaScript 5 so that you can run the latest version in old browsers. In its latest version it also aims to be a framework for developing JavaScript tools. 

babel

JavaScript is developing quickly and if you want to use the latest version you have to allow for the fact that not every browser is capable of running it.

Babel 6 is the latest version of what used to be called 6to5. It started out as an open source project to compile JavaScript 6 to JavaScript 5 so that you could use all of the nice new facilities in JavaScript 5 to write your programs but then run them on old browsers.  

The name change happened just one year ago so Babel is one year old with the release of version 6. 

 

babelcake

 

With the introduction of Babel 5 the project's direction shifted slightly in that it offered a plugin API which allowed the development of tools that analyse and transform JavaScript code. In short, it became a platform for developing JavaScript tools. For example, you could create debugging tools, minifiers and add your own new syntax to JavaScript. 

Babel 6 takes this plugin approach a step further. The entire language processing has been modularized and the internal transformers have been converted into plugins using the standard API. This makes the language processing much easier to customize.  All of the plugins are optional and so it isn't an ES2015 to JS5 compiler by default. However, you can install groups of plugins to provide different feature sets in a single operation using the new presets facility. 

The API has also been improved and this is a breaking change.

It is claimed that the compiler is also more efficient and it now supports some of the latest proposals for future JavaScript - decorators, class properties etc.

babel

Banner


Amazon AWS Invests In Rust
30/11/2020

No, it's not some strange deal on the mineral exchanges. After Mozilla threw the amazing Rust language under a bus, it seems companies are queuing up to support it. The latest, and perhaps the most se [ ... ]



C# 9 and F# 5 Released With .NET 5
12/11/2020

Microsoft has released C# 9 and F# 5 as part of the .NET 5 release this week. Visual Basic is also included in the 5.0 SDK. It does not include language changes, but has improvements to [ ... ]


More News

 

square

 



 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Monday, 02 November 2015 )