Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency babel-preset-es2015 to v6.24.1 #449

Merged
merged 1 commit into from Jan 11, 2019

Conversation

mesosphere-web
Copy link
Contributor

@mesosphere-web mesosphere-web commented Dec 19, 2018

This PR contains the following updates:

Package Type Update Change References
babel-preset-es2015 devDependencies minor 6.5.0 -> 6.24.1 homepage, source

Release Notes

babel/babel

v6.24.1

Compare Source

v6.24.1 (2017-04-07)

🐛 Bug Fix
  • babel-plugin-transform-regenerator

Fixes an issue when using async arrow functions with rest parameters (crazy!)

function test(fn) {
  return async (...args) => {
    return fn(...args);
  };
} 
  • babel-plugin-transform-es2015-function-name, babel-types
var obj = { await: function () {} }; // input
var obj = { await: function _await() {} };  // output
📝 Documentation
🏠 Internal
Committers: 5

v6.24.0

Compare Source

6.24.0 (2017-03-13)

A quick release for 2 features:

  • Thanks to @​rwjblue, there is now a noInterop option for our es2015-modules transform to remove the interopRequireDefault and interopRequireWildcard helpers.

Input

import foo from "foo";
foo;

Regular Output

var _foo = require("foo");
var _foo2 = _interopRequireDefault(_foo);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_foo2.default;

Output with option noInterop

"use strict";
var _foo = require("foo");
(0, _foo.default)();

This also helps ember-cli migrate to Babel 6.

  • @​izaakschroeder has added dirname to the preset constructor which presets can use to resolve things relative to files.

Example usage of fileContext.dirname in a preset

module.exports = function preset (context, options, fileContext) {
  if (/resolve-addons-relative-to-file$/.test(fileContext.dirname)) {
    return {
      plugins: ['plugin-here'],
    };
  }
  return {};
};

This will help out with reusing a browserslist file for babel-preset-env and for plugins like https://github.com/tleunen/babel-plugin-module-resolver.

🚀 New Feature
  • babel-plugin-transform-es2015-modules-amd, babel-plugin-transform-es2015-modules-commonjs
  • babel-core
🐛 Bug Fix
📝 Documentation
🏠 Internal
Committers: 14

v6.22.0

Compare Source

6.22.0 (2017-01-19)

Thanks to 10 new contributors! (23 total)

A quick update since it's been over a month already: adds support for shorthand import syntax in Flow + some fixes!

We'll be merging in our current 7.0 PRs on a 7.0 branch soon and I'l be making some more issues (most should be beginner-friendly).

To follow our progress check out our 7.0 milestone, the wiki and upcoming announcements on twitter!

We support stripping out and generating the new shorthand import syntax in Flow (parser support was added in babylon@6.15.0.

import {
  someValue,
  type someType,
  typeof someOtherValue,
} from "blah";
🚀 New Feature
  • babel-generator, babel-types
  • babel-plugin-transform-flow-strip-types, babel-traverse
  • babel-core
🐛 Bug Fix
  • babel-plugin-transform-object-rest-spread
const { x, ...y } = foo();

Old Behavior

const { x } = foo();
const y = _objectWithoutProperties(foo(), ["x"]);

New/Expected Behavior

const _ref = foo(); // should only be called once
const { x } = _ref; 
const y = _objectWithoutProperties(_ref, ["x"]);

Accounts for default values in object rest params

function fn({a = 1, ...b} = {}) {
  return {a, b};
}
const assign = ([...arr], index, value) => {
  arr[index] = value
  return arr
}

const arr = [1, 2, 3]
assign(arr, 1, 42)
console.log(arr) // [1, 2, 3]
  • babel-plugin-transform-es2015-function-name

Input

export const x = ({ x }) => x;
export const y = function () {};

Output

export const x = ({ x }) => x;
export const y = function y() {}; 
💅 Polish
  • babel-traverse
  • babel-generator, babel-plugin-transform-exponentiation-operator
📝 Documentation
🏠 Internal
  • babel-*
  • babel-helper-transform-fixture-test-runner
  • babel-cli, babel-core, babel-generator, babel-helper-define-map, babel-register, babel-runtime, babel-types
  • babel-cli, babel-generator, babel-helper-fixtures, babel-helper-transform-fixture-test-runner, babel-preset-es2015, babel-runtime, babel-traverse
  • babel-code-frame
  • babel-plugin-transform-react-jsx
  • babel-plugin-transform-decorators
  • babel-plugin-transform-es2015-computed-properties
  • babel-cli
Committers: 23, First PRs: 10

v6.18.0

Compare Source

v6.18.0 (2016-10-24)

🚀 New Feature
  • babel-generator, babel-plugin-transform-flow-strip-types

Check out the blog post and flow docs for more info:

type T = { +p: T };
interface T { -p: T };
declare class T { +[k:K]: V };
class T { -[k:K]: V };
class C2 { +p: T = e };
  • babel-core, babel-traverse
// in
['a' + 'b']: 10 * 20, 'z': [1, 2, 3]}
// out
{ab: 200, z: [1, 2, 3]}
  • babel-plugin-syntax-dynamic-import, babel-preset-stage-2

