dropsintheocean / dih-webapp

Webapp for the volunteer management system
http://app.drapenihavet.no
0 stars 0 forks source link

[Doppins] Upgrade dependency babel-core to ~6.23.1 #312

Closed doppins-bot closed 7 years ago

doppins-bot commented 7 years ago

Hi!

A new version was just released of babel-core, so Doppins has upgraded your project's dependency ranges.

Make sure that it doesn't break anything, and happy merging! :shipit:


Upgraded babel-core from ~6.10.4 to ~6.23.1

Changelog:

Version 6.23.0

6.23.0 (2017-02-13)

:rocket: New Feature

:bug: Bug Fix

:memo: Documentation

:house: Internal

Committers: 20

Version 6.22.1

6.22.1 (2017-01-19)

:bug: Bug Fix

Temporary fix with babel-traverse via #5019 (https://github.com/babel/babel/pull/5019) for transform-react-constant-elements.

Version 6.22.0

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](https://github.com/babel/babel/milestone/9), the [wiki (https://github.com/babel/babel/wiki/Babel-7) 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 (https://github.com/babel/babylon/releases/tag/v6.15.0).

import {
  someValue,
  type someType,
  typeof someOtherValue,
} from "blah";

:rocket: New Feature

:bug: Bug Fix

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]

Input

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

Output

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

:nail_care: Polish

:memo: Documentation

:house: Internal

Committers: 23, First PRs: 10

Version 6.21.0

6.21.0 (2016-12-16)

Mostly a lot of bug fixes + exposing rawMapping in babel-generator for easy source map use.

Thanks to davidaurelio, appden, and abouthiroppy for their first PRs!

:rocket: New Feature

Exposes raw mappings when source map generation is enabled. To avoid the cost of source map generation for consumers of the raw mappings only, .map is changed to a getter that generates the source map lazily on first access.

Raw mappings can be useful for post-processing source maps more efficiently by avoiding one decoding/encoding cycle of the b64 vlq mappings. This will be used in the React Native packager.

let generator = require("babel-generator");
let generated = generator(ast, { sourceMaps: true }, sources);

// generated.rawMappings
[
  {
    name: undefined,
    generated: { line: 1, column: 0 },
    source: "inline",
    original: { line: 1, column: 0 }
  },
  ...
]

:bug: Bug Fix

Works with generator, transform-flow-comments, flow-strip-types.

function foo(numVal: number = 2) {}
let blockStatement = t.blockStatement(
  [],
  [t.directive(t.directiveLiteral("use strict"))]
);

Will still error with Spread children are not supported.

<div>{...this.props.children}</div>;

When multiple declarators are present in a declaration, we want to insert the constant element inside the declaration rather than placing it before because it may rely on a declarator inside that same declaration.

function render() {
  const bar = "bar", renderFoo = () => <foo bar={bar} baz={baz} />, baz = "baz";

  return renderFoo();
}

When block scoped variables caused the block to be wrapped in a closure, the variable bindings remained in parent function scope, which caused the JSX element to be hoisted out of the closure.

function render(flag) {
  if (flag) {
    let bar = "bar";

    [].map(() => bar);

    return <foo bar={bar} />;
  }

  return null;
}

Was erroring if the rest parameter shared the same name as a default identifier for a param, needed to be deopt'd.

const a = 1;
function rest(b = a, ...a) {
  assert.equal(b, 1);
}
rest(undefined, 2)
myLabel: //woops
for (let a of b) {
  continue myLabel;
}

:memo: Documentation

:house: Internal

Allows running require() in exec.js tests like for babel/babel-preset-env#95 (https://github.com/babel/babel-preset-env/pull/95)

Committers: 7

Version 6.20.0

v6.20.0 (2016-12-08)

If you missed it, please check out our latest blog post: The State of Babel. It talks about where we can possibly move forward as a project and how you can help!

Also just wanted to reiterate that Babel is a community-lead project that is run by volunteers - many of us came into the project to learn about JavaScript rather than because we knew it already. Let's work together to make it sustainable!

  • Maybe fix that crazy babel-generator deopt message you've all probably seen!
  • Change to babel-code-frame for facebookincubator/create-react-app#1101 (https://github.com/facebookincubator/create-react-app/issues/1101)
  • Change to babel-generator for webpack/webpack#3413 (https://github.com/webpack/webpack/pull/3413)
  • Move implementation of Regenerator back to the original repo.

You've probably seen this more than a few times and had no idea what it meant...

[BABEL] Note: The code generator has deoptimised the styling of "app.js" as it exceeds the max of "100KB".

Generating code used to get really slow as file size increased. We've mostly fixed that, but we still automatically fall back to compact output on large files. We're going to bump the limit to 500KB and if there aren't issues just remove it.


