Summary
A library that converts modern
JavaScript syntax into a backward compatible version for use in older browsers.
Overview
Main Website | babeljs.io |
Version | babel-loader: 8.0.4 @babel/core: 7.1.6 @babel/plugin-proposal-class-properties: 7.1.0 @babel/plugin-proposal-object-rest-spread: 7.0.0 @babel/preset-env: 7.1.6 babel/preset-react: 7.0.0 |
Experience | Super Cool |
Notes
- Different web browsers support different versions of the JavaScript syntax. Almost all of them support ES5 or earlier, however, there are some really helpful features in later versions that simplify the code.
- If you attempt to use more modern syntax features from ES6 you will encounter issues in older browsers (e.g. Internet Explorer).
- Using Babel allows you to code using the new features (e.g. fat-arrow functions, object spread operator, object destructuring) then at build time convert the final code into ES5 syntax.
- One of my favorite transformations is JSX to HTML using Babel. This eliminates that need for quoted strings of HTML and makes it much easier to read and write HTML in JavaScript.