Parser support was added in https://github.com/babel/babylon/releases/tag/v6.12.0.

Just the plugin to enable it in babel.

// install
$ npm install babel-plugin-syntax-dynamic-import --save-dev

or use the new parserOpts

// .babelrc
{
  "parserOpts": {
    "plugins": ['dynamicImport']
  }
}
  • babel-helper-builder-react-jsx, babel-plugin-transform-react-jsx

Previously we added a useBuiltIns for object-rest-spread so that it use the native/built in version if you use a polyfill or have it supported natively.

This change just uses the same option from the plugin to be applied with spread inside of jsx.

// in
var div = <Component {...props} foo="bar" />
// out
var div = React.createElement(Component, Object.assign({}, props, { foo: "bar" }));

EmptyTypeAnnotation

Added in flow here and in babylon here.

function f<T>(x: empty): T {
  return x;
}
f(); // nothing to pass...
  • babel-traverse
    • #​4758 Make getBinding ignore labels; add Scope#getLabel, Scope#hasLabel, Scope#registerLabel. (@​kangax)

Track LabeledStatement separately (not part of bindings).

🐛 Bug Fix

Will give examples of code that was fixed below

  • babel-plugin-transform-react-inline-elements, babel-traverse
// issue with imported components that were JSXMemberExpression
import { form } from "./export";

function ParentComponent() {
  return <form.TestComponent />;
}
  • babel-plugin-transform-es2015-modules-commonjs, babel-plugin-transform-react-inline-elements
import { Modal } from "react-bootstrap";
export default CustomModal = () => <Modal.Header>foobar</Modal.Header>;
  • babel-plugin-transform-es2015-for-of
if ( true ) {
  loop: for (let ch of []) {}
}
  • babel-core

    • #​4502 Make special case for class property initializers in shadow-functions. (@​motiz88)

    class A {
    prop1 = () => this;
    static prop2 = () => this;
    prop3 = () => arguments;
    }

  • #​4631 fix(shouldIgnore): filename normalization should be platform sensitive. (@​rozele)

    • babel-helper-remap-async-to-generator, babel-plugin-transform-async-generator-functions
  • #​4719 Fixed incorrect compilation of async iterator methods. (@​Jamesernator)

// in
class C {
  async *g() { await 1; }
}
// out
class C {
  g() { // was incorrectly outputting the method with a generator still `*g(){`
    return _asyncGenerator.wrap(function* () {
      yield _asyncGenerator.await(1);
    })();
  }
}
  • babel-plugin-check-es2015-constants, babel-plugin-transform-es2015-destructuring, babel-plugin-transform-es2015-modules-commonjs, babel-plugin-transform-es2015-parameters
// was wrapping variables in an IIFE incorrectly
for ( let i = 0, { length } = list; i < length; i++ ) {
    console.log( i + ': ' + list[i] )
}
  • babel-plugin-transform-es2015-parameters
// was producing invalid code
class Ref {
  static nextId = 0
  constructor(id = ++Ref.nextId, n = id) {
    this.id = n
  }
}

assert.equal(1, new Ref().id)
assert.equal(2, new Ref().id)
function first(...values) {
    let index = 0;
    return values[index++]; // ++ was happening twice
}

console.log(first(1, 2));
  • babel-plugin-transform-es2015-block-scoping
let x = 10;
if (1)
{
    ca: let x = 20;
}
  • babel-helper-explode-assignable-expression, babel-plugin-transform-exponentiation-operator
a[`${b++}`] **= 1;
  • #​4642 Exclude super from being assign to ref variable. (@​danez)
    • babel-plugin-transform-es2015-shorthand-properties, babel-plugin-transform-flow-comments, babel-plugin-transform-flow-strip-types
