Babel v7.0.0-alpha.17 Release Notes

Release Date: 2017-07-26 // over 6 years ago
    • ๐Ÿ›  Lots of bug fixes
    • ๐Ÿ“ฆ function.sent (temporary at babel-plugin-transform-function-sent2 until we get access to the npm package) EDIT: republished babel-plugin-transform-function-sent
    • ๐Ÿ”Œ Optional catch binding try {} catch {}: babel-plugin-transform-optional-catch-binding
    • es2015-parameters loose mode that doesn't use arguments

    :eyeglasses: Spec Compliance

    • ๐Ÿ”Œ babel-plugin-check-es2015-constants

    Instead of throwing a compile time error when const is violated, Babel should insert a throw statement before the violation.

    :boom: Breaking Change

    • ๐Ÿ”Œ babel-plugin-transform-flow-comments

    ๐Ÿšš > Removes the "Noop" AST node, which was only used in the flow-comments plugin and probably unlikely in the ecosystem.

    :rocket: New Feature

    • ๐Ÿ”Œ babel-plugin-transform-react-constant-elements
      • #5307 feature: Support whitelisting mutable props for react-constant-elements. (@STRML)

    If you know a certain property will be ok to hoist

    {
      "plugins": [
        ["transform-react-constant-elements", {"allowMutablePropsOnTags": ["FormattedMessage"]}],
      ]
    }
    
    • babel-generator, babel-types
    • ๐Ÿ”Œ babel-generator, babel-plugin-transform-flow-strip-types, babel-types
    declare function foo(x: mixed): boolean %checks(x !== null);
    
    • ๐Ÿ”Œ babel-generator, babel-plugin-transform-flow-strip-types
    declare module "foo" {
      declare export type * from "bar";
    }
    
    • ๐Ÿ”Œ babel-helper-remap-async-to-generator, babel-helper-wrap-function, babel-helpers, babel-plugin-transform-function-sent, babel-preset-stage-2
    function* gen() {
      let a = function.sent;
    }
    
    let gen = _skipFirstGeneratorNext(function* gen() {
      const _functionSent = yield;
      let a = _functionSentt;
    });
    
    • ๐Ÿ”Œ babel-core, babel-generator, babel-plugin-syntax-optional-catch-binding, babel-plugin-transform-optional-catch-binding, babel-template, babel-traverse, babel-types
    try {
    } catch {}
    
    • ๐Ÿ”Œ babel-plugin-transform-es2015-parameters

    Non-spec compliant transform (disregards arity) but doesn't use arguments

    var t = function (f = "foo") {
      return f + " bar";
    };
    
    var t = function (f) {
      if (f === void 0) {
        f = "foo";
      }
    
      return f + " bar";
    };
    

    :bug: Bug Fix

    • ๐Ÿ”Œ babel-core, babel-helpers, babel-plugin-transform-object-rest-spread, babel-plugin-transform-react-constant-elements
      • #5757 Non string computed keys in object-rest-spread. (@peey)
    • babel-traverse
      • #5745 Use first binding for multiple var declarations. (@peey)
    • ๐Ÿ— babel-helper-builder-binary-assignment-operator-visitor, babel-helper-explode-assignable-expression, babel-plugin-transform-exponentiation-operator
    • ๐Ÿ”Œ babel-plugin-transform-es2015-for-of, babel-traverse
    • ๐Ÿ”Œ babel-plugin-transform-numeric-separator, babel-types
    • ๐Ÿ”Œ babel-plugin-transform-es2015-modules-amd, babel-plugin-transform-es2015-modules-commonjs, babel-plugin-transform-es2015-modules-umd
    • ๐Ÿ”Œ babel-plugin-transform-es2015-for-of
    • ๐Ÿ”Œ babel-core, babel-plugin-transform-object-rest-spread, babel-traverse
    • babel-generator
    • ๐Ÿ”Œ babel-helpers, babel-plugin-transform-es2015-classes, babel-plugin-transform-es2015-typeof-symbol
    • ๐Ÿ”Œ babel-plugin-transform-react-inline-elements

    :house: Internal

    • โœ… babel-helper-transform-fixture-test-runner
    • babel-code-frame
    • babel-register
    • babel-types
    • babel-cli
    • babel-generator
    • babel-traverse
    • Other
    • ๐Ÿ— babel-core, babel-generator, babel-helper-builder-react-jsx, babel-helper-function-name, babel-helper-replace-supers, babel-plugin-transform-es2015-block-scoping, babel-plugin-transform-es2015-classes, babel-plugin-transform-jscript, babel-plugin-transform-react-constant-elements, babel-plugin-transform-react-jsx, babel-template, babel-traverse, babel-types
    • ๐Ÿ”Œ babel-plugin-transform-es2015-modules-systemjs