Babel Improves JSX Optimization
Written by Kay Ewbank   
Thursday, 09 April 2020

There's a minor upgrade to Babel ahead of the 8.0 release expected in the next few months. The current update adds support for TypeScript 3.8 and improves the optimization for JSX transforms.

Babel is a JavaScript compiler that 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.. Using Babel allows developers to use the new features of JavaScript and create an application that will work no matter what browser it's used in, but the need has become less as fewer people use older browsers that don't have support for ES2015 and beyond.

babelOne improvement in the new version is greatly reduced bundle sizes when using the module/nomodule pattern. This has been achieved thanks to work on the preset modules to find a way to reduce bundle sizes when using the module/nomodule pattern. The preset modules provide a way to apply optimizations to all preset-env targets values, without a separate preset. This enables async/await, Tagged Templates, arrow functions, destructured and rest parameters, in all modern browsers, which make up 88% of traffic. Developers can still support older browsers using the module/nomodule pattern. The optimization works around bugs and inconsistencies in modern JavaScript engines by converting broken syntax to the closest non-broken modern syntax. This avoids the solution used until now of handling issues with different browsers separately, which resulted in increasingly large bundles.

This release also adds full support for TypeScript 3.8, which introduced explicit type-only imports and exports and for Flow 0.120, which introduced the declare modifier for class fields.

The developers have also worked with the React team to provide a new JSX transform that will make it possible for React and React-like libraries to further optimize the creation of JSX elements.

 

babel

More Information

Babel On GitHub

Related Articles

Babel Adds Smart Pipelines 

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


Introducing Jetpack Compose for Desktop
10/11/2020

JetBrain's Jetpack Compose for Desktop is an open source project being developed in collaboration with Google’s Jetpack Compose, intended to simplify and accelerates UI development for desktop appli [ ... ]



Scratch For More Than A Brief Coding Encounter
02/12/2020

Creators of Scratch, Mitchel Resnik and Natalie Rusk, have come up with four guiding principles for introducing coding to young people. Their "Four Ps of Creative Learning" are Projects, Passion, [ ... ]


More News

square

 



 

Comments




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

Last Updated ( Thursday, 09 April 2020 )