foo = {
  bar() {
    return super.baz **= 12;
  }
}
  • #​4670 Retain return types on ObjectMethods in transform-es2015-shorthand-properties. (@​danharper)
// @&#8203;flow
var obj = {
  method(a: string): number {
    return 5 + 5;
  }
};
  • babel-helper-define-map, babel-plugin-transform-es2015-classes, babel-plugin-transform-flow-comments, babel-plugin-transform-flow-strip-types
// @&#8203;flow
class C {
  m(x: number): string {
    return 'a';
  }
}
💅 Polish
  • babel-plugin-check-es2015-constants, babel-plugin-transform-es2015-destructuring, babel-plugin-transform-es2015-modules-commonjs, babel-plugin-transform-es2015-parameters
// in
const [a, b] = [1, 2];
// out
var a = 1,
    b = 2;
// was outputting an extra `index++ + 0`
function first(...values) {
  var index = 0;
  return values[index++];
}
  • babel-core
    • #​4685 Better error messaging when preset options are given without a corresponding preset. (@​kaicataldo)

We've had a few reports of users not wrapping a preset in [] when passing in options so we added an extra error message for this.

ReferenceError: [BABEL] /test.js: Unknown option: base.loose2. Check out http://babeljs.io/docs/usage/options/ for more information about options.

A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

Invalid:
  `{ presets: [{option: value}] }`
Valid:
  `{ presets: ["pluginName", {option: value}] }`

For more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.
var a: Promise<boolean>[];
// instead of
var a: Promise<bool>[];
Documentation

So that our MIT License shows up.

🏠 Internal

It's a one-time use tool (helpful after the initial release when upgrading from v5 to v6) that doesn't need to be a part of babel-cli. We'll publish it as a standalone package it someone asks for it.

  • Other
  • babel-traverse, babel-types
  • babel-cli, babel-core, babel-helper-fixtures, babel-register
  • babel-helper-transform-fixture-test-runner
  • babel-cli, babel-code-frame, babel-core, babel-generator, babel-helper-transform-fixture-test-runner, babel-preset-es2015, babel-template, babel-traverse
  • babel-cli, babel-code-frame, babel-core, babel-generator, babel-plugin-transform-es2015-modules-commonjs, babel-preset-es2015, babel-template, babel-traverse
  • babel-cli, babel-core
  • babel-cli, babel-core, babel-plugin-transform-es2015-modules-systemjs, babel-preset-es2015
  • babel-register
  • babel-cli
  • babel-core
  • babel-generator
  • babel-traverse
Commiters: 17

v6.16.0

Compare Source

v6.16.0 (2016-09-28)

If you are seeing something like:
No compatible version found: babel-types@^6.16.0
run npm view babel-types dist-tags to be sure

Babel 6.16: Happy 2nd Birthday 🎂 !

Blog post here: http://babeljs.io/blog/2016/09/28/6.16.0

👓 Spec Compliancy
  • babel-core, babel-generator, babel-helper-remap-async-to-generator, babel-helpers, babel-plugin-transform-async-generator-functions, babel-types, babel-preset-stage-2, ...

This change implements the async iteration proposal, currently at stage 2 (and pushing to stage 3 at the current TC-39 meeting). It includes the following features:

  • Transforms async generator functions (async function* g() { }) to wrapped generator functions, similar to the current async-to-generator transform.
async function* agf() {
  this;
  await 1;
  yield 2;
  return 3;
}
  • Transforms for-await statements into for loops containing yield expressions.
async function f() {
  for await (let x of y) {
    g(x);
  }
}

Example Usage

async function* genAnswers() {
  var stream = [ Promise.resolve(4), Promise.resolve(9), Promise.resolve(12) ];
  var total = 0;
  for await (let val of stream) {
    total += await val;
    yield total;
  }
}

function forEach(ai, fn) {
  return ai.next().then(function (r) {
    if (!r.done) {
      fn(r);
      return forEach(ai, fn);
    }
  });
}

var output = 0;
return forEach(genAnswers(), function(val) { output += val.value })
.then(function () {
  assert.equal(output, 42);
});
  • babel-core, babel-generator, babel-plugin-transform-class-properties, babel-template, babel-traverse, babel-types

Parser support was added in babylon@6.11.0 with babel/babylon#​121

// Example
class Foo {
  [x]
  ['y']
}

class Bar {
  [p]
  [m] () {}
}

Parser support was added in babylon@6.10.0 with babel/babylon#​104

