diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ca6d9e2ee..1581eed8da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,191 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog. + +## v6.20.0 (2016-12-08) + +> If you missed it, please check out our latest blog post: [The State of Babel](http://babeljs.io/blog/2016/12/07/the-state-of-babel). Talks about where we can possibly move forward as a project and how you can help! + +- 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](https://github.com/facebook/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](https://github.com/kittens) 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 +* `babel-traverse` + * [#4876](https://github.com/babel/babel/pull/4876) Add `getBindingIdentifierPaths`/`getOuterBindingIdentifierPaths`. ([@boopathi](https://github.com/boopathi)) + +Returns `Array` rather than `Array`. + +- `path.getBindingIdentifierPaths()` +- `path.getOuterBindingIdentifierPaths()` + +```js +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(); + } +}); +``` + +* `babel-code-frame` + * [#4913](https://github.com/babel/babel/pull/4913) Add `forceColor` option to `babel-code-frame`. ([@Timer](https://github.com/Timer)) + +> 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 + +```js +const result = codeFrame(rawLines, lineNumber, colNumber, { + forceColor: true +}); +``` + +#### :bug: Bug Fix +* `babel-plugin-transform-es2015-block-scoping` + * [#4880](https://github.com/babel/babel/pull/4880) Add (and fix) failing test of function parameter bindings in a catch block. ([@benjamn](https://github.com/benjamn)) + +**In** + +```js +try { + foo(); +} catch (x) { + function harmless(x) { + return x; + } +} +``` + +**Correct Out** + +```js +try { + foo(); +} catch (x) { + var harmless = function (x) { + return x; + }; +} +``` + +* `babel-helper-remap-async-to-generator`, `babel-plugin-transform-async-generator-functions`, `babel-plugin-transform-async-to-generator` + * [#4901](https://github.com/babel/babel/pull/4901) Only base async fn arity on non-default/non-rest params - Closes [#4891](https://github.com/babel/babel/issues/4891). ([@loganfsmyth](https://github.com/loganfsmyth)) + +```js +// both length's should be 0 +const foo = (...args) => { } +console.log(foo.length) // 0 +const asyncFoo = async (...args) => { } +console.log(asyncFoo.length) // 0 +``` + +* `babel-generator`, `babel-types` + * [#4945](https://github.com/babel/babel/pull/4945) Add `babel-generator` support for `Import`. ([@TheLarkInn](https://github.com/TheLarkInn)) + +> Relevant for webpack 2 support of `Import`. Just allows Babel to print it correctly. + +```js +import("module.js"); +``` + +* `babel-plugin-transform-object-rest-spread` + * [#4883](https://github.com/babel/babel/pull/4883) Fix for object-rest with parameters destructuring nested rest. ([@christophehurpeau](https://github.com/christophehurpeau)) + +```js +function a5({a3, b2: { ba1, ...ba2 }, ...c3}) {} +``` +* `babel-traverse` + * [#4875](https://github.com/babel/babel/pull/4875) Fix `path.evaluate` for references before declarations. ([@boopathi](https://github.com/boopathi)) + +```js +// should deopt if ids are referenced before the bindings +var a = b + 2; var b = 2 + 2; +``` + +* `babel-core`, `babel-generator`, `babel-helper-transform-fixture-test-runner`, `babel-plugin-transform-object-rest-spread` + * [#4858](https://github.com/babel/babel/pull/4858) Fix bug + Generate test fixtures if no expected.js. ([@hzoo](https://github.com/hzoo)) +* `babel-types` + * [#4853](https://github.com/babel/babel/pull/4853) Preserve null in `babel-types` `t.clone` and `t.deepClone` ([@NTillmann](https://github.com/NTillmann)) + +#### :nail_care: Polish +* `babel-generator` + * [#4862](https://github.com/babel/babel/pull/4862) Fix identation with empty leading `ObjectTypeProperty`. ([@existentialism](https://github.com/existentialism)) + +#### :memo: Documentation +* `Various Packages` + * [#4938](https://github.com/babel/babel/pull/4938) Update babel-core documentation. ([@xtuc](https://github.com/xtuc)) + * [#4939](https://github.com/babel/babel/pull/4939) Add example to transform-react-display-name docs. ([@existentialism](https://github.com/existentialism)) + * [#4931](https://github.com/babel/babel/pull/4931) Update plugins READMEs from babel.github.io [skip ci]. ([@raspo](https://github.com/raspo)) + * [#4926](https://github.com/babel/babel/pull/4926) Update transform-es2015 READMEs from babel.github.io [skip ci]. ([@existentialism](https://github.com/existentialism)) + * [#4930](https://github.com/babel/babel/pull/4930) Update transform-object-rest-spread's README from babel.github.io [skip ci]. ([@lukyth](https://github.com/lukyth)) + * [#4929](https://github.com/babel/babel/pull/4929) Update transform-object-assign's README from babel.github.io [skip ci]. ([@lukyth](https://github.com/lukyth)) + * [#4928](https://github.com/babel/babel/pull/4928) mention [skip ci] in PR template. ([@hzoo](https://github.com/hzoo)) + * [#4925](https://github.com/babel/babel/pull/4925) Tweak example in transform-jsx-source README [skip ci]. ([@existentialism](https://github.com/existentialism)) + * [#4919](https://github.com/babel/babel/pull/4919) Update async READMEs from babel.github.io [skip-ci]. ([@existentialism](https://github.com/existentialism)) + * [#4917](https://github.com/babel/babel/pull/4917) Fix some React transform README issues [skip-ci]. ([@existentialism](https://github.com/existentialism)) + * [#4903](https://github.com/babel/babel/pull/4903) Update React transform READMEs from babel.github.io [skip ci]. ([@existentialism](https://github.com/existentialism)) + * [#4884](https://github.com/babel/babel/pull/4884) Readme updates from babel.github.io [skip ci]. ([@hzoo](https://github.com/hzoo)) + +#### :house: Internal +* `babel-plugin-transform-regenerator` + * [#4881](https://github.com/babel/babel/pull/4881) Use `regenerator-transform` to implement `babel-plugin-transform-regenerator`. ([@benjamn](https://github.com/benjamn)) +* `babel-traverse` + * [#4934](https://github.com/babel/babel/pull/4934) Hoist `generateDeclaredUidIdentifier` helper function. ([@jridgewell](https://github.com/jridgewell)) +* `babel-polyfill` + * [#4966](https://github.com/babel/babel/pull/4966) update `regenerator-runtime` in `babel-polyfill`. ([@zloirock](https://github.com/zloirock)) +* `babel-runtime` + * [#4877](https://github.com/babel/babel/pull/4877) Upgrade `regenerator-runtime` to version 0.10.0. ([@benjamn](https://github.com/benjamn)) +* `babel-plugin-syntax-trailing-function-commas` + * [#4936](https://github.com/babel/babel/pull/4936) Add `test` to `babel-plugin-syntax-trailing-function-commas` `.npmignore` ([@wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg)) +* `babel-helper-fixtures` + * [#4907](https://github.com/babel/babel/pull/4907) Remove `shouldIgnore` check. ([@danez](https://github.com/danez)) +* `babel-core`, `babel-traverse` + * [#4897](https://github.com/babel/babel/pull/4897) Fix eslint. ([@danez](https://github.com/danez)) +* `babel-generator` + * [#4965](https://github.com/babel/babel/pull/4965) Raise limit on code size before compacting ([@existentialism](https://github.com/existentialism)) + +#### Committers: 17 +- Ben Newman ([benjamn](https://github.com/benjamn)) +- Benjamin E. Coe ([bcoe](https://github.com/bcoe)) +- Boopathi Rajaa ([boopathi](https://github.com/boopathi)) +- Brian Ng ([existentialism](https://github.com/existentialism)) +- Christophe Hurpeau ([christophehurpeau](https://github.com/christophehurpeau)) +- Daniel Tschinder ([danez](https://github.com/danez)) +- Denis Pushkarev ([zloirock](https://github.com/zloirock)) +- Henry Zhu ([hzoo](https://github.com/hzoo)) +- Joe Haddad ([Timer](https://github.com/Timer)) +- Justin Ridgewell ([jridgewell](https://github.com/jridgewell)) +- Kanitkorn Sujautra ([lukyth](https://github.com/lukyth)) +- Logan Smyth ([loganfsmyth](https://github.com/loganfsmyth)) +- Nikolai Tillmann ([NTillmann](https://github.com/NTillmann)) +- Sean Larkin ([TheLarkInn](https://github.com/TheLarkInn)) +- Sven SAULEAU ([xtuc](https://github.com/xtuc)) +- Tommaso ([raspo](https://github.com/raspo)) +- [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) + ## v6.19.0 (2016-11-16) #### :rocket: New Feature diff --git a/packages/babel-core/README.md b/packages/babel-core/README.md index f73054b423..3db09945ec 100644 --- a/packages/babel-core/README.md +++ b/packages/babel-core/README.md @@ -108,7 +108,7 @@ Following is a table of the options you can use: | `code` | `true` | Enable code generation | | `no-babelrc` | [CLI flag](http://babeljs.io/docs/usage/cli/#ignoring-babelrc) | Specify whether or not to use .babelrc and .babelignore files. Only available when using the CLI. | | `ast` | `true` | Include the AST in the returned object | -| `compact` | `"auto"` | Do not include superfluous whitespace characters and line terminators. When set to `"auto"` compact is set to `true` on input sizes of >100KB. | +| `compact` | `"auto"` | Do not include superfluous whitespace characters and line terminators. When set to `"auto"` compact is set to `true` on input sizes of >500KB. | | `minified` | `false` | Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping `()` from `new` when safe) | | `comments` | `true` | Output comments in generated output. | | `shouldPrintComment` | `null` | An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE:** This overrides the `comment` option when used. | diff --git a/packages/babel-plugin-transform-regenerator/.npmignore b/packages/babel-plugin-transform-regenerator/.npmignore index a3dd02aae4..31852902b1 100644 --- a/packages/babel-plugin-transform-regenerator/.npmignore +++ b/packages/babel-plugin-transform-regenerator/.npmignore @@ -1,4 +1,4 @@ -/node_modules -/test -/.test -/src +node_modules +*.log +src +test diff --git a/packages/babel-plugin-transform-regenerator/LICENSE b/packages/babel-plugin-transform-regenerator/LICENSE deleted file mode 100644 index 187bfe283d..0000000000 --- a/packages/babel-plugin-transform-regenerator/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -BSD License - -For "regenerator" software - -Copyright (c) 2014, Facebook, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/babel-plugin-transform-regenerator/PATENTS b/packages/babel-plugin-transform-regenerator/PATENTS deleted file mode 100644 index a2bd67d0db..0000000000 --- a/packages/babel-plugin-transform-regenerator/PATENTS +++ /dev/null @@ -1,33 +0,0 @@ -Additional Grant of Patent Rights Version 2 - -"Software" means the Regenerator software distributed by Facebook, Inc. - -Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software -("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable -(subject to the termination provision below) license under any Necessary -Claims, to make, have made, use, sell, offer to sell, import, and otherwise -transfer the Software. For avoidance of doubt, no license is granted under -Facebook's rights in any patent claims that are infringed by (i) modifications -to the Software made by you or any third party or (ii) the Software in -combination with any software or other technology. - -The license granted hereunder will terminate, automatically and without notice, -if you (or any of your subsidiaries, corporate affiliates or agents) initiate -directly or indirectly, or take a direct financial interest in, any Patent -Assertion: (i) against Facebook or any of its subsidiaries or corporate -affiliates, (ii) against any party if such Patent Assertion arises in whole or -in part from any software, technology, product or service of Facebook or any of -its subsidiaries or corporate affiliates, or (iii) against any party relating -to the Software. Notwithstanding the foregoing, if Facebook or any of its -subsidiaries or corporate affiliates files a lawsuit alleging patent -infringement against you in the first instance, and you respond by filing a -patent infringement counterclaim in that lawsuit against that party that is -unrelated to the Software, the license granted hereunder will not terminate -under section (i) of this paragraph due to such counterclaim. - -A "Necessary Claim" is a claim of a patent owned by Facebook that is -necessarily infringed by the Software standing alone. - -A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, -or contributory infringement or inducement to infringe any patent, including a -cross-claim or counterclaim. diff --git a/packages/babel-plugin-transform-regenerator/package.json b/packages/babel-plugin-transform-regenerator/package.json index e884de7694..b4c6dbff71 100644 --- a/packages/babel-plugin-transform-regenerator/package.json +++ b/packages/babel-plugin-transform-regenerator/package.json @@ -9,7 +9,7 @@ "dependencies": { "regenerator-transform": "0.9.8" }, - "license": "BSD", + "license": "MIT", "devDependencies": { "babel-helper-plugin-test-runner": "^6.8.0" }