Coming some three years after the release of Babel 6, the update is said to be faster, allow for easier upgrades, boost configuration functionality and add support for technologies such as JSX Fragments and TypeScript, among many other things.
Unlike many open source projects that have strong backing from corporate dev teams, the Babel project is primarily driven by individual volunteers. Those volunteers worked for a year to create Babel 7, shipping it last week.
Along the way, they were helped by one of those open source-oriented corporate dev teams -- from Microsoft -- to add a significant new feature: TypeScript support.
"We worked with the TypeScript team on getting Babel to parse/transform type syntax with @babel/preset-typescript
, similar to how we handle Flow with @babel/preset-flow
," said Babel volunteer Henry Zhu in a blog post
Daniel Rosenwasser, the TypeScript guru on the Microsoft dev team, provided more information on the new support.
"Over a year ago, we set out to find what the biggest difficulties users were running into with TypeScript, and we found that a common theme among Babel users was that trying to get TypeScript set up was just too hard," Rosenwasser said. "The reasons often varied, but for a lot of developers, rewiring a build that’s already working can be a daunting task."
There are some caveats with the new functionality -- such as a few constructs that don't compile -- and Microsoft still recommends use of its tsc TypeScript compiler for type-checking TypeScript code.
Besides the TypeScript support, Babel 7 also features a lot of other new functionality. "Babel 7 is a huge release," Zhu said, "we've made it faster, created an upgrade tool, JS configs, config 'overrides,' more options for size/minification, JSX Fragments, TypeScript, new proposals, and more!"
David Ramel is the editor of Visual Studio Magazine.