Babel 7.6.4

Babel is a code translator, which compiles next-gen EcmaScript 6 syntax into browser-consumable ES5/JavaScript. It adds a few proposed ES7 constructs even, and works with React, Node.js, Rails, etc. It provides for: array comprehensions, arrow functions, async functions, async generator functions, classes, class properties, computed property names, constants, decorators, default parameters, destructuring, exponentiation operator, for-of, generators, generator comprehensions, let scoping, modules, module export extensions, object rest/spread, property method assignment, property name shorthand, rest parameters, react, spread, tail call optimisation, template literals, type annotations, unicode regex support.

Tags javascript ecmascript nodejs compiler conversion es6 es7 developers
License MITL
State stable

Recent Releases

7.6.413 Oct 2019 12:05 minor bugfix: (2019-10-10). #### :eyeglasses: Spec Compliance. `babel-parser`. Trailing comma after rest - The final (@nicolo-ribaudo). #### :: `babel-cli`, `babel-core`, `babel-generator`, `babel-helper-transform-ture-test-runner`. Revert "chore: Upgrade source-map to 0.6.1 " (@nicolo-ribaudo).
7.6.309 Oct 2019 08:45 minor bugfix: (2019-10-08). #### :eyeglasses: Spec Compliance. `babel-parser`. Disallow await inside async arrow params (@nicolo-ribaudo). parser Disallow numeric separators in legacy octal like integers (@gonzarodriguezt). #### :rocket: New Feature. `babel-types`. Add declarations for more of @babel/types exports (@Jessidhia). #### :: `babel-plugin-transform-block-scoping`. Do not remove let bindings even they are wrapped in closure (@JLHwung). `babel-parser`. add scope to TSModuleDeclaration (@tanhauhau). Do not allow member expressions to start async arrows (@nicolo-ribaudo). parser Don't crash on comment after trailing comma after elision (@nicolo-ribaudo). `babel-plugin-transform-react-constant-elements`, `babel-traverse`. Do not hoist jsx referencing a mutable binding (@nicolo-ribaudo). `babel-generator`, `babel-parser`, `babel-plugin-transform-block-scoping`, `babel-plugin-transform-flow-comments`, `babel-plugin-transform-flow-strip-types`, `babel-plugin-transform-typescript`. Flow: interface identifier should be declared in the scope (@JLHwung). #### :nail_care: Polish. `babel-core`. assertNoDuplicates throw with more context (@hjdivad). Add filename to transform error (@JLHwung). #### :house: Internal. Other. Use `make -j` for parallel build (@JLHwung). perf: only apply lazy cjs module transform on cli and core (@JLHwung). Enable optional chaining and nullish coalescing plugins (@nicolo-ribaudo). `babel-cli`, `babel-core`, `babel-generator`, `babel-helper-tures`, `babel-helper-transform-ture-test-runner`, `babel-node`, `babel-plugin-transform-react-jsx-source`, `babel-plugin-transform-runtime`, `babel-preset-env`, `babel-preset-react`. Add windows to travis (@nicolo-ribaudo). #### :running_woman: Performance. `babel-parser`. perf: replace lookahead by lookaheadCharCode (@JLHwung). Other. perf: only apply lazy cjs module transform on cli and core (@JLHwung).
7.6.229 Sep 2019 01:37 minor bugfix: babel-parser #10472 added check to disallow super.private variable access and test case added. (@vivek12345) #10468 parser Disallow numeric separator in unicode scape sequences. (@ivandevp) #10467 parser Invalid NonOctal Decimal. (@gonzarodriguezt) #10461 parser Disallow static fields named constructor. (@guywaldman) #10455 parser Report escapes in kws only if they won't be used as identifiers. (@nicolo-ribaudo) bug Bug Fix babel-parser #10445 Leave trailing comments after handling a possible trailing comma. (@nicolo-ribaudo) babel-cli #10400 fix: allow the process to exit naturally. (@JLHwung) babel-core #10402 fix: pass optionLoc when validating plugin object. (@JLHwung) babel-plugin-transform-block-scoping, babel-plugin-transform-spread, babel-traverse #10417 Do not guess relative execution status for exported fns. (@nicolo-ribaudo) babel-plugin-proposal-object-rest-spread, babel-preset-env #10275 fix object rest in array pattern. (@tanhauhau)
6.3.2626 Dec 2015 13:45 minor bugfix: `babel-plugin-transform-es2015-parameters`: the order of arguments initialization (T6809). `babel-traverse`: In `evaluate()`, it should not mistake lack of confidence for falsy. Spec Compliancy. `babylon`, `babel-generator`, `babel-plugin-transform-regenerator`: : Remove `await *` from `babylon` and raise an error for that syntax since it was removed from the proposal and was causing an at runtime but not at compile time (T6688). Internal. gulp build path to work on windows (T6855). `babel`: Point users to the cli docs. `babel-core`: Add a test for checking plugins/presets are resolved relative to `filename`.
6.3.2522 Dec 2015 15:45 minor bugfix: `babylon`: Multiple `"use strict"` in function causes outer scope to be parsed as strict. `babel-generator`: Correctly set `format.quotes` to `opts.quotes`. `babel-generator`: JSX attributes should use double qoutes. `babel-traverse`: static evaluation. Internal. `babel-plugin-transform-es2015-parameters`: Optimize `arguments` access.
6.3.2018 Dec 2015 10:05 minor bugfix: `babel-generator`: invalid code generation for numeric `MemberExpression` (`5.toString()` - `5..toString()`). `babel-types`: Add `Expression` alias to `BindExpression`.
6.3.1714 Dec 2015 10:25 minor feature: `babel-types`: DoWhileStatement should take node type `Statement` as body. New Feature. `babel-generator`: Add a new minified format option to do possibly dangerous byte saving. Internal. `babel-traverse`: Support ObjectProperty in `Scope.isPure`. Polish. `babel-cli`: Do not prefer global when installing babel-cli.
6.3.1610 Dec 2015 06:45 minor bugfix: `babel-traverse`: Set the correct `parent` and `parentPath` for new a `NodePath`. `babel-generator`: Always print `""` in `compact` mode for consistency (gzip). Will be changed in a new mode (a supserset of `compact`) in a later patch. Don't print comments in `compact` mode. Don't print parentheses on `throw` statements with `SequenceExpression`. Internal. `babel-traverse`: Support `UnaryExpression` in `isPure` check.
6.3.1406 Dec 2015 16:25 minor bugfix: `babel-traverse`: regression with scope in switch statement. Related to. ## 6.3.8-6.3.13. Testing lerna - A tool for managing JavaScript projects with multiple packages. `babylon`, `babel-types`, `babel-generator`: Add support for `NullLiteralTypeAnnotation` (`null` literal type) in flow.
6.3.103 Dec 2015 03:17 minor bugfix: spacing in binary expression when right is a binary expression and has a unary on the left in compact mode. Ex: `(a+(+b*2))` should be - `a+ +b*2`.
6.1.412 Nov 2015 14:05 minor bugfix: class transformation for export declarations with no `id`. regenerator plugin being passed an invalid function `id`. Add support for async to generator helper on object and class methods. looking up undefined nodes when walking back up the tree in typeof symbol plugin. accidental serialisation of template literals in the code generator when the object of a member expression. Add missing `Expression` alias to `TypeCastExpression`. Move `children` prop pushing to after props to ensure correct order in the react inline elements plugin. `buildExternalHelpers` script ignoring non-underscored helpers. exported classes with static class properties. Spec Compliancy. Add support for computed mutators in `babel-plugin-transform-es2015-computed-properties`. Polish. Make interop for plugins with the `__esModule` work for all plugins no matter how they're imported/specified. Make it illegal for plugins to specify a catch-all `enter`/`exit` visitor method. Ignore `babel-runtime` version mismatch in `babel-doctor`. Omit `defaultProps` helper when there are no props in the react inline elements plugin. Add validators for ES2015 export nodes. Add missing core node validators. Update `runtime` plugin `core-js` definitions. Internal. Add `babel-plugin-transform-react-display-name` to the `react` preset. Clean up scope cache. Move `babel/register` into a separate `babel-register` package. Add `react-jsx-source` plugin and add it to the `react` preset.
6.0.1431 Oct 2015 18:05 minor bugfix: Spec Compliancy. Update exponentiation operator precedence. parser where arrow functions have a higher precedence than they should. SystemJS module formatter exporting function parameters. Ensure that invalid identifier JSX attribute keys are quoted when transforming to calls. ES3 property literal plugin. parameters after defaults in arrow functions refering to the wrong `arguments`.
5.8.2724 Oct 2015 11:25 minor bugfix: scope tracking of references before the declaration has been visited. Correctly identify parameters as binding identifiers.
5.8.2411 Sep 2015 23:45 minor feature: Spec Compliancy. Updated `optimisation.react.inlineElements` transformer to React 0.14 output. Thanks @spicyj!. Polish. Add support for evaluating more static nodes. Thanks @hzoo!.
5.8.2211 Aug 2015 23:05 minor feature: Bug Fix. Fix bug causing regexes to cause a syntax error after a block. Internal. Expose `File`.
5.8.2106 Aug 2015 10:05 feature: New Feature. Add support for Flow export types. Bug Fix. Fix flow type annotations on object properties being lost. Fix bug effecting nested arrow functions. Check valid `export default` `function`/`class` token when parsing export default before converting to a declaration to avoid turning expressions into declarations. Polish. Add an exception to non-existent bindings when checking if we need to wrap block scoping blocks in a closure. Make comment retainment for multiple replacement nodes more predictable. Internal. Remove `operator` property from `AssignmentPattern` nodes. Update `es7.asyncFunctions` and `es7.objectRestSpread` to stage 2. ## 5.8.13-5.8.20. The CHANGELOG was broken for these releases. Git tags were not pushed in the correct order and are therefore incorrect. It's recommended you NOT use any versions within this range. New Feature. Add `es6.spec.modules` transformer. Bug Fix. Don't register export declarations as a module binding. Register import bindings to the specifier instead of the declaration. `export *` should not export `default`. Clear `rawValue from JSX attribute values to avoid outputting the raw source verbatim. Add support for boolean flow literals. Fix bug where files that babel can compile weren't being written when ignored with the `--copy-files` flag. Create new raw identifiers instead of cloning the original user one when exploding export specifiers to fix source map issues resulting in incorrect locations. Break on hitting a terminator paren triggering character to avoid pushing multiple starting parens. Consider comment starting character to be a terminatorless separator to avoid starting comments breaking terminatorless nodes. Internal. Use `json5` for parsing `.babelrc` files and `JSON` for `package.json`. Update Regenerator dependency to `0.8.35`. Remove flow types from being scope tracked. Polish. Only register export declarations in scope tracking if they're of a valid type. Only output code frame and message on syntax
5.8.928 Jul 2015 15:25 minor bugfix: Fix issue in parser where the flow plugin wasn't using state to refer to whether it as in a type or not causing lookaheads to cause breakages.
5.8.124 Jul 2015 14:05 minor feature: Bug Fix. Fix regression where async arrow functions couldn't have type annotation parameters. Output type annotations of type instantiation parameters. Polish. Prepend to highest loop when performing rest parameter allocation optimisation. Add comment attachment to parser. Add support for retaining inner comments of empty blocks.
5.7.420 Jul 2015 10:05 minor feature: Bug Fix. Fix comments containg `@flow` being completely removed from output rather than just the specific directive.
5.7.216 Jul 2015 16:25 minor feature: Bug Fix. Fix performance issue in code generator when comment columns would attempt to match up in `compact` mode causing large amounts of whitespace. Fix single line comments not outputting a newline in `compact` mode. Polish. Add support for flow return types for arrow functions.
5.6.725 Jun 2015 14:05 minor feature: Bug Fix. Fix hoisting of `ForXStatement` `left` `var`s when inserting a block scoping IIFE. Polish. Combine all leading computed property initialisers into the root object in loose mode. Internal. Deprecate returning of replacement strings from visitor methods.
5.6.021 Jun 2015 07:45 feature hidden: Bug Fix. Fix istanbul interop for register hook when registering for non-existence extension. Fix super class constructor call differing for no constructor in derived classes. Disable module import receiver when in loose mode. Fix duplicate filenames when using `babel` CLI when passing multiple matching patterns. Register labels as bindings to fix undeclared variable checks. Polish. Remove unnecessary string binary expressions when transforming template literals. Support module live bindings in arbitary positions not in Program statement position. Throw error when attemping to replace a `Program` root node with another node not of type `Program`. Optimise rest parameters in spread element position and allocate rest array at the earliest common ancestor of all references. Generate original number representation when value was not changed. Check for invalid binding identifiers when generating inferred method names. Don't terminate CLI when watching files fail compilation on init. New Feature. Add new plugin API. Internal. Split react displayName addition into a plugin. Add check for `JSXMemberExpression` to `t.isReferenced`. Move `validation.undeclaredVariableCheck` transformer up. Start great core-to-plugin exodus. Add `BindingIdentifier` virtual type. Hidden class optimisations. Array allocation optimisations. Update `regenerator`. Update `js-tokens`. Sync with upstream Acorn.
5.5.815 Jun 2015 07:45 minor feature: Internal. Remove extremely unprofessional and harsh error message for those hotlinking to `resolve-rc`.
5.5.406 Jun 2015 16:25 minor feature: Bug Fix. Add back missing `shouldIgnore` check. Log message on deprecated options rather than throw an error. Fix name of `auxiliaryComment` option when attempting Istanbul interop in `babel/register`.
5.4.521 May 2015 07:05 minor bugfix: Add `JSXIdentifier` as a valid `ReferencedIdentifier` visitor virtual type. Ignore `CallExpression` `_prettyCall` when the `retainLines` option is enabled. Inherit comments to new declaration node when exploding module declarations. Fix `es6.tailCall` transformer failing on calls that exceed the max parameters of the function.
5.4.317 May 2015 20:05 minor feature: **Bug Fix**. * Fix `module` being incorrectly rewritten when used as in an export declaration. * When performing single-reference inlining, ensure that the single reference isn't a child of the binding itself. * Fix a bug in `minification.deadCodeElimination` where a new binding instance was being created for local class bindings instead of just inheriting the parent one. * Fix bug with paren printing in `compact` and `retainLines` mode where a left paren was already printed before catching up. * **Internal**. * Handle contexts for paths much better. This will ensure that the path node location info is in sync.
5.3.113 May 2015 12:45 minor feature: **Bug Fix**. * Fix unique export specifiers not being cloned when exploding class and function exports,. * **Polish**. * Turn import remaps to sequence expressions to remove their context and improve performance.
5.2.1709 May 2015 03:16 minor feature: **Bug Fix**. * Fix auxiliary comments not properly being attached to function declaration helpers. * Add `Super` node type to `ast-types` patch. * Ignore parameter bindings when attempting to inline them in the `minification.deadCodeElimination` transformer. * Correct `extensions` arguments when using the Babel CLI.
5.2.1205 May 2015 10:25 minor feature: **Polish**. * Make UID generation based on module declarations **much** nicer. * **Internal**. * Remove internal check for traversal path replacement of self. This is a pattern that **could** come up in the wild and it could lead to pretty nasty code and may lead to internal regressions as the test coverage isn't 100 :( Instead, just put it in the fast path.
5.2.201 May 2015 07:05 minor feature: Allow `util.arrayify` to take arbitrary types and coerce it into an array.
5.1.1121 Apr 2015 18:25 minor bugfix: Memoise and bind member expression decorators. Move JSX children cleaning to opening element visitor. Fixes elements not being cleaned in certain scenarios. Consider `SwitchStatement`s to be `Scopable`. Fix `bluebirdCoroutines` calling `interopRequireWildcard` before it's defined. Add space to `do...while` code generation. Validate `super` use before `this` on `super` exit rather than entrance. **Polish**. Add Babel name to logger.
5.1.1016 Apr 2015 03:15 minor feature: **Bug Fix**. * Remove `makePredicate` from acorn in favor of an `indexOf`. * Remove statements to expression explosion when inserting a block statement. * **Internal**. * Remove runtime compatibility check.
5.0.1212 Apr 2015 03:15 minor feature: **Bug Fix**. * Fix incorrect remapping of module references inside of a function id redirection container.
5.0.908 Apr 2015 03:15 minor feature: **Polish**. * Use `moduleId` for UMD global name if available. * **Bug Fix**. * Fix UMD global `module` variable shadowing the `amd`/`common` `module` variable. * Fix Flow param type annotation regression. * Fix function name collision `toString` wrapper. Thanks @alawatthe (!.
5.0.004 Apr 2015 06:45 major feature: This release includes the new ES7 proposals: Decorators, Class properties, and Export extensions. The entire internal traversal and transformation pipeline has undergone a rewrite that substantially increases flexibility and will allow many future pipeline performance optimisations. This release also brings a plugin API, which allows consumers to plug in their own custom transformers to utilise the powerful transformation mechanisms that Babel has to offer.