// Example
var a : {| x: number, y: string |} = { x: 0, y: 'foo' };
🚀 New Feature
  • babel-core, babel-generator

Babel will now also take the options: parserOpts and generatorOpts (as objects).

parserOpts will pass all properties down to the default babylon parser. You can also pass a parser option to substitute for a different parser.

This will allow passing down any of babylon's options:

{
  "parserOpts": {
    "allowImportExportEverywhere": true,
    "allowReturnOutsideFunction": true,
    "sourceType": "module",
    "plugins": ["flow"]
  }
}

Another use case (the main reason for doing this), is to be able to use recast with Babel.

{
  "parserOpts": {
    "parser": "recast"
  },
  "generatorOpts": {
    "generator": "recast"
  }
}
  • babel-core
{
  presets: ["@&#8203;org/babel-preset-name"], // actual package
  presets: ["@&#8203;org/name"] // shorthand name
}
  • babel-plugin-transform-object-rest-spread

useBuiltIns - Do not use Babel's helper's and just transform to use the built-in method (Disabled by default).

{
  "plugins": [
    ["transform-object-rest-spread", { "useBuiltIns": true }]
  ]
}

// source
z = { x, ...y };
// compiled
z = Object.assign({ x }, y);
  • babel-code-frame
    • #​4561 babel-code-frame: add options for linesBefore, linesAfter. (@​hzoo)

babel-code-frame is a standalone package that we use in Babel when reporting errors.

Now there is an option to specify the number of lines above and below the error

  1 | class Foo {
> 2 |   constructor()
    |                ^
  3 | }
  • babel-core, babel-preset-es2015, babel-preset-es2016, babel-preset-es2017, babel-preset-latest, babel-preset-react, babel-preset-stage-0, babel-preset-stage-1, babel-preset-stage-2, babel-preset-stage-3

We previously made presets with commonjs exports

module.exports = {
  plugins: [
    require("babel-plugin-syntax-trailing-function-commas")
  ]
};

Now you can use export default as well

import transformExponentiationOperator from "babel-plugin-transform-exponentiation-operator";
export default {
  plugins: [
    transformExponentiationOperator
  ]
};
🐛 Bug Fix
  • babel-helpers, babel-plugin-transform-es2015-typeof-symbol
// `typeof Symbol.prototype` should be 'object'
typeof Symbol.prototype === 'object'

Fix an issue with defaults not being overidden. This was causing options like comments: false not to work correctly.

// wasn't exporting correctly before
export default ({ onClick }) => {
  return <div onClick={() => onClick()}></div>;
}
export default class {};
// wasn't correctly transforming to
exports["default"] = class {}
// with the es3-tranforms
  • babel-plugin-transform-flow-strip-types, babel-types
// <X> wasn't stripped out
const find = <X> (f: (x:X) => X, xs: Array<X>): ?X => (
  xs.reduce(((b, x) => b ? b : f(x) ? x : null), null)
)

We noticed that we can not make this optimizations if there are function calls or member expressions on the right hand side of the assignment since the function call or the member expression (which might be a getter with side-effect) could potentially change the variables we are assigning to.

[x, y] = [a(), obj.x];
// was tranforming to
x = a();
y = obj.x;
// now transforms to 
var _ref = [a(), obj.x];
x = _ref[0];
y = _ref[1];
  • babel-types
💅 Polish

Before

screen shot 2016-09-27 at 11 12 47 am

After

