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


C23 ISO Standard Is Here But You Probably Won't Read It
06/11/2024

At last ISO C23 has been published, but at $250 you probably aren't going to read it. Can we really tolerate this sort of profiteering on the work of others? This is worse than academic publishing!



DuckDB And Hydra Partner To Get DuckDB Into PostgreSQL
11/11/2024

The offspring of that partnership is pg_duckdb, an extension that embeds the DuckDB engine into the PostgreSQL database, allowing it to handle analytical workloads.


More News

espbook

 

Comments




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