Ben Newman, @benjamn](https://github.com/benjamn): wrote Regenerator while at Facebook. It used a bunch of other libraries such as ast-types but has now been rewritten as a standalone Babel plugin (also thanks to Sebastian's previous work in [facebook/regenerator#222 (https://github.com/facebook/regenerator/pull/222)). We're also moving the implementation of Regenerator back into the original repository since Ben is the creator/maintainer.

:rocket: New Feature

Returns Array<Path> rather than Array<Node>.

traverse(parse(`
  var a = 1, {b} = c, [d] = e, function f() {};
`), {
  VariableDeclaration(path) {
    let nodes = path.getBindingIdentifiers(); // a, d, b
    let paths = path.getBindingIdentifierPaths();
  },
  FunctionDeclaration(path) {
    let outerNodes = path.getOuterBindingIdentifiers(); // f
    let outerPaths = path.getOuterBindingIdentifierPaths();
  }
});

Forcibly syntax highlight the code as JavaScript (for non-terminals); overrides highlightCode. For facebookincubator/create-react-app#1101 (https://github.com/facebookincubator/create-react-app/issues/1101)

Usage

const result = codeFrame(rawLines, lineNumber, colNumber, {
  forceColor: true
});

:bug: Bug Fix

In

try {
  foo();
} catch (x) {
  function harmless(x) {
    return x;
  }
}

Correct Out

try {
  foo();
} catch (x) {
  var harmless = function (x) {
    return x;
  };
}
// both length's should be 0
const foo = (...args) => { }
console.log(foo.length)  // 0
const asyncFoo = async (...args) => { }
console.log(asyncFoo.length)  // 0

Relevant for webpack 2 support of Import. Just allows Babel to print it correctly.

import("module.js");
function a5({a3, b2: { ba1, ...ba2 }, ...c3}) {}
// should deopt if ids are referenced before the bindings
var a = b + 2; var b = 2 + 2;

:nail_care: Polish

:memo: Documentation

:house: Internal

Committers: 17

Version 6.18.2

v6.18.2 (2016-11-01)

Weird publishing issue with v6.18.1, same release.

:bug: Bug Fix

The error message was actually invalid!

Invalid:
  { "presets": [{ "option": "value" }] }
Valid:
  {
    "presets": [
      ["presetName", { "option": "value" }] // the preset should be wrapped in `[ ]`
    ]
  }

:house: Internal

Commiters: 4

Version 6.18.0

v6.18.0 (2016-10-24)

:rocket: New Feature

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 };
// in
['a' + 'b']: 10 * 20, 'z': [1, 2, 3]}
// out
{ab: 200, z: [1, 2, 3]}

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']
  }
}

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](https://github.com/facebook/flow/commit/c603505583993aa953904005f91c350f4b65d6bd) and in babylon [here (https://github.com/babel/babylon/pull/171).

function f<T>(x: empty): T {
  return x;
}
f(); // nothing to pass...

Track LabeledStatement separately (not part of bindings).

:bug: Bug Fix

Will give examples of code that was fixed below

  • babel-plugin-transform-react-inline-elements, babel-traverse
  • #4765](https://github.com/babel/babel/pull/4765) Don't treat JSXIdentifier in JSXMemberExpression as HTML tag. Closes [#4027 (https://github.com/babel/babel/issues/4027). (@DrewML)
// issue with imported components that were JSXMemberExpression
import { form } from "./export";

function ParentComponent() {
  return <form.TestComponent />;
}
import { Modal } from "react-bootstrap";
export default CustomModal = () => <Modal.Header>foobar</Modal.Header>;
if ( true ) {
  loop: for (let ch of []) {}
}
class A {
  prop1 = () => this;
  static prop2 = () => this;
  prop3 = () => arguments;
}
// 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);
    })();
  }
}
// was wrapping variables in an IIFE incorrectly
for ( let i = 0, { length } = list; i < length; i++ ) {
    console.log( i + ': ' + list[i] )
}
// 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));
let x = 10;
if (1)
{
    ca: let x = 20;
}
a[`${b++}`] **= 1;
foo = {
  bar() {
    return super.baz **= 12;
  }
}
// `@flow`
var obj = {
  method(a: string): number {
    return 5 + 5;
  }
};
// `@flow`
class C {
  m(x: number): string {
    return 'a';
  }
}

:nail_care: Polish

// 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++];
}

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.

:house: 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.

Commiters: 17

Version 6.17.0

v6.17.0 (2016-10-01)

If you have questions please join our slack: https://slack.babeljs.io

:eyeglasses: Spec Compliancy

https://github.com/tc39/proposals/commit/96f8d79dac33575e24f6ac3ec2082efe75d519ba

Specification repo: https://github.com/tc39/proposal-async-iteration