screen shot 2016-09-27 at 3 50 02 pm - `babel-core` - [#​4517](https://togithub.com/babel/babel/pull/4517) If loading a preset fails, show its name/path (#​4506). ([@​motiz88](https://togithub.com/motiz88)) - `babel-helper-replace-supers` - [#​4520](https://togithub.com/babel/babel/pull/4520) Remove unused `thisReference` argument to `getSuperProperty`. ([@​eventualbuddha](https://togithub.com/eventualbuddha)) - `babel-generator` - [#​4478](https://togithub.com/babel/babel/pull/4478) babel-generator: Ensure ASCII-safe output for string literals. ([@​mathiasbynens](https://togithub.com/mathiasbynens)) - `babel-core`, `babel-plugin-transform-es2015-arrow-functions`, `babel-plugin-transform-es2015-destructuring`, `babel-plugin-transform-es2015-modules-commonjs`, `babel-plugin-transform-es2015-parameters` - [#​4515](https://togithub.com/babel/babel/pull/4515) Flip default parameter template. ([@​jridgewell](https://togithub.com/jridgewell)) - `babel-core`, `babel-helpers` - [#​3653](https://togithub.com/babel/babel/pull/3653) Removed unnecessary 'return' statements. ([@​ksjun](https://togithub.com/ksjun)) ##### 🏠 Internal

Cleanup tests, remove various unused dependencies, do not run CI with only readme changes.

  • babel-plugin-transform-es2015-modules-amd, babel-plugin-transform-es2015-modules-commonjs, babel-plugin-transform-es2015-modules-umd
  • babel-generator, babel-plugin-transform-es2015-modules-amd, babel-plugin-transform-es2015-modules-commonjs, babel-plugin-transform-es2015-modules-systemjs, babel-plugin-transform-es2015-modules-umd, babel-plugin-transform-flow-strip-types
  • babel-plugin-transform-es2015-function-name
  • babel-plugin-transform-es2015-parameters, babel-traverse
    • #​4519 Replace phabricator tickets with github ones in code comments. (@​danez)
  • babel-polyfill
  • babel-preset-es2015
  • babel-plugin-transform-regenerator
  • babel-code-frame
  • babel-helper-transform-fixture-test-runner
  • Other
Commiters: 20

First PRs!

v6.14.0

Compare Source

v6.14.0 (2016-08-23) TAKE ME TO FLAVOR TOWN

Lots of stuff in this release!

npm install babel-preset-es2017 --save-dev
// .babelrc
{ "presets": ["es2017"] }
  • #​3625, #​3673 A new preset called latest that transforms ES2015+ (currently ES2015, ES2016, ES2017). You can also pass options down to the es2015 preset.

We also will be working on getting a target/env (autoprefixer) preset soon.

npm install babel-preset-latest --save-dev
// .babelrc
{ "presets": ["latest"] }
// with options
{ "presets": [
  ["latest", {
    "es2015": {
      "modules": false 
    }
  }]
] }

spec for arrow functions adds a runtime check to make sure arrow functions are not instantiated (since they transform into normal functions).
spec for template literals wraps all expressions in String rather than simple string concatenation.

// .babelrc
{
  "presets": [
    ["es2015", { "spec": true }]
  ]
}
  • #​3659 @​kittens added an optional wrapPluginVisitorMethod callback to transform to allow for performance tracking/introspection of plugins. More docs will be added on the website soon.
  • #​3658 sourcemaps will also now have a names field for identifiers to allow debuggers to do re-aliasing of mangled identifiers.
  • #​3518 For spec compilancy, we now will throw on a file with multiple export default.
Notable Bug Fixes
  • #​3527 Fix class inheritance in IE <=10 without loose mode.
  • #​3644 Support the ignore config option in .babelrc.
  • #​3655 Flow-only class props were not be stripped without transform-class-properties.
Guy Fieri
Commiters: 17

It's also a lot folk's first PR (or first code PR)!

New Feature
  • babel-preset-es2015
  • babel-preset-latest
  • babel-preset-es2017
  • babel-core, babel-traverse
    • #​3659 Add wrapPluginVisitorMethod option to allow introspection and metrics tracking of plugins. (@​kittens)
  • babel-cli, babel-core, babel-generator, babel-plugin-transform-regenerator, babel-template, babel-traverse
  • babel-generator, babel-types
Spec Compliancy
  • babel-plugin-transform-es2015-modules-amd, babel-plugin-transform-es2015-modules-commonjs, babel-plugin-transform-es2015-modules-umd
Bug Fix
  • babel-core, babel-helper-replace-supers, babel-plugin-transform-class-properties, babel-plugin-transform-es2015-classes, babel-plugin-transform-es2015-function-name, babel-plugin-transform-es2015-object-super, babel-plugin-transform-es2015-parameters
  • babel-cli
  • babel-plugin-transform-es2015-modules-systemjs
  • babel-generator
    • #​3663 Use arrow syntax for ObjectTypeProperty FunctionTypeAnnotations. (@​zpao)
  • babel-register
    • #​3608 Set sourceRoot in babel-register transform to fix p

Renovate configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Enabled.

♻️ Rebasing: Whenever PR becomes conflicted, or if you modify the PR title to begin with "rebase!".

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@mesosphere-web mesosphere-web merged commit 40735ff into master Jan 11, 2019
@mesosphere-web mesosphere-web deleted the renovate/babel-preset-es2015-6.x branch January 11, 2019 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant