Babel Adds Smart Pipelines
Written by Kay Ewbank   
Monday, 01 April 2019

Babel has been updated with support for smart pipelines and private instant accessors. The JavaScript compiler takes JavaScript ECMAScript 2015+ code and converts it into a backwards compatible version to run in older browsers. 

Babel can also convert React JSX syntax into JavaScript. The main rationale for using Babel has been reduced as fewer people rely on older browsers that don't have support for ES2015 and beyond.

babel

The most recent release (7.3) has added support for smart pipelines. Parsing support was added in version 7.2 of Babel for the Smart Pipelines Operator proposal, and this release lets you transpile it down to standard ECMAScript and try it out. The developers say the current release only supports the main proposal, and none of the additional features. The current implementation also lacks support for yield and await in pipelines.

The next improvement in this version is the ability to parse and compile private instance accessors. Babel already had support for private fields and methods for class instances. Private methods and accessors (getter/setters) have now been added, meaning any class element can be private. The addition to Babel adds support for private accessors within the current babel-plugin-class-features + babel-plugin-proposal-private-methods plugin combination. The private getter and setter functions retrieve and update a private field. 

The final main improvement to the new version is support for named capturing groups. The developers describe this as being the biggest ECMAScript 2018 feature missing in Babel - until now.  Named capture groups let you assign a name to a capture group. The way this works is that when you match a regular expression against a string, you get a match object, and can assign a name to this. After matching, you can access the captured string by using the name you assigned to it.

The current release also adds better TypeScript parsing, and a number of bug fixes. 

babel 

 

More Information

Babel On GitHub

Related Articles

Babel 7 Released With Improved TypeScript Support

Babel 6 More Than A JavaScript Modernizer

6to5 Renamed As Babel - Are You Ready For The Next Gen JavaScript?       

JavaScript 6 EcmaScript 2015 Final Approval         

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, Facebook or Linkedin.

Banner


Whirl Adds Local AirFlow Development Technique
23/04/2019

A test environment for Apache Airflow that lets you carry out local development and testing of Apache Airflow workflows has been made available as open source. Whirl uses Docker and Docker compose to  [ ... ]



.NET Is One With .NET 5
07/05/2019

Microsoft's developer environment is something of a mess these days but at least one set of strands is about to unify. In the near future there will be just one .NET - to rule them all?


More News

Python

 



 

Comments




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