2.3 KiB
title, ring, quadrant
| title | ring | quadrant |
|---|---|---|
| Babel | trial | languages-and-frameworks |
Babel gives you the possibility to use the latest features from JavaScript (ECMAScript) in the browser of your choice.
Without Babel in the backbone; you had to use the feature set of your oldest browser or use feature detections such as modernizr or write polyfills on your own.
In general, Babel is split in 2 ways to bring you the new goodies you want.
-
New syntax will be compiled to old EcmaScript 5 code e.g.:
-
New globals and functions are provided by babel-polyfill e.g.:
The configuration is really simple due to the plugin system. You can choose which ECMAScript version and stage presets you want to use.
- for the latest ECMAScript version use babel-preset-latest
- for version 2015 only use babel-preset-2015
To know what you need you can practice ECMAScript 6 by doing it with es6katas and ask caniuse.
If you are using TypeScript, Babel is not necessary since you already get the new features with TypeScript.