Asynchronous Iteration was already added in 6.16.0](http://babeljs.io/blog/2016/09/28/6.16.0#spec-compliancy) under stage-2 but it was moved to stage-3 at the [latest TC-39 meeting (https://github.com/tc39/agendas/blob/master/2016/09.md#agenda-for-the-54th-meeting-of-ecma-tc39).

// async generator syntax
async function* agf() {}
// for-await statement
async function f() {
  for await (let x of y) {
    g(x);
  }
}

To use it as a standalone plugin:

{
  "plugins": ["transform-async-generator-functions"]
}

With the stage-3 preset (or below):

{
  "presets": ["stage-3"]
}

Similarly, object-rest-spread is now also at stage-3.

https://twitter.com/sebmarkbage/status/781564713750573056 https://github.com/tc39/proposals/commit/142ac3ce7f3f56989800260f029b76afe4a02e57

// Rest properties
let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
console.log(x); // 1
console.log(y); // 2
console.log(z); // { a: 3, b: 4 }

// Spread properties
let n = { x, y, ...z };
console.log(n); // { x: 1, y: 2, a: 3, b: 4 }

To use it as a standalone plugin:

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

With the stage-3 preset (or below):

{
  "presets": ["stage-3"]
}

:rocket: New Feature

References:

Adds a retainFunctionParens to babel-generator. This option will retain the parentheses around an IIFE.

// parens are stripped without the option
__d('x', (function () {}));

:bug: Bug Fix

First PR!

Version 6.16.0

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

:eyeglasses: Spec Compliancy

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:


async function* agf() {
  this;
  await 1;
  yield 2;
  return 3;
}
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);
});

Parser support was added in babylon@6.11.0](https://github.com/babel/babylon/releases/tag/v6.11.0) with [babel/babylon#121 (https://github.com/babel/babylon/pull/121)

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

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

Parser support was added in babylon@6.10.0](https://github.com/babel/babylon/releases/tag/v6.10.0) with [babel/babylon#104 (https://github.com/babel/babylon/pull/104)

// Example
var a : {| x: number, y: string |} = { x: 0, y: 'foo' };

:rocket: New Feature

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"
  }
}
{
  presets: ["`@org`/babel-preset-name"], // actual package
  presets: ["`@org`/name"] // shorthand name
}

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 is a standalone package that we use in Babel when reporting errors.

Now there is an option (https://github.com/babel/babel/blob/master/packages/babel-code-frame/README.md#options) to specify the number of lines above and below the error

  1 | class Foo {
> 2 |   constructor()
    |                ^
  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: Bug Fix

// `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
// <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];

:nail_care: Polish

Before

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

After

screen shot 2016-09-27 at 3 50 02 pm

:house: Internal

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

Commiters: 20

First PRs!

Version 6.14.0

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"] }

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 }]
  ]
}

Notable Bug Fixes

Guy Fieri

Commiters: 17

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

New Feature

Spec Compliancy

Bug Fix

Documentation

Internal

Version 6.13.2

v6.13.2 (2016-08-05)

Backwards compat is hard

Hi again, just fixing up logic from the backwards-compatibility fix which broke options in presets. Also added more tests and will update Babel to use the new preset options after this release.

Bug Fix

Version 6.13.1

v6.13.1 (2016-08-04)

We had a regression in our new babel-preset-es2015@6.13.0 that made it unexpectedly backward-incompatible. This release introduces a new alternative plugin-options approach that is uglier but supports backward-compatiblity. Ideally new plugins would use the new module.exports = function(babel, options){ } approach and simple skip supporting babel-core@<6.13.x.

Bug Fix

Version 6.13.0

v6.13.0 (2016-08-04)

If you are getting an error like "Invalid options type for " then check that you have an updated version of babel-core/cli/etc. If you are using greenkeeper, it will fail because it will only update the preset and not the other packages.

Since the last release we've created https://github.com/babel/notes to track discussions on our slack and features/changes that could be added - definetely check it out if you're interested in Babel's development!

Please join #discussion on slack if you have questions and #development for dev

Some small but very important additions in this release:

Preset options (babel/notes (https://github.com/babel/notes/blob/master/2016-07/july-31.md#preset-options-pr-3331))

Initially, presets were supposed to be one-off sets of plugins that didn't have any configuration. If you wanted to do something different you would make your own presets. There are > 600 presets on npm now. We want to give users more flexibility in certain cases: like when you want to pass the same option to multiple presets or to remove a default plugin.

loose and modules options for babel-preset-es2015 (#3331](https://github.com/babel/babel/pull/3331), [#3627 (https://github.com/babel/babel/pull/3627))

This has been rather annoying. Having to install babel-preset-es2015-loose-native-modules seems rather crazy when it could be an option.

With #3627 (https://github.com/babel/babel/pull/3627), you can pass 2 options in:

// for loose and native modules
{
  presets: [
    ["es2015", { "loose": true, "modules": false }]
  ]
}

Updates to babel-preset-stage-2

Coming Up

New Feature

Bug Fix

Polish

Internal

Commiters: 7

Version 6.11.4

v6.11.4 (2016-07-20)

Please join #discussion on slack if you have questions and #development for dev

FYI: Babel releases don't mean each package updates. If a package isn't changed it keeps it's version number. The changelog entries below tell you what specific packages have changed. You shouldn't have to do anything in most cases other than npm install again.

In this release (among other things) are some more optimizations for babel-generator (#3584](https://github.com/babel/babel/pull/3584), [#3580 (https://github.com/babel/babel/pull/3580)) as well as refactors.

@jamestalmage did some awesome clean for OptionsManager and some tests which may help future improvements to babel-register performance.

Bug Fix

Polish

Commiters: 6