diff --git a/.circleci/config.yml b/.circleci/config.yml
index 7fe155f9f564..cb085191b714 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -34,7 +34,7 @@ jobs:
build:
working_directory: ~/babel
docker:
- - image: circleci/node:10
+ - image: circleci/node:12
steps:
- checkout
- restore-cache: *restore-yarn-cache
@@ -42,7 +42,7 @@ jobs:
- run: yarn --version
- run: make test-ci-coverage
# Builds babel-standalone with the regular Babel config
- - run: make build
+ - run: IS_PUBLISH=true make build
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
# data for a JS file that's several megabytes large is bound to fail. Here,
# we just run the babel-standalone test separately.
diff --git a/.editorconfig b/.editorconfig
index ba48528bbf4b..e86321667115 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -6,9 +6,12 @@ charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
-[*.{js,json}]
+[*.{js,json,ts,tsx}]
indent_style = space
indent_size = 2
+[Makefile]
+indent_style = tab
+
[*.{md,markdown}]
trim_trailing_whitespace = false
diff --git a/.eslintignore b/.eslintignore
index 18e74eafba27..092fbbb802cd 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -5,8 +5,8 @@ package.json
lerna.json
packages/babel-runtime
!packages/babel-plugin-transform-runtime/scripts
-!packages/babel-runtime-corejs2/core-js.js
packages/babel-runtime-corejs2
+packages/babel-runtime-corejs3
packages/*/node_modules
packages/*/lib
packages/*/dist
diff --git a/.eslintrc.json b/.eslintrc.json
index d26b40aa6c5d..a59dc0d9e2dd 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,7 +1,7 @@
{
"root": true,
+ "plugins": ["prettier", "@babel/development", "import"],
"extends": "babel",
- "plugins": ["local-rules", "prettier"],
"rules": {
"prettier/prettier": "error"
},
@@ -12,8 +12,10 @@
{
"files": ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"],
"rules": {
- "local-rules/no-undefined-identifier": "error",
- "local-rules/no-deprecated-clone": "error"
+ "@babel/development/no-undefined-identifier": "error",
+ "@babel/development/no-deprecated-clone": "error",
+ "import/no-extraneous-dependencies": "error",
+ "guard-for-in": "error"
}
},
{
@@ -26,6 +28,14 @@
"env": {
"jest": true
}
+ },
+ {
+ "files": ["packages/babel-plugin-*/src/index.js"],
+ "excludedFiles": ["packages/babel-plugin-transform-regenerator/**/*.js"],
+ "rules": {
+ "@babel/development/plugin-name": "error",
+ "eqeqeq": ["error", "always", { "null": "ignore" }]
+ }
}
]
}
diff --git a/.flowconfig b/.flowconfig
index 9aacaf35ebdd..694811e55964 100644
--- a/.flowconfig
+++ b/.flowconfig
@@ -1,11 +1,10 @@
[ignore]
-.*/build/.*
-.*/packages/.*/lib
-.*/packages/.*/test
-.*/codemods/.*/lib
-.*/codemods/.*/test
-.*/node_modules/conventional-changelog-core/
-.*/node_modules/module-deps/
+/build/.*
+/packages/.*/lib
+/packages/.*/test
+/codemods/.*/lib
+/codemods/.*/test
+/node_modules/module-deps/
[include]
packages/*/src
diff --git a/.github/CHANGELOG-6to5.md b/.github/CHANGELOG-6to5.md
index 6005a2db3ab0..45afe2368d8d 100644
--- a/.github/CHANGELOG-6to5.md
+++ b/.github/CHANGELOG-6to5.md
@@ -84,7 +84,7 @@
* More performance improvements.
* Parsing is now ~30% faster thanks to [marijnh/acorn@7264bc0178e7e6af7cfe02e9e0c6b26ee0e6007f](https://github.com/marijnh/acorn/commit/7264bc0178e7e6af7cfe02e9e0c6b26ee0e6007f).
* **New Feature**
- * Optional `es6.blockScopingTDZ` is now completely functional and handles all edgecases.
+ * Optional `es6.blockScopingTDZ` is now completely functional and handles all edge cases.
* `super` in object literals.
* Tail call optimisation. Thanks [@RReverser](https://github.com/RReverser)!
@@ -474,7 +474,7 @@
* **Polish**
* Rest parameters now allocate the array before populating.
* **Internal**
- * `for...in` loops have been changed to optimized `for` loops - better performance and no enumeration of protoype keys.
+ * `for...in` loops have been changed to optimized `for` loops - better performance and no enumeration of prototype keys.
* Parts of the code generator have now been optimized thanks to [gaearon](https://github.com/gaearon).
## 2.12.3
@@ -643,7 +643,7 @@
* **Bug Fix**
* Better handling of number literal property keys.
- * Handle `NewExpression` paren insertion edegcases better.
+ * Handle `NewExpression` paren insertion edge cases better.
* **Internal**
* Fix incorrect AST node `identifier("this")`.
* Better `toIdentifier` method that handles reserved words.
@@ -850,7 +850,7 @@
## 1.14.10
- * Fix let scoping unneccesary override.
+ * Fix let scoping unnecessary override.
## 1.14.6
@@ -973,7 +973,7 @@
## 1.12.21
- * Fix unneccesary let scoping replacement.
+ * Fix unnecessary let scoping replacement.
* Add `commonInterop` module formatter. Thanks [@Naddiseo](https://github.com/Naddiseo).
* Fix `return` outside of function body bug. Thanks [@brentburg](https://github.com/brentburg).
* Add more flexible option types.
@@ -1020,7 +1020,7 @@
## 1.12.12
- * Make scope tracker more reliable to handle all edgecases.
+ * Make scope tracker more reliable to handle all edge cases.
## 1.12.11
diff --git a/.github/CHANGELOG-v4.md b/.github/CHANGELOG-v4.md
index 70ba225ffaef..7a06b2c93eee 100644
--- a/.github/CHANGELOG-v4.md
+++ b/.github/CHANGELOG-v4.md
@@ -127,7 +127,7 @@
## 4.6.4
* **Bug Fix**
- * Fix `ForOfStatement` not proplery inheriting labels.
+ * Fix `ForOfStatement` not properly inheriting labels.
* When in closure mode in block scoping transformer, properly check for variable shadowing.
* **New Feature**
* New `utility.inlineEnvironmentVariables` and `utility.inlineExpression` transformers.
@@ -153,7 +153,7 @@
* **Spec Compliancy**
* `for...of` now outputs in a lengthy `try...catch` this is to ensure spec compliancy in regards to iterator returns and abrupt completions. See [google/traceur-compiler#1773](https://github.com/google/traceur-compiler/issues/1773) and [babel/babel/#838](https://github.com/babel/babel/issues/838) for more information.
* **Polish**
- * Rest parameters that are only refered to via number properties on member expressions are desugared into a direct `arguments` reference. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)!
+ * Rest parameters that are only referred to via number properties on member expressions are desugared into a direct `arguments` reference. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)!
* `$ babel` no longer exits on syntax errors.
* **Internal**
* Upgrade `browserify`.
diff --git a/.github/CHANGELOG-v5.md b/.github/CHANGELOG-v5.md
index 04dfb5218d18..64d4999d58df 100644
--- a/.github/CHANGELOG-v5.md
+++ b/.github/CHANGELOG-v5.md
@@ -262,8 +262,8 @@ Issues with publish process.
* 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`.
+ * Support module live bindings in arbitrary positions not in Program statement position.
+ * Throw error when attempting 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.
@@ -543,12 +543,12 @@ Issues with publish process.
* **Internal**
* Removed native inheritance support from classes.
* Added `replaceWithSourceString` path API.
- * Split up `es3.propertyLiterals` and `es3.memberExpressionLiterals` transformers to `minfication.propertyLiterals` and `es3.memberExpressionLiterals`.
+ * Split up `es3.propertyLiterals` and `es3.memberExpressionLiterals` transformers to `minification.propertyLiterals` and `es3.memberExpressionLiterals`.
## 5.2.6
* **Internal**
- * Fix transformer aliases being accidently set as deprecated ones.
+ * Fix transformer aliases being accidentally set as deprecated ones.
* Expose `Pipeline` as `TransformerPipeline` instead.
## 5.2.5
@@ -824,10 +824,10 @@ Issues with publish process.
* Save register cache on tick instead of `SIGINT`.
* Enable strict mode on babel-node eval flag.
* **Bug Fixes**
- * Add support for live bindings. This change also increases the reliablity of export specifier renaming.
+ * Add support for live bindings. This change also increases the reliability of export specifier renaming.
* Add support for super update and non equals assignment expressions.
* Rename shadow constructor binding in classes.
- * Seed next iteration bindings with previous fresh bindings when reassinging loop block scoped variables.
+ * Seed next iteration bindings with previous fresh bindings when reassigning loop block scoped variables.
* Fix new expression spread referencing the wrong constructor.
* Call `resolveModuleSource` on dynamic imports.
* Added `param` to list of duplicate declaration kinds.
@@ -836,4 +836,3 @@ Issues with publish process.
* ES7 Abstract References have been removed.
* Experimental option has been removed in favor of a stage option.
* Rename `returnUsedHelpers` to `metadataUsedHelpers`.
-
\ No newline at end of file
diff --git a/.github/CHANGELOG-v6.md b/.github/CHANGELOG-v6.md
index bed990b56e9e..92d9173db5b8 100644
--- a/.github/CHANGELOG-v6.md
+++ b/.github/CHANGELOG-v6.md
@@ -19,7 +19,7 @@
## 6.26.0 (2017-08-16)
-> Backports for some folks (also other's when we accidently merged PRs from both 6.x/master)
+> Backports for some folks (also other's when we accidentally merged PRs from both 6.x/master)
> Lesson learned: just use `master` and backport on another branch.
#### :eyeglasses: Spec Compliancy
@@ -1767,7 +1767,7 @@ typeof Symbol.prototype === 'object'
* [#3456](https://github.com/babel/babel/pull/3456) Use the real sourcemap API and handle input sourcemaps - Fixes [#7259](https://github.com/babel/babel/issues/7259). ([@loganfsmyth](https://github.com/loganfsmyth))
* [#4507](https://github.com/babel/babel/pull/4507) Only set options in cli if different from default. ([@danez](https://github.com/danez))
-Fix an issue with defaults not being overidden. This was causing options like `comments: false` not to work correctly.
+Fix an issue with defaults not being overridden. This was causing options like `comments: false` not to work correctly.
* [#4508](https://github.com/babel/babel/pull/4508) Support custom ports for V8 --inspect. ([@andykant](https://github.com/andykant))
* [#4562](https://github.com/babel/babel/pull/4562) Fixes [#2299](https://github.com/babel/babel/issues/2299): Prevent REPL from printing implicit 'use strict'. ([@hzoo](https://github.com/hzoo))
@@ -2084,7 +2084,7 @@ Also added more tests and will update Babel to use the new preset options after
## 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`.
+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-compatibility. Ideally new plugins would use the new `module.exports = function(babel, options){ }` approach and simple skip supporting `babel-core@<6.13.x`.
#### Bug Fix
* `babel-core`, `babel-preset-es2015`
@@ -2092,7 +2092,7 @@ We had a regression in our new babel-preset-es2015@6.13.0 that made it unexpecte
## v6.13.0 (2016-08-04)
-> Since the last release we've created https://github.com/babel/notes to track discussions on our slack and high level features/changes that could be added - definetely check it out if you're interested in Babel's development!
+> Since the last release we've created https://github.com/babel/notes to track discussions on our slack and high level features/changes that could be added - definitely check it out if you're interested in Babel's development!
Some small but very important additions in this release:
@@ -3817,7 +3817,7 @@ Thanks to @samwgoldman for all the new flow support!
* **New Feature**
* Add support for `function.sent`.
* **Internal**
- * Bump `invariant` depenency version.
+ * Bump `invariant` dependency version.
* **Polish**
* Infer filename from the base directory when resolving plugins and presets.
* Allow JSX pragma to be specified in line comments.
@@ -3887,7 +3887,7 @@ Thanks to @samwgoldman for all the new flow support!
## 6.1.2
* **Bug Fix**
- * Fix bug where the parser wouldn't allow typed annotated default parametesr in arrow functions.
+ * Fix bug where the parser wouldn't allow typed annotated default parameters in arrow functions.
* Add existence check to `NodePath#has` to ensure safeness when making comparisons.
* Protect against replacing a class expression with a name inferred version that would
result in it never being transformed.
@@ -3976,7 +3976,7 @@ Thanks to @samwgoldman for all the new flow support!
* Fix SystemJS module formatter exporting function parameters.
* Ensure that invalid identifier JSX attribute keys are quoted when transforming to calls.
* Fix ES3 property literal plugin.
- * Fix parameters after defaults in arrow functions refering to the wrong `arguments`.
+ * Fix parameters after defaults in arrow functions referring to the wrong `arguments`.
## 6.0.13
diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md
index 13ef44cc2688..344922e4702c 100644
--- a/.github/ISSUE_TEMPLATE/Bug_report.md
+++ b/.github/ISSUE_TEMPLATE/Bug_report.md
@@ -1,6 +1,9 @@
---
-name: 🐛 Bug Report
-about: If something isn't working as expected 🤔.
+name: "\U0001F41B Bug Report"
+about: "If something isn't working as expected \U0001F914."
+title: ''
+labels: 'i: bug, i: needs triage'
+assignees: ''
---
@@ -31,7 +34,7 @@ A clear and concise description of what you expected to happen (or code).
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
- Node/npm version: [e.g. Node 8/npm 5]
- OS: [e.g. OSX 10.13.4, Windows 10]
-- Monorepo [e.g. yes/no/Lerna]
+- Monorepo: [e.g. yes/no/Lerna]
- How you are using Babel: [e.g. `cli`, `register`, `loader`]
**Possible Solution**
diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md
index fdbe35c81ed3..b9c82542ff8c 100644
--- a/.github/ISSUE_TEMPLATE/Feature_request.md
+++ b/.github/ISSUE_TEMPLATE/Feature_request.md
@@ -1,6 +1,9 @@
---
-name: 🚀 Feature Request
-about: I have a suggestion (and may want to implement it 🙂)!
+name: "\U0001F680 Feature Request"
+about: "I have a suggestion (and may want to implement it \U0001F642)!"
+title: ''
+labels: 'i: enhancement, i: needs triage'
+assignees: ''
---
diff --git a/.github/ISSUE_TEMPLATE/Regression-v7.md b/.github/ISSUE_TEMPLATE/Regression-v7.md
index cf839d261cbb..a700b90ba073 100644
--- a/.github/ISSUE_TEMPLATE/Regression-v7.md
+++ b/.github/ISSUE_TEMPLATE/Regression-v7.md
@@ -1,12 +1,16 @@
---
-name: 💥 v7 Regression
-about: Report an unexpected behavior in v7 from v6 (Check the upgrade guide first ✌️)
+name: "\U0001F4A5 v7 Regression"
+about: Report an unexpected behavior in v7 from v6 (Check the upgrade guide first
+ ✌️)
+title: ''
+labels: 'i: bug, 7.x: regression, i: needs triage'
+assignees: ''
---
# v7 Regression
-> First check out: https://new.babeljs.io/docs/en/next/v7-migration.html
+> First check out: https://babeljs.io/docs/en/v7-migration
> Also a partial upgrade tool: https://github.com/babel/babel-upgrade
**Potential Commit/PR that introduced the regression**
diff --git a/.github/ISSUE_TEMPLATE/Support_question.md b/.github/ISSUE_TEMPLATE/Support_question.md
index 32ad69fa25a3..57c183f7323d 100644
--- a/.github/ISSUE_TEMPLATE/Support_question.md
+++ b/.github/ISSUE_TEMPLATE/Support_question.md
@@ -1,6 +1,9 @@
---
-name: 🤗 Support Question
-about: If you have a question 💬, please check out our Slack or StackOverflow!
+name: "\U0001F917 Support Question"
+about: "If you have a question \U0001F4AC, please check out our Slack or StackOverflow!"
+title: ''
+labels: 'i: question, i: needs triage'
+assignees: ''
---
diff --git a/.github/ISSUE_TEMPLATE/Support_us.md b/.github/ISSUE_TEMPLATE/Support_us.md
index 56c9c08d57cc..cd7eb394bdd8 100644
--- a/.github/ISSUE_TEMPLATE/Support_us.md
+++ b/.github/ISSUE_TEMPLATE/Support_us.md
@@ -1,6 +1,10 @@
---
-name: 🤝 Support us on Babel
-about: If you would like to support our efforts in maintaining this community-driven project 🙌!
+name: "\U0001F91D Support us on Babel"
+about: "If you would like to support our efforts in maintaining this community-driven
+ project \U0001F64C!"
+title: ''
+labels: ''
+assignees: ''
---
diff --git a/.github/main.workflow b/.github/main.workflow
new file mode 100644
index 000000000000..3267641c50ce
--- /dev/null
+++ b/.github/main.workflow
@@ -0,0 +1,76 @@
+workflow "Release" {
+ on = "push"
+ resolves = ["Trigger GitHub release"]
+}
+
+action "Is version tag" {
+ uses = "actions/bin/filter@0dbb077f64d0ec1068a644d25c71b1db66148a24"
+ args = "tag v*"
+}
+
+action "Is tag from master" {
+ uses = "babel/actions/commit-matches-branch@master"
+ needs = [
+ "Is version tag",
+ ]
+ args = "master"
+}
+
+action "Trigger GitHub release" {
+ uses = "babel/actions/trigger-github-release@master"
+ secrets = ["GITHUB_TOKEN"]
+ env = {
+ COMMIT_AUTHOR_NAME = "Babel Bot"
+ COMMIT_AUTHOR_EMAIL = "babel-bot@users.noreply.github.com"
+ }
+ needs = [
+ "Is version tag",
+ "Is tag from master",
+ ]
+}
+
+workflow "Welcome" {
+ resolves = [
+ "Create Welcome Comment"
+ ]
+ on = "issues"
+}
+
+action "Is action 'opened'" {
+ uses = "actions/bin/filter@master"
+ args = "action opened"
+}
+
+action "Create Welcome Comment" {
+ uses = "babel/actions/create-welcome-comment@master"
+ secrets = ["GITHUB_TOKEN", "BOT_TOKEN"]
+ needs = ["Is action 'opened'"]
+}
+
+workflow "Needs Info" {
+ resolves = [
+ "Create Needs Info Comment"
+ ]
+ on = "issues"
+}
+
+action "Is action 'labeled'" {
+ uses = "actions/bin/filter@master"
+ args = "action labeled"
+}
+
+action "Has label 'Needs Info'" {
+ uses = "actions/bin/filter@master"
+ needs = [
+ "Is action 'labeled'"
+ ]
+ args = "label 'Needs Info'"
+}
+
+action "Create Needs Info Comment" {
+ uses = "babel/actions/create-needs-info-comment@master"
+ needs = [
+ "Has label 'Needs Info'",
+ ]
+ secrets = ["BOT_TOKEN", "GITHUB_TOKEN"]
+}
diff --git a/.gitignore b/.gitignore
index 2b06f7e3e409..2f99b017304b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,8 @@
+.npmrc
+
.DS_Store
/node_modules
+/.github/actions/*/node_modules
/packages/*/node_modules
/packages/*/LICENSE
!/packages/babel-parser/LICENSE
@@ -15,6 +18,7 @@ coverage
dist
/.package.json
package-lock.json
+!/.github/actions/*/package-lock.json
/packages/babel-runtime/helpers/*.js
!/packages/babel-runtime/helpers/toArray.js
@@ -36,6 +40,11 @@ package-lock.json
/packages/babel-runtime-corejs2/core-js/**/*.js
!/packages/babel-runtime-corejs2/core-js/map.js
+/packages/babel-runtime-corejs3/helpers/*.js
+/packages/babel-runtime-corejs3/helpers/esm/*.js
+/packages/babel-runtime-corejs3/core-js/**/*.js
+/packages/babel-runtime-corejs3/core-js-stable/**/*.js
+
/packages/babel-register/test/.babel
/packages/babel-cli/test/tmp
/packages/babel-node/test/tmp
diff --git a/.prettierignore b/.prettierignore
index 0318d666e9dc..e86c7aa505d3 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,2 +1,5 @@
package.json
packages/babel-preset-env/data
+packages/*/test/fixtures/**/input.*
+packages/*/test/fixtures/**/exec.*
+packages/*/test/fixtures/**/output.*
diff --git a/.travis.yml b/.travis.yml
index 67627f76c300..3957c277c102 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,14 +1,12 @@
git:
- depth: 10
-sudo: false
+ depth: 5
language: node_js
cache:
yarn: true
- directories:
- - node_modules
node_js:
# We test the latest version on circleci
- - '9'
+ - '11'
+ - '10'
- '8'
- '6'
@@ -20,17 +18,20 @@ env:
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
-install: yarn --ignore-engines
+install:
+ # the `make test-ci` script runs this command already
+ - if [ "$JOB" != "test" ] && [ "$JOB" != "lint" ]; then yarn install; fi
+ - if [ "$JOB" = "lint" ]; then make bootstrap; fi
before_script:
- - 'if [ "$JOB" = "babel-parser-flow-tests" ]; then make bootstrap-flow; fi'
- - 'if [ "$JOB" = "babel-parser-test262-tests" ]; then make bootstrap-test262; fi'
+ - if [ "$JOB" = "babel-parser-flow-tests" ]; then make bootstrap-flow; fi
+ - if [ "$JOB" = "babel-parser-test262-tests" ]; then make bootstrap-test262; fi
script:
- - 'if [ "$JOB" = "test" ]; then make test-ci; fi'
- - 'if [ "$JOB" = "lint" ]; then make lint && make flow; fi'
- - 'if [ "$JOB" = "babel-parser-flow-tests" ]; then make test-flow-ci; fi'
- - 'if [ "$JOB" = "babel-parser-test262-tests" ]; then make test-test262-ci; fi'
+ - if [ "$JOB" = "test" ]; then make test-ci; fi
+ - if [ "$JOB" = "lint" ]; then make lint && make flow; fi
+ - if [ "$JOB" = "babel-parser-flow-tests" ]; then make test-flow-ci; fi
+ - if [ "$JOB" = "babel-parser-test262-tests" ]; then make test-test262-ci; fi
matrix:
fast_finish: true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1e7eadb7c7d4..9ce2fc517e3d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,1018 @@ See [CHANGELOG - v4](/.github/CHANGELOG-v4.md), [CHANGELOG - v5](/.github/CHANGE
See [CHANGELOG - 6to5](/.github/CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0.0-beta.29 version changelog.
+
+
+
+## v7.5.5 (2019-07-17)
+
+#### :bug: Bug Fix
+* `babel-code-frame`
+ * [#10211](https://github.com/babel/babel/pull/10211) fix code-frame marker with highlighting ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-plugin-proposal-object-rest-spread`
+ * [#10200](https://github.com/babel/babel/pull/10200) Workaround #10179 in proposal-object-rest-spread ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-types`
+ * [#10198](https://github.com/babel/babel/pull/10198) add assertShape to validate templateElement ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-helper-create-class-features-plugin`, `babel-helper-member-expression-to-functions`, `babel-helper-replace-supers`, `babel-helpers`, `babel-plugin-proposal-class-properties`, `babel-plugin-transform-classes`, `babel-plugin-transform-object-super`, `babel-types`
+ * [#10017](https://github.com/babel/babel/pull/10017) destructuring private fields with array pattern / object pattern ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-plugin-transform-flow-comments`
+ * [#9901](https://github.com/babel/babel/pull/9901) fix transform-flow-comments for import types ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-core`, `babel-helpers`
+ * [#10208](https://github.com/babel/babel/pull/10208) always throw when add missing helpers ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-plugin-transform-runtime`
+ * [#10207](https://github.com/babel/babel/pull/10207) Closes [#10205](https://github.com/babel/babel/issues/10205) ([@sag1v](https://github.com/sag1v))
+* `babel-helpers`, `babel-plugin-transform-instanceof`
+ * [#10197](https://github.com/babel/babel/pull/10197) fix: custom instOfHandler result should be cast to boolean ([@JLHwung](https://github.com/JLHwung))
+
+#### :house: Internal
+* `babel-parser`, `babel-plugin-transform-typescript`
+ * [#10014](https://github.com/babel/babel/pull/10014) Use correct extension for typescript fixtures ([@danez](https://github.com/danez))
+
+#### :running_woman: Performance
+* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
+ * [#10189](https://github.com/babel/babel/pull/10189) perf: match ownKeys perf to the one of objectSpread ([@JLHwung](https://github.com/JLHwung))
+
+## v7.5.4 (2019-07-09)
+
+#### :bug: Bug Fix
+* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
+ * [#10188](https://github.com/babel/babel/pull/10188) Fix _objectSpread2 for real ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+## v7.5.3 (2019-07-09)
+
+#### :bug: Bug Fix
+* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
+ * [#10180](https://github.com/babel/babel/pull/10180) [_objectSpread2] Do not use hoisted var from prev iteration ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+## v7.5.2 (2019-07-08)
+
+#### :bug: Bug Fix
+* `babel-plugin-transform-typescript`
+ * [#10174](https://github.com/babel/babel/pull/10174) Do not trust Scope when removing TypeScript types ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
+ * [#10171](https://github.com/babel/babel/pull/10171) Don't rely on getOwnPropertyDescriptors in objectSpread2 ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-proposal-export-default-from`, `babel-plugin-proposal-export-namespace-from`
+ * [#10172](https://github.com/babel/babel/pull/10172) fix: register injected importDeclaration ([@JLHwung](https://github.com/JLHwung))
+
+## v7.5.1 (2019-07-06)
+
+#### :bug: Bug Fix
+* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`
+ * [#10170](https://github.com/babel/babel/pull/10170) Fix objectSpread2 backward compatibility ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-transform-typescript`
+ * [#10167](https://github.com/babel/babel/pull/10167) Retain typescript export-from-source ([@Wolvereness](https://github.com/Wolvereness))
+
+## v7.5.0 (2019-07-04)
+
+#### :eyeglasses: Spec Compliance
+* `babel-parser`
+ * [#10099](https://github.com/babel/babel/pull/10099) Disallow "let" as name at lexical bindings ([@g-plane](https://github.com/g-plane))
+
+#### :rocket: New Feature
+* `babel-parser`
+ * [#10091](https://github.com/babel/babel/pull/10091) BigInt type for Flow ([@tanhauhau](https://github.com/tanhauhau))
+ * [#9450](https://github.com/babel/babel/pull/9450) Implement f# pipeline in parser ([@mAAdhaTTah](https://github.com/mAAdhaTTah))
+ * [#9912](https://github.com/babel/babel/pull/9912) [legacy decorators] Allow decorating generator methods ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9864](https://github.com/babel/babel/pull/9864) [@babel/parser] Add "allowUndeclaredExports" option ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-proposal-dynamic-import`, `babel-preset-env-standalone`, `babel-preset-env`
+ * [#10109](https://github.com/babel/babel/pull/10109) Add @babel/plugin-proposal-dynamic-import to @babel/preset-env ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-proposal-dynamic-import`, `babel-plugin-transform-modules-amd`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-modules-systemjs`
+ * [#9552](https://github.com/babel/babel/pull/9552) Create @babel/plugin-proposal-dynamic-import ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-proposal-pipeline-operator`, `babel-plugin-syntax-pipeline-operator`
+ * [#9984](https://github.com/babel/babel/pull/9984) Transform for F# Pipeline ([@thiagoarrais](https://github.com/thiagoarrais))
+* `babel-plugin-transform-typescript`, `babel-types`
+ * [#9785](https://github.com/babel/babel/pull/9785) Implement TypeScript namespace support ([@Wolvereness](https://github.com/Wolvereness))
+
+#### :bug: Bug Fix
+* `babel-plugin-proposal-do-expressions`, `babel-traverse`
+ * [#10072](https://github.com/babel/babel/pull/10072) fix await and yield for do expression ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-helpers`, `babel-plugin-transform-react-constant-elements`
+ * [#10155](https://github.com/babel/babel/pull/10155) Added es3 backward compatibility for react helper code ([@sormy](https://github.com/sormy))
+* `babel-preset-env`
+ * [#10127](https://github.com/babel/babel/pull/10127) Bump compat-table and updating preset-env mappings ([@existentialism](https://github.com/existentialism))
+ * [#8897](https://github.com/babel/babel/pull/8897) Allow `defaults` query in preset-env ([@existentialism](https://github.com/existentialism))
+* `babel-parser`
+ * [#10132](https://github.com/babel/babel/pull/10132) fix import typeof in declare module ([@tanhauhau](https://github.com/tanhauhau))
+ * [#10084](https://github.com/babel/babel/pull/10084) flow - allow type parameter defaults in function declarations ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-types`
+ * [#10126](https://github.com/babel/babel/pull/10126) fix exportKind declaration in babel-types ([@zxbodya](https://github.com/zxbodya))
+* `babel-node`
+ * [#9951](https://github.com/babel/babel/pull/9951) Prevents exception on PnP ([@arcanis](https://github.com/arcanis))
+* `babel-generator`
+ * [#10041](https://github.com/babel/babel/pull/10041) Fix printer for explicitly inexact Flow types ([@mrtnzlml](https://github.com/mrtnzlml))
+* `babel-plugin-transform-typescript`
+ * [#10034](https://github.com/babel/babel/pull/10034) Use scope for typescript export removals ([@Wolvereness](https://github.com/Wolvereness))
+ * [#10019](https://github.com/babel/babel/pull/10019) fix(typescript): erase default export if exporting a TS type ([@airato](https://github.com/airato))
+* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-class-properties`, `babel-traverse`
+ * [#10029](https://github.com/babel/babel/pull/10029) Fixed computed keys for class expression ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
+ * [#9384](https://github.com/babel/babel/pull/9384) Retry to fix object spread helper compatibility ([@saschanaz](https://github.com/saschanaz))
+* `babel-plugin-transform-destructuring`
+ * [#10013](https://github.com/babel/babel/pull/10013) fix destructuring rest with template literal ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-helper-create-class-features-plugin`, `babel-plugin-transform-typescript`
+ * [#9610](https://github.com/babel/babel/pull/9610) Use `injectInitialization` to generate ts parameter properties ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+#### :nail_care: Polish
+* `babel-core`
+ * [#10157](https://github.com/babel/babel/pull/10157) Fix incorrect usage of $o instead of %o in debug ([@ChlorideCull](https://github.com/ChlorideCull))
+* `babel-helpers`
+ * [#10117](https://github.com/babel/babel/pull/10117) Simplify the helpers for classPrivateField{Get,Set} ([@arv](https://github.com/arv))
+* `babel-plugin-transform-typescript`
+ * [#10047](https://github.com/babel/babel/pull/10047) Refactor isImportTypeOnly helper function ([@Andarist](https://github.com/Andarist))
+
+#### :memo: Documentation
+* `babel-plugin-proposal-partial-application`, `babel-plugin-syntax-partial-application`
+ * [#10103](https://github.com/babel/babel/pull/10103) docs: update readmes ([@xtuc](https://github.com/xtuc))
+
+## v7.4.5 (2019-05-21)
+
+#### :bug: Bug Fix
+* `babel-parser`
+ * [#9998](https://github.com/babel/babel/pull/9998) Fix location for optional params in arrow functions ([@danez](https://github.com/danez))
+ * [#9982](https://github.com/babel/babel/pull/9982) Avoid unnecessary work during lookahead ([@danez](https://github.com/danez))
+ * [#9922](https://github.com/babel/babel/pull/9922) fix: allow shebang directive ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-preset-env`
+ * [#10002](https://github.com/babel/babel/pull/10002) Update preset-env dependencies and fix fixtures ([@danez](https://github.com/danez))
+ * [#9978](https://github.com/babel/babel/pull/9978) Fix mobile browsers support in preset-env ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9902](https://github.com/babel/babel/pull/9902) Fix destructuring assignments being transpiled for edge 15 ([@eps1lon](https://github.com/eps1lon))
+* `babel-plugin-transform-typescript`
+ * [#9944](https://github.com/babel/babel/pull/9944) fix(typescript): erase type exports ([@airato](https://github.com/airato))
+
+#### :nail_care: Polish
+* `babel-parser`
+ * [#9995](https://github.com/babel/babel/pull/9995) Do not use lookahead when parsing construct signature declarations in TS ([@danez](https://github.com/danez))
+ * [#9989](https://github.com/babel/babel/pull/9989) Only compute Position if not already in state ([@danez](https://github.com/danez))
+ * [#9988](https://github.com/babel/babel/pull/9988) Do not use lookahead when parsing jsx expression containers ([@danez](https://github.com/danez))
+ * [#9987](https://github.com/babel/babel/pull/9987) Do not use lookahead when parsing imports in declare module in flow ([@danez](https://github.com/danez))
+ * [#9985](https://github.com/babel/babel/pull/9985) Do not use lookahead when parsing declare module or declare module.exports in flow ([@danez](https://github.com/danez))
+ * [#9983](https://github.com/babel/babel/pull/9983) Do not use lookahead when parsing dynamic import or import.meta ([@danez](https://github.com/danez))
+ * [#9979](https://github.com/babel/babel/pull/9979) Remove guardedHandlers from ASTs ([@danez](https://github.com/danez))
+* `babel-preset-env`
+ * [#9992](https://github.com/babel/babel/pull/9992) use console.warn for warning ([@schu34](https://github.com/schu34))
+* `babel-core`
+ * [#9945](https://github.com/babel/babel/pull/9945) Fixed null error in plugin opts and added a test for it ([@divbhasin](https://github.com/divbhasin))
+* `babel-core`, `babel-traverse`
+ * [#9909](https://github.com/babel/babel/pull/9909) Add missing space in error messages ([@pnavarrc](https://github.com/pnavarrc))
+
+#### :house: Internal
+* `babel-node`
+ * [#9914](https://github.com/babel/babel/pull/9914) [babel-node] Do not hardcode node flags ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+## v7.4.4 (2019-04-26)
+
+#### :bug: Bug Fix
+* `babel-plugin-transform-flow-comments`
+ * [#9897](https://github.com/babel/babel/pull/9897) fix flow-comments - class type paramters and implements ([@tanhauhau](https://github.com/tanhauhau))
+ * [#9893](https://github.com/babel/babel/pull/9893) fix flow-comment - object destructuring ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-parser`
+ * [#9766](https://github.com/babel/babel/pull/9766) Add TS support to @babel/parser's Scope ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9865](https://github.com/babel/babel/pull/9865) Always register global bindings as exportable ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9887](https://github.com/babel/babel/pull/9887) Fix TypeScript readonly error location ([@existentialism](https://github.com/existentialism))
+ * [#9869](https://github.com/babel/babel/pull/9869) ! remove constant context assertions ([@tanhauhau](https://github.com/tanhauhau))
+ * [#9890](https://github.com/babel/babel/pull/9890) Fix parsing typescript bodiless methods with the estree plugin also enabled ([@devongovett](https://github.com/devongovett))
+* `babel-traverse`
+ * [#9870](https://github.com/babel/babel/pull/9870) Fix flow types in traverse/path/family and enable flow ([@danez](https://github.com/danez))
+* `babel-plugin-proposal-class-properties`, `babel-plugin-transform-modules-commonjs`, `babel-types`
+ * [#9861](https://github.com/babel/babel/pull/9861) Fix: PrivateName Identifier should not be isReferenced. ([@coreyfarrell](https://github.com/coreyfarrell))
+* `babel-types`
+ * [#9832](https://github.com/babel/babel/pull/9832) Fix typo in cloneNode. ([@evandervalk](https://github.com/evandervalk))
+
+
+## v7.4.3 (2019-04-02)
+
+#### :eyeglasses: Spec Compliance
+* `babel-parser`
+ * [#9769](https://github.com/babel/babel/pull/9769) Don't accept '\08' or '\09' in strict mode. ([@danez](https://github.com/danez))
+ * [#9768](https://github.com/babel/babel/pull/9768) Correctly check for-in and for-of loop for invalid left-hand side. ([@danez](https://github.com/danez))
+ * [#9767](https://github.com/babel/babel/pull/9767) Parse right-hand-side of for/of as an assignment expression. ([@danez](https://github.com/danez))
+ * [#9748](https://github.com/babel/babel/pull/9748) [typescript] parsing template literal as type . ([@tanhauhau](https://github.com/tanhauhau))
+
+#### :rocket: New Feature
+* `babel-plugin-transform-runtime`
+ * [#9754](https://github.com/babel/babel/pull/9754) [runtime-corejs3] Only polyfill instance methods when it might be needed. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+#### :bug: Bug Fix
+* `babel-polyfill`
+ * [#9780](https://github.com/babel/babel/pull/9780) Closes [#9232](https://github.com/babel/babel/issues/9232), add some missed modules to `@babel/polyfill/noConflict`. ([@zloirock](https://github.com/zloirock))
+* `babel-cli`
+ * [#9807](https://github.com/babel/babel/pull/9807) Upgrade lodash to 4.17.11. ([@danez](https://github.com/danez))
+* `babel-helper-module-transforms`, `babel-plugin-transform-modules-commonjs`
+ * [#9802](https://github.com/babel/babel/pull/9802) Fix lazy option of babel-plugin-transform-modules-commonjs. ([@AndreasCag](https://github.com/AndreasCag))
+* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-private-methods`
+ * [#9801](https://github.com/babel/babel/pull/9801) Fix super method call in private instance method calling overridden method. ([@MattiasBuelens](https://github.com/MattiasBuelens))
+* `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-destructuring`
+ * [#9416](https://github.com/babel/babel/pull/9416) Destructuring: Fix handling of impure computed keys with object rest. ([@motiz88](https://github.com/motiz88))
+* `babel-plugin-transform-destructuring`
+ * [#9412](https://github.com/babel/babel/pull/9412) Destructuring: Fix array unpacking assignments with holes on RHS. ([@motiz88](https://github.com/motiz88))
+* `babel-traverse`
+ * [#9415](https://github.com/babel/babel/pull/9415) @babel/traverse: Fix NodePath.getData. ([@71](https://github.com/71))
+* `babel-parser`
+ * [#9760](https://github.com/babel/babel/pull/9760) Allow HTML comments on first line. ([@danez](https://github.com/danez))
+ * [#9700](https://github.com/babel/babel/pull/9700) Fix compatibility between estree and TS plugin. ([@danez](https://github.com/danez))
+* `babel-helpers`
+ * [#9756](https://github.com/babel/babel/pull/9756) Allow coreJS Symbol to be type object. ([@conartist6](https://github.com/conartist6))
+* `babel-preset-env`
+ * [#9752](https://github.com/babel/babel/pull/9752) Normalize `core-js` entry points. ([@zloirock](https://github.com/zloirock))
+
+#### :nail_care: Polish
+* `babel-parser`
+ * [#9762](https://github.com/babel/babel/pull/9762) Optimize parseBindingAtom code to get better error messages. ([@danez](https://github.com/danez))
+* `babel-core`, `babel-plugin-transform-for-of`
+ * [#9698](https://github.com/babel/babel/pull/9698) Move array reference into `for` head initializer. ([@danez](https://github.com/danez))
+
+#### :house: Internal
+* Other
+ * [#9806](https://github.com/babel/babel/pull/9806) Update test262. ([@danez](https://github.com/danez))
+* `babel-parser`, `babel-preset-typescript`
+ * [#9761](https://github.com/babel/babel/pull/9761) Explicit labels for tokenTypes. ([@danez](https://github.com/danez))
+
+
+## v7.4.2 (2019-03-21)
+
+#### :bug: Bug Fix
+* `babel-parser`
+ * [#9725](https://github.com/babel/babel/pull/9725) Modules might be in loose mode when checking for undecl exports ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9719](https://github.com/babel/babel/pull/9719) Fix scope checks with enabled flow plugin ([@danez](https://github.com/danez))
+* `babel-helpers`, `babel-plugin-transform-named-capturing-groups-regex`
+ * [#9726](https://github.com/babel/babel/pull/9726) Fix typo in wrapRegExp helper ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-preset-env`
+ * [#9724](https://github.com/babel/babel/pull/9724) Closes [#9713](https://github.com/babel/babel/issues/9713) ([@zloirock](https://github.com/zloirock))
+
+#### :nail_care: Polish
+* `babel-preset-env`
+ * [#9732](https://github.com/babel/babel/pull/9732) Mark the core-js warning as such ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9716](https://github.com/babel/babel/pull/9716) Tweak preset-env corejs/useBuiltIns warning and error messages ([@existentialism](https://github.com/existentialism))
+
+#### :house: Internal
+* [#9718](https://github.com/babel/babel/pull/9718) Bump Babel deps ([@existentialism](https://github.com/existentialism))
+
+## v7.4.1 (2019-03-20)
+
+#### :bug: Bug Fix
+* `babel-preset-env`
+ * [#9711](https://github.com/babel/babel/pull/9711) Alias @babel/preset-env/data/built-ins.json.js ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9709](https://github.com/babel/babel/pull/9709) Bring back isPluginRequired ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+## v7.4.0 (2019-03-19)
+
+#### :eyeglasses: Spec Compliance
+* `babel-parser`
+ * [#9529](https://github.com/babel/babel/pull/9529) Add `readonly` to TypeScript type modifier ([@tanhauhau](https://github.com/tanhauhau))
+ * [#9534](https://github.com/babel/babel/pull/9534) TypeScript Constant contexts ([@tanhauhau](https://github.com/tanhauhau))
+ * [#9637](https://github.com/babel/babel/pull/9637) Update identifier parsing per Unicode v12 ([@mathiasbynens](https://github.com/mathiasbynens))
+ * [#9616](https://github.com/babel/babel/pull/9616) Allow any reserved word in `export {} from` specifiers ([@danez](https://github.com/danez))
+ * [#9612](https://github.com/babel/babel/pull/9612) [TS] Disallow type casts in arrow parameters ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9607](https://github.com/babel/babel/pull/9607) Refactor parsing object members ([@danez](https://github.com/danez))
+ * [#9599](https://github.com/babel/babel/pull/9599) Disallow duplicate params in methods ([@danez](https://github.com/danez))
+ * [#9586](https://github.com/babel/babel/pull/9586) Treat for loop body as part of loop scope ([@danez](https://github.com/danez))
+* `babel-parser`, `babel-plugin-transform-typescript`
+ * [#9641](https://github.com/babel/babel/pull/9641) Allow context type annotation on getters/setters ([@matt-tingen](https://github.com/matt-tingen))
+* `babel-plugin-proposal-unicode-property-regex`, `babel-plugin-transform-dotall-regex`, `babel-plugin-transform-unicode-regex`
+ * [#9636](https://github.com/babel/babel/pull/9636) Update babel-plugin-proposal-unicode-property-regex for Unicode v12 ([@mathiasbynens](https://github.com/mathiasbynens))
+* `babel-generator`, `babel-parser`, `babel-plugin-transform-flow-strip-types`, `babel-plugin-transform-modules-systemjs`
+ * [#9589](https://github.com/babel/babel/pull/9589) Check exported bindings are defined ([@danez](https://github.com/danez))
+* `babel-generator`, `babel-parser`, `babel-plugin-transform-classes`, `babel-plugin-transform-flow-comments`, `babel-plugin-transform-flow-strip-types`, `babel-plugin-transform-new-target`
+ * [#9493](https://github.com/babel/babel/pull/9493) Introduce scope tracking in the parser ([@danez](https://github.com/danez))
+
+#### :rocket: New Feature
+* `babel-helpers`, `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-decorators`, `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-runtime`, `babel-plugin-transform-typescript`, `babel-polyfill`, `babel-preset-env`, `babel-register`, `babel-runtime-corejs2`, `babel-runtime-corejs3`
+ * [#7646](https://github.com/babel/babel/pull/7646) Update to `core-js@3` ([@zloirock](https://github.com/zloirock))
+* `babel-template`
+ * [#9648](https://github.com/babel/babel/pull/9648) Add %%placeholders%% support to @babel/template ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-parser`, `babel-plugin-proposal-partial-application`
+ * [#9474](https://github.com/babel/babel/pull/9474) Partial application plugin ([@byara](https://github.com/byara))
+* `babel-generator`, `babel-helper-create-class-features-plugin`, `babel-helpers`, `babel-plugin-proposal-private-methods`
+ * [#9446](https://github.com/babel/babel/pull/9446) Private Static Class Methods (Stage 3) ([@tim-mc](https://github.com/tim-mc))
+* `babel-generator`, `babel-types`
+ * [#9542](https://github.com/babel/babel/pull/9542) Add placeholders support to @babel/types and @babel/generator ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-parser`
+ * [#9364](https://github.com/babel/babel/pull/9364) Add parser support for placeholders ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-generator`, `babel-parser`, `babel-plugin-syntax-partial-application`, `babel-types`
+ * [#9343](https://github.com/babel/babel/pull/9343) Partial Application Syntax: Stage 1 ([@byara](https://github.com/byara))
+
+#### :bug: Bug Fix
+* `babel-helper-create-class-features-plugin`, `babel-helper-replace-supers`, `babel-plugin-proposal-private-methods`
+ * [#9704](https://github.com/babel/babel/pull/9704) Fix `super` Method Calls in Class Private Methods ([@tim-mc](https://github.com/tim-mc))
+* `babel-parser`
+ * [#9699](https://github.com/babel/babel/pull/9699) Correctly parse TS TypeAssertions around arrow functions ([@danez](https://github.com/danez))
+ * [#9600](https://github.com/babel/babel/pull/9600) Fix scope check for 2nd+ lexical bindings ([@danez](https://github.com/danez))
+ * [#9593](https://github.com/babel/babel/pull/9593) [TS] Correctly forget `await`s after parsing async arrows with type args ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9585](https://github.com/babel/babel/pull/9585) Fix strict mode prescanning with EmptyStatement ([@danez](https://github.com/danez))
+* `babel-core`, `babel-plugin-transform-for-of`
+ * [#9697](https://github.com/babel/babel/pull/9697) Correctly preserve reference to array in for-of loop ([@danez](https://github.com/danez))
+* `babel-plugin-transform-typescript`
+ * [#9693](https://github.com/babel/babel/pull/9693) [plugin-transform-typescript] Fix transpiling of TS abstract classes with decorators ([@agoldis](https://github.com/agoldis))
+* `babel-traverse`, `babel-types`
+ * [#9692](https://github.com/babel/babel/pull/9692) Fix TSFunctionType visitors definition ([@penielse](https://github.com/penielse))
+* `babel-plugin-proposal-object-rest-spread`
+ * [#9628](https://github.com/babel/babel/pull/9628) [proposal-object-rest-spread] fix templateLiteral in extractNormalizedKeys ([@pnowak](https://github.com/pnowak))
+* `babel-plugin-transform-modules-systemjs`
+ * [#9639](https://github.com/babel/babel/pull/9639) System modules - Hoist classes like other variables ([@guybedford](https://github.com/guybedford))
+* `babel-generator`, `babel-parser`
+ * [#9618](https://github.com/babel/babel/pull/9618) Disallow escape sequences in contextual keywords ([@danez](https://github.com/danez))
+* `babel-helper-split-export-declaration`, `babel-plugin-transform-modules-commonjs`, `babel-traverse`
+ * [#9613](https://github.com/babel/babel/pull/9613) Don't add params of anonymous exported function decls to the outer scope ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-transform-parameters`, `babel-plugin-transform-typescript`, `babel-types`
+ * [#9605](https://github.com/babel/babel/pull/9605) [plugin-transform-typescript] Strip type imports used in Enums and object types ([@echenley](https://github.com/echenley))
+* `babel-helper-call-delegate`, `babel-plugin-transform-parameters`
+ * [#9601](https://github.com/babel/babel/pull/9601) Don't loose "this" in helper-call-delegate ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-modules-commonjs`, `babel-traverse`, `babel-types`
+ * [#9492](https://github.com/babel/babel/pull/9492) Mark FOO in "var { x: FOO }˝ as a binding, not as a reference ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-preset-env`
+ * [#9595](https://github.com/babel/babel/pull/9595) preset-env: Sort versions before determining lowest ([@jridgewell](https://github.com/jridgewell))
+* `babel-helper-define-map`, `babel-helper-hoist-variables`, `babel-parser`, `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-block-scoping`, `babel-plugin-transform-destructuring`, `babel-plugin-transform-modules-systemjs`, `babel-traverse`, `babel-types`
+ * [#9518](https://github.com/babel/babel/pull/9518) Use `for..of Object.keys` instead of `for..in` ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+#### :nail_care: Polish
+* `babel-parser`
+ * [#9646](https://github.com/babel/babel/pull/9646) Remove input and length from state ([@danez](https://github.com/danez))
+ * [#9645](https://github.com/babel/babel/pull/9645) Reorganize token types and use a map for them ([@danez](https://github.com/danez))
+ * [#9591](https://github.com/babel/babel/pull/9591) Remove always false param allowExpressionBody ([@danez](https://github.com/danez))
+* `babel-standalone`, `babel-types`
+ * [#9025](https://github.com/babel/babel/pull/9025) Make babel-standalone an ESModule and enable flow ([@danez](https://github.com/danez))
+* `babel-generator`
+ * [#9579](https://github.com/babel/babel/pull/9579) change var name for coherence ([@tanohzana](https://github.com/tanohzana))
+
+#### :house: Internal
+* Other
+ * [#9588](https://github.com/babel/babel/pull/9588) Publish to npm using a GitHub action ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9640](https://github.com/babel/babel/pull/9640) Switch from rollup-stream to rollup ([@danez](https://github.com/danez))
+ * [#9647](https://github.com/babel/babel/pull/9647) Add WarningsToErrorsPlugin to webpack to avoid missing build problems on CI ([@danez](https://github.com/danez))
+ * [#9624](https://github.com/babel/babel/pull/9624) Update dependencies ([@danez](https://github.com/danez))
+ * [#9623](https://github.com/babel/babel/pull/9623) Add editorconfig for Makefile ([@danez](https://github.com/danez))
+ * [#9587](https://github.com/babel/babel/pull/9587) Update test262 ([@danez](https://github.com/danez))
+ * [#9582](https://github.com/babel/babel/pull/9582) Minify bundles on circle for repl ([@danez](https://github.com/danez))
+* `babel-register`
+ * [#9678](https://github.com/babel/babel/pull/9678) Remove dependency on home-or-tmp package ([@AmirS](https://github.com/AmirS))
+
+## v7.3.4 (2019-02-25)
+
+#### :bug: Bug Fix
+* `babel-parser`
+ * [#9572](https://github.com/babel/babel/pull/9572) Fix TypeScript parsers missing token check (#9571) ([@elevatebart](https://github.com/elevatebart))
+ * [#9521](https://github.com/babel/babel/pull/9521) Also check AssignmentPatterns for duplicate export name ([@danez](https://github.com/danez))
+* `babel-helper-create-class-features-plugin`, `babel-helper-replace-supers`, `babel-plugin-proposal-class-properties`, `babel-traverse`
+ * [#9508](https://github.com/babel/babel/pull/9508) Use correct "this" in static fields ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-preset-env`
+ * [#9566](https://github.com/babel/babel/pull/9566) Closes [#9465](https://github.com/babel/babel/issues/9465) ([@zloirock](https://github.com/zloirock))
+* `babel-types`
+ * [#9539](https://github.com/babel/babel/pull/9539) babel-types is* type checks accept null | undefiend as value TS type ([@ian-craig](https://github.com/ian-craig))
+* `babel-plugin-transform-block-scoping`, `babel-traverse`
+ * [#9532](https://github.com/babel/babel/pull/9532) Migrate some duplicate binding tests to traverse ([@danez](https://github.com/danez))
+* `babel-generator`
+ * [#9524](https://github.com/babel/babel/pull/9524) Fix typescript generator params ([@tanhauhau](https://github.com/tanhauhau))
+ * [#9523](https://github.com/babel/babel/pull/9523) Fix flow babel-generator function parantheses ([@tanhauhau](https://github.com/tanhauhau))
+
+#### :house: Internal
+* Other
+ * [#9561](https://github.com/babel/babel/pull/9561) Update CHANGELOG.md using the "Trigger GitHub release" action ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-modules-systemjs`
+ * [#9541](https://github.com/babel/babel/pull/9541) Enable eqeqeq rule in eslint ([@danez](https://github.com/danez))
+* `babel-generator`, `babel-parser`, `babel-plugin-transform-flow-strip-types`, `babel-traverse`
+ * [#9522](https://github.com/babel/babel/pull/9522) Make tests spec compliant by avoiding duplicate declarations in input files ([@danez](https://github.com/danez))
+* `babel-plugin-transform-proto-to-assign`
+ * [#9533](https://github.com/babel/babel/pull/9533) Add import/no-extraneous-dependencies to ESLint ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+## v7.3.3 (2019-02-15)
+
+#### :eyeglasses: Spec Compliancy
+* `babel-generator`
+ * [#9501](https://github.com/babel/babel/pull/9501) Correctly output escapes in directives ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+#### :bug: Bug Fix
+* `babel-parser`
+ * [#9477](https://github.com/babel/babel/pull/9477) Fix regression with let ([@danez](https://github.com/danez))
+ * [#9431](https://github.com/babel/babel/pull/9431) Typescript function destructured params ([@mhcgrq](https://github.com/mhcgrq))
+ * [#9463](https://github.com/babel/babel/pull/9463) Fix range for TypeScript optional parameter in arrow function ([@existentialism](https://github.com/existentialism))
+
+#### :nail_care: Polish
+* `babel-plugin-proposal-class-properties`, `babel-plugin-transform-classes`, `babel-plugin-transform-parameters`
+ * [#9458](https://github.com/babel/babel/pull/9458) Fix duplicated assertThisInitialized calls in constructors ([@rubennorte](https://github.com/rubennorte))
+
+#### :house: Internal
+* Other
+ * [#9517](https://github.com/babel/babel/pull/9517) Add duplicate-package-checker-webpack-plugin ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9469](https://github.com/babel/babel/pull/9469) Exclude generate @babel/types files from coverage report ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-parser`
+ * [#9491](https://github.com/babel/babel/pull/9491) Better error output in parser tests ([@danez](https://github.com/danez))
+## v7.3.2 (2019-02-04)
+
+Various spec compliancy fixes and better support for smart pipelines and private methods.
+
+Thanks @gverni, @naffiq, @spondbob and @dstaley for their first PRs!
+
+#### :eyeglasses: Spec Compliancy
+* `babel-parser`
+ * [#9403](https://github.com/babel/babel/pull/9403) Fix line continuation with Unicode line terminators. ([@danez](https://github.com/danez))
+ * [#9400](https://github.com/babel/babel/pull/9400) Make yield a contextual keyword. ([@danez](https://github.com/danez))
+ * [#9398](https://github.com/babel/babel/pull/9398) Correctly fail for invalid yield in for. ([@danez](https://github.com/danez))
+ * [#9375](https://github.com/babel/babel/pull/9375) Make let a contextual keyword. ([@danez](https://github.com/danez))
+
+#### :rocket: New Feature
+* `babel-plugin-proposal-pipeline-operator`
+ * [#9401](https://github.com/babel/babel/pull/9401) Support for await and yield in pipelines. ([@thiagoarrais](https://github.com/thiagoarrais))
+
+#### :bug: Bug Fix
+* `babel-plugin-proposal-private-methods`, `babel-types`
+ * [#9453](https://github.com/babel/babel/pull/9453) Fix duplicate definition error in private class methods. ([@gverni](https://github.com/gverni))
+* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-private-methods`
+ * [#9423](https://github.com/babel/babel/pull/9423) Transform private async and generator functions. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-destructuring`
+ * [#9414](https://github.com/babel/babel/pull/9414) Destructuring: Create assignments from ForX non-declaration patterns. ([@motiz88](https://github.com/motiz88))
+* `babel-plugin-transform-typescript`
+ * [#9095](https://github.com/babel/babel/pull/9095) Retain JSX pragma if defined as a comment. ([@dstaley](https://github.com/dstaley))
+* `babel-parser`
+ * [#9406](https://github.com/babel/babel/pull/9406) Fix location/range on TypeScript ExportNamedDeclarations. ([@existentialism](https://github.com/existentialism))
+ * [#9371](https://github.com/babel/babel/pull/9371) Allow toplevel await with option and correctly mark await keyword as unexpected. ([@danez](https://github.com/danez))
+* `babel-plugin-transform-typescript`, `babel-types`
+ * [#8738](https://github.com/babel/babel/pull/8738) Fix typescript side effects. ([@yuri-karadzhov](https://github.com/yuri-karadzhov))
+* `babel-generator`, `babel-types`
+ * [#9396](https://github.com/babel/babel/pull/9396) Fix support for Flow's QualifiedTypeIdentifier. ([@existentialism](https://github.com/existentialism))
+
+#### :nail_care: Polish
+* `babel-parser`
+ * [#9405](https://github.com/babel/babel/pull/9405) Simplify await and yield tracking in params. ([@danez](https://github.com/danez))
+* `babel-parser`, `babel-preset-typescript`
+ * [#9402](https://github.com/babel/babel/pull/9402) Unify reserved word checking and update error messages. ([@danez](https://github.com/danez))
+
+## v7.3.1 (2019-01-22)
+
+This release fixes some regressions introduced in v7.3.0
+
+#### :bug: Bug Fix
+* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
+ * [#9379](https://github.com/babel/babel/pull/9379) Revert "Differentiate object spread and non-spread properties (#9341)". ([@danez](https://github.com/danez))
+* `babel-parser`
+ * [#9377](https://github.com/babel/babel/pull/9377) fix new keyword broken by recent refactoring. ([@danez](https://github.com/danez))
+
+## v7.3.0 (2019-01-21)
+
+Thanks to @jamesgeorge007 and @armano2 for their first PR!
+
+#### :eyeglasses: Spec Compliancy
+* `babel-parser`
+ * [#9314](https://github.com/babel/babel/pull/9314) Disallow async functions as loop body. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9315](https://github.com/babel/babel/pull/9315) Parse class heritage as strict mode code. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9313](https://github.com/babel/babel/pull/9313) Disallow `new import(x)` and `import(x,)`. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9311](https://github.com/babel/babel/pull/9311) Disallow trailing comma after rest. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+#### :rocket: New Feature
+* `babel-helper-create-class-features-plugin`, `babel-helpers`, `babel-plugin-proposal-private-methods`
+ * [#9101](https://github.com/babel/babel/pull/9101) Private Class Methods Stage 3: Private Accessors. ([@tim-mc](https://github.com/tim-mc))
+* `babel-plugin-proposal-pipeline-operator`, `babel-plugin-syntax-pipeline-operator`
+ * [#9179](https://github.com/babel/babel/pull/9179) Transform for the smart pipeline operator proposal. ([@thiagoarrais](https://github.com/thiagoarrais))
+* `babel-preset-env-standalone`, `babel-preset-env`
+ * [#9345](https://github.com/babel/babel/pull/9345) Add support for transform-named-capturing-groups-regex in preset-env. ([@existentialism](https://github.com/existentialism))
+* `babel-helpers`, `babel-plugin-transform-named-capturing-groups-regex`
+ * [#7105](https://github.com/babel/babel/pull/7105) Add @babel/plugin-transform-named-capturing-groups-regex. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-preset-env`
+ * [#9323](https://github.com/babel/babel/pull/9323) Add support for proposal-json-strings in preset-env. ([@existentialism](https://github.com/existentialism))
+* `babel-generator`, `babel-types`
+ * [#9309](https://github.com/babel/babel/pull/9309) Add emit and builder for TSImportType. ([@hzoo](https://github.com/hzoo))
+* `babel-parser`
+ * [#9302](https://github.com/babel/babel/pull/9302) @babel/parser(ts): Add parsing of type import. ([@armano2](https://github.com/armano2))
+
+#### :bug: Bug Fix
+* `babel-parser`
+ * [#9336](https://github.com/babel/babel/pull/9336) Disallow usage of invalid keyword after export abstract statement in Typescript. ([@armano2](https://github.com/armano2))
+ * [#9328](https://github.com/babel/babel/pull/9328) Fix handling newline with TypeScript declare and abstract classes. ([@existentialism](https://github.com/existentialism))
+ * [#9335](https://github.com/babel/babel/pull/9335) Fix range on TypeScript index signature parameters. ([@existentialism](https://github.com/existentialism))
+ * [#9292](https://github.com/babel/babel/pull/9292) Throw error if TypeScript class has empty implements. ([@existentialism](https://github.com/existentialism))
+ * [#9284](https://github.com/babel/babel/pull/9284) Fix location for typescript type assertions in AST. ([@danez](https://github.com/danez))
+ * [#9276](https://github.com/babel/babel/pull/9276) Ensure modifiers are included in TSParameterProperty ranges. ([@existentialism](https://github.com/existentialism))
+ * [#9230](https://github.com/babel/babel/pull/9230) babel-parser: typescript: add missing bigint keyword. ([@armano2](https://github.com/armano2))
+* `babel-types`
+ * [#9333](https://github.com/babel/babel/pull/9333) Copy "optional" property when cloning Identifier node. ([@unconfident](https://github.com/unconfident))
+* `babel-helper-create-class-features-plugin`, `babel-helpers`, `babel-plugin-proposal-decorators`
+ * [#9244](https://github.com/babel/babel/pull/9244) [decorators] Set method names at compile time instead of at runtime. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-helper-builder-react-jsx`, `babel-plugin-transform-react-jsx`
+ * [#9119](https://github.com/babel/babel/pull/9119) Revert "Revert babel-helper-builder-react-jsx change from #4988". ([@danez](https://github.com/danez))
+* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-private-methods`
+ * [#9248](https://github.com/babel/babel/pull/9248) [private methods] Define private methods before executing initializers. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-preset-env`
+ * [#9219](https://github.com/babel/babel/pull/9219) Fix handling scoped packages in preset-env include/exclude options. ([@existentialism](https://github.com/existentialism))
+
+#### :nail_care: Polish
+* `babel-parser`
+ * [#9348](https://github.com/babel/babel/pull/9348) Parser Performance Collection. ([@danez](https://github.com/danez))
+
+#### :memo: Documentation
+* [#9370](https://github.com/babel/babel/pull/9370) add v7 downloads [skip ci]. ([@hzoo](https://github.com/hzoo))
+
+#### :house: Internal
+* `babel-parser`
+ * [#9312](https://github.com/babel/babel/pull/9312) Merge declaration and init of props in parser's state. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-types`
+ * [#9245](https://github.com/babel/babel/pull/9245) [@babel/types] Moved generators related to babel-types into the babel-types package directory.. ([@cameron-martin](https://github.com/cameron-martin))
+* Other
+ * [#9288](https://github.com/babel/babel/pull/9288) Test262 update. ([@existentialism](https://github.com/existentialism))
+ * [#9290](https://github.com/babel/babel/pull/9290) Use 2014-present in license. ([@xtuc](https://github.com/xtuc))
+ * [#9271](https://github.com/babel/babel/pull/9271) Bump license years for 2019. ([@berlamhenderson](https://github.com/berlamhenderson))
+* `babel-helpers`
+ * [#9166](https://github.com/babel/babel/pull/9166) Add mixins support to the _decorate helper. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+## v7.2.5 (2018-12-21)
+
+`@babel/polyfill` didn't get published correctly in v7.2.3 (#9227).
+
+## v7.2.4 (2018-12-20)
+
+Minify `@babel/standalone` and `@babel/preset-env-standalone`.
+
+## v7.2.3 (2018-12-20)
+
+This is a small release, mainly to test Lerna 3.
+We force-published `@babel/polyfill` and `@babel/preset-env`, since they should have been released respectively in v7.1.0 and v7.2.2 but for different reasons they didn't get updated.
+
+Half of the commits in this release are made by first time contributors! Thanks to @cameron-martin, @cphamlet, @tanhauhau and @jedwards1211. :tada:
+
+#### :rocket: New Feature
+* [#9110](https://github.com/babel/babel/pull/9110) Added type-level mapping between aliases and nodes that have that alias. ([@cameron-martin](https://github.com/cameron-martin))
+
+#### :bug: Bug Fix
+* `babel-plugin-transform-flow-strip-types`
+ * [#9197](https://github.com/babel/babel/pull/9197) Strips flow directive fully. ([@tanhauhau](https://github.com/tanhauhau))
+* `babel-parser`
+ * [#9184](https://github.com/babel/babel/pull/9184) Allow keywords to be used in type annotations. ([@danez](https://github.com/danez))
+
+#### :house: Internal
+* `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-decorators`, `babel-plugin-proposal-private-methods`, `babel-traverse`
+ * [#9206](https://github.com/babel/babel/pull/9206) Use @babel/eslint-plugin-developement. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+## v7.2.2 (2018-12-15)
+
+Mostly bug fixes and internal changes.
+Thanks to @paleite, @saschanaz and @joeldenning for their first PRs!
+
+#### :bug: Bug Fix
+* `babel-plugin-transform-destructuring`, `babel-plugin-transform-spread`
+ * [#9108](https://github.com/babel/babel/pull/9108) Correctly transform spreads to use proper concat method. ([@danez](https://github.com/danez))
+* `babel-parser`
+ * [#9168](https://github.com/babel/babel/pull/9168) [parser] Handle flow comments with leading spaces. ([@vikr01](https://github.com/vikr01))
+* `babel-helper-module-transforms`, `babel-plugin-transform-modules-commonjs`
+ * [#9171](https://github.com/babel/babel/pull/9171) Fix transforming empty export statement. ([@danez](https://github.com/danez))
+* `babel-node`
+ * [#9148](https://github.com/babel/babel/pull/9148) Fix --root-mode option in babel-node. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-transform-classes`
+ * [#9135](https://github.com/babel/babel/pull/9135) Inherit properties in function from method in loose mode. ([@rubennorte](https://github.com/rubennorte))
+* `babel-preset-env`
+ * [#9140](https://github.com/babel/babel/pull/9140) Disable parameter-destructuring in Edge 18. ([@saschanaz](https://github.com/saschanaz))
+* `babel-plugin-transform-arrow-functions`, `babel-traverse`
+ * [#9060](https://github.com/babel/babel/pull/9060) Not depending on return value of super(). Closes [#9020](https://github.com/babel/babel/issues/9020).. ([@joeldenning](https://github.com/joeldenning))
+
+#### :house: Internal
+* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-nullish-coalescing-operator`, `babel-plugin-syntax-bigint`, `babel-plugin-transform-dotall-regex`
+ * [#9176](https://github.com/babel/babel/pull/9176) Fix package.json repository URLs. ([@paleite](https://github.com/paleite))
+* Other
+ * [#9158](https://github.com/babel/babel/pull/9158) add triage label to new issues [skip ci]. ([@danez](https://github.com/danez))
+ * [#9143](https://github.com/babel/babel/pull/9143) Fix a typo from the issue template for bugs. ([@saschanaz](https://github.com/saschanaz))
+ * [#9133](https://github.com/babel/babel/pull/9133) Move to travis vm based builds. ([@danez](https://github.com/danez))
+ * [#9132](https://github.com/babel/babel/pull/9132) Ensure we always use repository versions of babel dependencies in tests. ([@danez](https://github.com/danez))
+ * [#9131](https://github.com/babel/babel/pull/9131) Update issue templates [skip ci]. ([@hzoo](https://github.com/hzoo))
+* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-decorators`
+ * [#9059](https://github.com/babel/babel/pull/9059) Move decorators transform to @babel/helper-create-class-features-plugin. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-core`, `babel-parser`, `babel-template`
+ * [#9128](https://github.com/babel/babel/pull/9128) Fix running flow on travis and update flow. ([@danez](https://github.com/danez))
+
+## v7.2.1 (2018-12-04)
+
+This release fixes a regression introduced in v7.2.0 (https://github.com/babel/babel/issues/9120)
+
+#### :bug: Bug Fix
+* `babel-helper-create-class-features-plugin`
+ * [#9121](https://github.com/babel/babel/pull/9121) Don't use isClassPrivateMethod because it isn't supported in <7.2.0. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+## v7.2.0 (2018-12-03)
+
+You can read more about this release at https://babeljs.io/blog/2018/12/03/7.2.0.
+
+#### :rocket: New Feature
+* `babel-parser`
+ * [#8289](https://github.com/babel/babel/pull/8289) Implement Smart Pipeline proposal in @babel/parser. ([@mAAdhaTTah](https://github.com/mAAdhaTTah))
+* `babel-core`
+ * [#8986](https://github.com/babel/babel/pull/8986) Export @babel/parser#tokTypes in @babel/core. ([@kaicataldo](https://github.com/kaicataldo))
+* `babel-node`
+ * [#9078](https://github.com/babel/babel/pull/9078) Pass `rootMode` from `@babel/node`.. ([@wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg))
+* `babel-generator`, `babel-helpers`, `babel-plugin-class-features`, `babel-plugin-proposal-private-methods`, `babel-plugin-syntax-class-properties`, `babel-types`
+ * [#8654](https://github.com/babel/babel/pull/8654) Private class methods stage 3. ([@tim-mc](https://github.com/tim-mc))
+* `babel-preset-env`
+ * [#9048](https://github.com/babel/babel/pull/9048) Update mappings for node 10 in preset-env. ([@existentialism](https://github.com/existentialism))
+
+#### :bug: Bug Fix
+* `babel-parser`
+ * [#9114](https://github.com/babel/babel/pull/9114) Parse non-octals with leading zeros in non strict mode correctly. ([@danez](https://github.com/danez))
+ * [#9074](https://github.com/babel/babel/pull/9074) Disallow await inside arrow functions. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9069](https://github.com/babel/babel/pull/9069) [flow] Allow type casts in array patterns inside arrow parameters. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#9058](https://github.com/babel/babel/pull/9058) Fix compatibility between typescript and jsx plugins in interface declarations. ([@danez](https://github.com/danez))
+ * [#9055](https://github.com/babel/babel/pull/9055) Fix bug with parsing TS generic async arrow function. ([@existentialism](https://github.com/existentialism))
+ * [#9035](https://github.com/babel/babel/pull/9035) Fix parsing typescript function types with destructuring. ([@danez](https://github.com/danez))
+* `babel-helper-fixtures`, `babel-parser`
+ * [#9113](https://github.com/babel/babel/pull/9113) Ignore empty fixture directories and fix fixtures in the parser. ([@danez](https://github.com/danez))
+* `babel-preset-env`
+ * [#9091](https://github.com/babel/babel/pull/9091) Update mapping for regex unicode plugin in preset-env. ([@existentialism](https://github.com/existentialism))
+* `babel-plugin-transform-destructuring`
+ * [#8916](https://github.com/babel/babel/pull/8916) Fix destructuring assignment in arrow functions without block. ([@RubenVerborgh](https://github.com/RubenVerborgh))
+* `babel-plugin-proposal-optional-chaining`
+ * [#9073](https://github.com/babel/babel/pull/9073) Microbouji patch/8136. ([@jridgewell](https://github.com/jridgewell))
+* `babel-core`, `babel-helper-wrap-function`, `babel-plugin-proposal-async-generator-functions`, `babel-plugin-proposal-function-sent`, `babel-plugin-transform-async-to-generator`, `babel-plugin-transform-classes`
+ * [#9039](https://github.com/babel/babel/pull/9039) Fix recursive async function expressions. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-core`
+ * [#9034](https://github.com/babel/babel/pull/9034) Normalize presets before merging config with others.. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+#### :nail_care: Polish
+* `babel-generator`
+ * [#9089](https://github.com/babel/babel/pull/9089) Remove unused variable. ([@Gcaufy](https://github.com/Gcaufy))
+* `babel-node`
+ * [#9079](https://github.com/babel/babel/pull/9079) Move `fs-readdir-recursive` and `output-file-sync` to `devDependencies` for `@babel/node`.. ([@wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg))
+* `babel-parser`
+ * [#9046](https://github.com/babel/babel/pull/9046) a better error message for disallowed trailing commas/additional parameters after rest elements in function params. ([@morozRed](https://github.com/morozRed))
+* `babel-*`
+ * [#8769](https://github.com/babel/babel/pull/8769) Add plugins name. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+#### :house: Internal
+* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-private-methods`
+ * [#9083](https://github.com/babel/babel/pull/9083) Make @babel/plugin-class-features a normal helper package. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* Other
+ * [#9096](https://github.com/babel/babel/pull/9096) Add node 11 to CI and remove node 9. ([@danez](https://github.com/danez))
+ * [#9094](https://github.com/babel/babel/pull/9094) Skip minifying standalone in non-publish runs. ([@danez](https://github.com/danez))
+* `babel-types`
+ * [#9093](https://github.com/babel/babel/pull/9093) Fix warning when using prettier in code generators. ([@danez](https://github.com/danez))
+* `babel-generator`
+ * [#9089](https://github.com/babel/babel/pull/9089) Remove unused variable. ([@Gcaufy](https://github.com/Gcaufy))
+
+## v7.1.6 (2018-11-13)
+
+#### :bug: Bug Fix
+* `babel-generator`
+ * [#9003](https://github.com/babel/babel/pull/9003) Fix retainLines regression for arrow functions. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-types`
+ * [#8997](https://github.com/babel/babel/pull/8997) Fix cloneNode with typeAnnotation.. ([@neoziro](https://github.com/neoziro))
+* `babel-plugin-transform-flow-strip-types`, `babel-plugin-transform-react-jsx`
+ * [#8701](https://github.com/babel/babel/pull/8701) Fix "TypeError: comments is not iterable". ([@AlicanC](https://github.com/AlicanC))
+* `babel-core`
+ * [#9004](https://github.com/babel/babel/pull/9004) Fix browser files to have the same API as the nodejs ones. ([@danez](https://github.com/danez))
+* Other
+ * [#9007](https://github.com/babel/babel/pull/9007) [Types] fix generated TS/Flow comment types. ([@ljqx](https://github.com/ljqx))
+* `babel-preset-env`
+ * [#8555](https://github.com/babel/babel/pull/8555) preset-env: fix `opera` from `esmodules` target and Browserslist not used. ([@ylemkimon](https://github.com/ylemkimon))
+* `babel-plugin-proposal-decorators`, `babel-traverse`
+ * [#8970](https://github.com/babel/babel/pull/8970) [decorators] Correctly insert `_initialize(this)` after `super()`.. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-parser`
+ * [#8972](https://github.com/babel/babel/pull/8972) Fix several edge cases with context expression state. ([@danez](https://github.com/danez))
+
+#### :nail_care: Polish
+* `babel-parser`
+ * [#8984](https://github.com/babel/babel/pull/8984) Rename primitive types to reserved types. ([@danez](https://github.com/danez))
+
+#### :house: Internal
+* [#8982](https://github.com/babel/babel/pull/8982) fix publish command [skip ci]. ([@hzoo](https://github.com/hzoo))
+* [#8988](https://github.com/babel/babel/pull/8988) Remove definition of micromatch which was removed.. ([@danez](https://github.com/danez))
+
+## v7.1.5 (2018-11-06)
+
+#### :eyeglasses: Spec Compliancy
+* `babel-parser`, `babylon`
+ * [#7727](https://github.com/babel/babel/pull/7727) Fix await in function name and parameters. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+#### :rocket: New Feature
+* `babel-parser`
+ * [#8828](https://github.com/babel/babel/pull/8828) Typescript: Validate tuple type element positions. ([@Retsam](https://github.com/Retsam))
+ * [#8883](https://github.com/babel/babel/pull/8883) [flow] Add support for parsing `_` as implicit instantiation in call/new. ([@jbrown215](https://github.com/jbrown215))
+* `babel-core`, `babel-generator`, `babel-parser`, `babel-plugin-syntax-typescript`, `babel-traverse`
+ * [#8448](https://github.com/babel/babel/pull/8448) Remove Babylon plugins for features already merged to the ECMAScript spec. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-parser`, `babel-types`
+ * [#8884](https://github.com/babel/babel/pull/8884) [flow] Explicit inexact objects with `...`. ([@jbrown215](https://github.com/jbrown215))
+* `babel-preset-env`
+ * [#8898](https://github.com/babel/babel/pull/8898) Update preset-env data. ([@existentialism](https://github.com/existentialism))
+
+#### :bug: Bug Fix
+* `babel-parser`
+ * [#8956](https://github.com/babel/babel/pull/8956) Do not allow TypeCastExpressions w/o parens . ([@danez](https://github.com/danez))
+ * [#8954](https://github.com/babel/babel/pull/8954) Allow function types in type params within arrow return types. ([@danez](https://github.com/danez))
+ * [#8866](https://github.com/babel/babel/pull/8866) Closes [#8865](https://github.com/babel/babel/issues/8865). ([@byronluk](https://github.com/byronluk))
+* `babel-core`
+ * [#8910](https://github.com/babel/babel/pull/8910) Resolve babel.config.js 'babelrcRoots' values relative to the config file.. ([@loganfsmyth](https://github.com/loganfsmyth))
+ * [#8950](https://github.com/babel/babel/pull/8950) Fix message when plugin of a wrong type is passed. ([@everdimension](https://github.com/everdimension))
+* `babel-plugin-transform-block-scoping`
+ * [#8937](https://github.com/babel/babel/pull/8937) rename colliding let bindings with for loop init. ([@byronluk](https://github.com/byronluk))
+ * [#8914](https://github.com/babel/babel/pull/8914) Treat break inside block inside loop. ([@thiagoarrais](https://github.com/thiagoarrais))
+* `babel-preset-env`
+ * [#8926](https://github.com/babel/babel/pull/8926) preset-env: Edge support for arrow param destructuring. ([@benmosher](https://github.com/benmosher))
+* `babel-generator`
+ * [#8868](https://github.com/babel/babel/pull/8868) fix single-arg async arrows when retainLines=true. ([@ryanwmarsh](https://github.com/ryanwmarsh))
+* `babel-traverse`
+ * [#8880](https://github.com/babel/babel/pull/8880) fix: Expression x === 'y' && '' should not evaluate to undefined.. ([@Cyp](https://github.com/Cyp))
+
+#### :nail_care: Polish
+* [#8873](https://github.com/babel/babel/pull/8873) fixed an extra word. ([@vvyomjjain](https://github.com/vvyomjjain))
+
+## v7.1.4 (2018-10-11)
+
+Just re-published `@babel/traverse` without `**` so that it works in Node 6.
+
+## v7.1.3 (2018-10-11)
+
+#### :bug: Bug Fix
+* `babel-generator`, `babel-parser`, `babel-plugin-transform-typescript`, `babel-types`
+ * [#8720](https://github.com/babel/babel/pull/8720) Typescript - Tuple elements can be optional. ([@Retsam](https://github.com/Retsam))
+* `babel-traverse`
+ * [#8833](https://github.com/babel/babel/pull/8833) Insertafter jsx fix. ([@kevintab95](https://github.com/kevintab95))
+* `babel-parser`
+ * [#8830](https://github.com/babel/babel/pull/8830) Correct handling of newline after async with paren-less arrow func. ([@Retsam](https://github.com/Retsam))
+ * [#8756](https://github.com/babel/babel/pull/8756) class private methods and properties: should not allow spaces between # and identifier. ([@macabeus](https://github.com/macabeus))
+ * [#8804](https://github.com/babel/babel/pull/8804) Fix parsing of slash after class expression. ([@existentialism](https://github.com/existentialism))
+ * [#8767](https://github.com/babel/babel/pull/8767) [decorators] [typescript] Parse type parameters. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#8792](https://github.com/babel/babel/pull/8792) Fix perf issue in typescript parser plugin. ([@matthewrobertson](https://github.com/matthewrobertson))
+* `babel-generator`, `babel-parser`, `babel-plugin-transform-typescript`, `babel-types`
+ * [#8805](https://github.com/babel/babel/pull/8805) Typescript - Tuples can include rest elements. ([@Retsam](https://github.com/Retsam))
+* `babel-types`
+ * [#8791](https://github.com/babel/babel/pull/8791) types: allow jsxEmptyExpression inside jsxExpressionContainer. ([@tvooo](https://github.com/tvooo))
+* `babel-plugin-transform-modules-systemjs`
+ * [#8820](https://github.com/babel/babel/pull/8820) System module format - fixes function hoisting failure case. ([@guybedford](https://github.com/guybedford))
+* `babel-plugin-transform-destructuring`
+ * [#8793](https://github.com/babel/babel/pull/8793) Ensure destructuring's computed key handling matches object-rest-spread. ([@existentialism](https://github.com/existentialism))
+
+## 7.1.2 (2018-09-28)
+
+Same as v7.1.1, except compiled against Node 6 instead of Node 8 by accident (e.g had `async functions`).
+
+## v7.1.1 (2018-09-28)
+
+> EDIT: had a publish issue here as well where it compiled against Node 8 instead of Node 6 so 7.1.2 will fix this.
+> Also force publish `@babel/runtime` and `@babel/runtime-corejs2`. We need to fix the publishing around that since Lerna doesn't pickup the `@babel/helpers` changes as there is no "dependency"
+
+#### :bug: Bug Fix
+* `babel-generator`, `babel-parser`, `babel-types`
+ * [#8755](https://github.com/babel/babel/pull/8755) TypeScript: reserve `unknown` as TSUnknownKeyword. ([@g-plane](https://github.com/g-plane))
+* `babel-plugin-transform-destructuring`
+ * [#8535](https://github.com/babel/babel/pull/8535) Do not unpack array patterns that update a referenced binding. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-plugin-proposal-decorators`
+ * [#8742](https://github.com/babel/babel/pull/8742) [decorators] Support async and generator methods. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-helpers`, `babel-plugin-proposal-decorators`
+ * [#8761](https://github.com/babel/babel/pull/8761) [decorators] Fields are enumerable. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-generator`
+ * [#8751](https://github.com/babel/babel/pull/8751) Fix some missing parens cases with OptionalMemberExpression in generator. ([@existentialism](https://github.com/existentialism))
+ * [#8727](https://github.com/babel/babel/pull/8727) Handle throw expressions in generator. ([@existentialism](https://github.com/existentialism))
+
+#### :house: Internal
+* Other
+ * [#8780](https://github.com/babel/babel/pull/8780) Run test262 tests for exportNamespaceFrom. ([@existentialism](https://github.com/existentialism))
+* `babel-helper-transform-fixture-test-runner`
+ * [#8768](https://github.com/babel/babel/pull/8768) Use babel-check-duplicated-nodes. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+## v7.1.0 (2018-09-17)
+
+Check http://babeljs.io/blog/2018/09/17/7.1.0
+
+#### :rocket: New Feature
+* `babel-cli`, `babel-core`
+ * [#8660](https://github.com/babel/babel/pull/8660) Better support monorepos by allowing users to opt into automatically resolving 'root' with `rootMode: "upward"`.. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-helper-transform-fixture-test-runner`
+ * [#7582](https://github.com/babel/babel/pull/7582) Allow regular plugins/presets resolution algorithm for packages outsi…. ([@Andarist](https://github.com/Andarist))
+* `babel-helpers`, `babel-plugin-proposal-decorators`, `babel-plugin-syntax-decorators`
+ * [#7976](https://github.com/babel/babel/pull/7976) Add support for the new decorators proposal. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-helpers`, `babel-plugin-proposal-class-properties`
+ * [#8205](https://github.com/babel/babel/pull/8205) Private Static Fields Features: Stage 3. ([@rricard](https://github.com/rricard))
+
+#### :bug: Bug Fix
+* `babel-parser`
+ * [#8698](https://github.com/babel/babel/pull/8698) Fix parsing of newline between 'async' and 'function'. ([@existentialism](https://github.com/existentialism))
+ * [#8677](https://github.com/babel/babel/pull/8677) Fix typescript parsing typed object shorthand methods. ([@existentialism](https://github.com/existentialism))
+* `babel-plugin-transform-typescript`
+ * [#8682](https://github.com/babel/babel/pull/8682) Fix TSParameterProperty getting lost with transform-classes. ([@existentialism](https://github.com/existentialism))
+ * [#8695](https://github.com/babel/babel/pull/8695) Adjust TSParameterProperty handling to work with transform-parameters. ([@existentialism](https://github.com/existentialism))
+ * [#8666](https://github.com/babel/babel/pull/8666) Fix typescript import elision. ([@Retsam](https://github.com/Retsam))
+* `babel-preset-env`
+ * [#8693](https://github.com/babel/babel/pull/8693) Fix es6.string.iterator mapping in babel-preset-env. ([@existentialism](https://github.com/existentialism))
+* `babel-core`, `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-decorators`, `babel-plugin-transform-runtime`
+ * [#8659](https://github.com/babel/babel/pull/8659) Fix version checks in .availableHelper and transform-runtime definitions.. ([@loganfsmyth](https://github.com/loganfsmyth))
+* Other
+ * [#8627](https://github.com/babel/babel/pull/8627) ts generator: allow reserved keywords in interfaces. ([@43081j](https://github.com/43081j))
+* `babel-plugin-transform-parameters`
+ * [#8414](https://github.com/babel/babel/pull/8414) Allow patterns as argument of RestElement. ([@microbouji](https://github.com/microbouji))
+* `babel-core`, `babel-plugin-transform-runtime`
+ * [#8624](https://github.com/babel/babel/pull/8624) Verify 'sourceMap' option with hasOwnProperty, and verify string-typed 'version'. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-helpers`, `babel-plugin-proposal-class-properties`
+ * [#8614](https://github.com/babel/babel/pull/8614) [static private] Unify loose handling of static and instance props. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+#### :nail_care: Polish
+* `babel-plugin-transform-runtime`
+ * [#8581](https://github.com/babel/babel/pull/8581) Fix grammar in error message at @babel/plugin-transform-runtime. ([@tricknotes](https://github.com/tricknotes))
+* `babel-parser`
+ * [#8576](https://github.com/babel/babel/pull/8576) More helpful errorr message for missing decoratorsBeforeExport in parser. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+#### :memo: Documentation
+* [#8561](https://github.com/babel/babel/pull/8561) Added pronounciation of babel. ([@siddhant1](https://github.com/siddhant1))
+
+#### :house: Internal
+* `babel-core`
+ * [#8714](https://github.com/babel/babel/pull/8714) Fix Flow error with new versionRange test.. ([@loganfsmyth](https://github.com/loganfsmyth))
+* Other
+ * [#8679](https://github.com/babel/babel/pull/8679) remove force publish, temp tag [skip ci]. ([@hzoo](https://github.com/hzoo))
+* `babel-plugin-transform-runtime`
+ * [#8661](https://github.com/babel/babel/pull/8661) Makefile: run fix json on fix. ([@xtuc](https://github.com/xtuc))
+* `babel-*`
+ * [#8658](https://github.com/babel/babel/pull/8658) Format fixture options.json with Prettier.. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-parser`
+ * [#8630](https://github.com/babel/babel/pull/8630) Bump flow to 0.80 and fix sourceType error. ([@existentialism](https://github.com/existentialism))
+ * [#8610](https://github.com/babel/babel/pull/8610) types: missing `unambiguous` sourceType. ([@xtuc](https://github.com/xtuc))
+ * [#8170](https://github.com/babel/babel/pull/8170) @babel/parser: expose a TypeScript definition file from package. ([@AviVahl](https://github.com/AviVahl))
+* `babel-*`
+ * [#8573](https://github.com/babel/babel/pull/8573) add access public to all packages [skip ci]. ([@hzoo](https://github.com/hzoo))
+
+## v7.0.1 (2018-09-11)
+
+Doing a quick patch regarding helpers versioning to prevent future issues: https://github.com/babel/babel/pull/8659
+
+## v7.0.0 (2018-08-27)
+
+No change from rc.4. Finally released as https://babeljs.io/blog/2018/08/27/7.0.0!
+
+## v7.0.0-rc.4 (2018-08-27)
+
+> Similar to removing proposals in `@babel/polyfill`, we are removing them in `transform-runtime`
+
+#### :boom: Breaking Change
+* `babel-plugin-transform-runtime`
+ * [#8547](https://github.com/babel/babel/pull/8547) Remove nonstandard functions and fake prototype methods from babel-runtime. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-parser`
+ * [#8539](https://github.com/babel/babel/pull/8539) Update parser whitespace for clarity. ([@jridgewell](https://github.com/jridgewell))
+
+#### :bug: Bug Fix
+* `babel-register`
+ * [#8553](https://github.com/babel/babel/pull/8553) bump source-map-support. ([@hzoo](https://github.com/hzoo))
+* `babel-core`
+ * [#8546](https://github.com/babel/babel/pull/8546) Default highlightCode:true for the parser highlighting.. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+#### :house: Internal
+* Other
+ * [#8554](https://github.com/babel/babel/pull/8554) Lerna: remove exact [skip ci]. ([@hzoo](https://github.com/hzoo))
+* `babel-parser`
+ * [#8540](https://github.com/babel/babel/pull/8540) Cleanup getLineInfo. ([@jridgewell](https://github.com/jridgewell))
+ * [#8541](https://github.com/babel/babel/pull/8541) Update to ES6 String methods. ([@jridgewell](https://github.com/jridgewell))
+ * [#8537](https://github.com/babel/babel/pull/8537) Flatten TokenType class hierarchy. ([@jridgewell](https://github.com/jridgewell))
+ * [#8539](https://github.com/babel/babel/pull/8539) Update parser whitespace for clarity. ([@jridgewell](https://github.com/jridgewell))
+
+## v7.0.0-rc.3 (2018-08-24)
+
+#### :boom: Breaking Change
+* `babel-preset-env`
+ * [#8509](https://github.com/babel/babel/pull/8509) Add browserslist 4 support.. ([@yavorsky](https://github.com/yavorsky))
+* `babel-plugin-transform-runtime`
+ * [#8518](https://github.com/babel/babel/pull/8518) Make 'useESModules' only toggle CJS vs ESM helpers when importing file is ESM.. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+#### :rocket: New Feature
+* `babel-plugin-transform-runtime`
+ * [#8520](https://github.com/babel/babel/pull/8520) Expose opt-in useESModules:"auto" from transform-runtime to toggle based on 'supportsStaticESM'. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+#### :bug: Bug Fix
+* `babel-helpers`, `babel-plugin-transform-classes`, `babel-preset-env`
+ * [#8501](https://github.com/babel/babel/pull/8501) [_wrapNativeSuper] Don't wrap non-native constructors. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-generator`, `babel-traverse`, `babel-types`
+ * [#8478](https://github.com/babel/babel/pull/8478) Fix path.scope.rename() to not change break clauses. ([@rafeca](https://github.com/rafeca))
+* `babel-plugin-proposal-object-rest-spread`
+ * [#8514](https://github.com/babel/babel/pull/8514) fix: object rest with default values bug. ([@jquense](https://github.com/jquense))
+* `babel-traverse`
+ * [#8505](https://github.com/babel/babel/pull/8505) Rename exported functions where name conflicts with param.. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+#### :house: Internal
+* `babel-plugin-transform-object-set-prototype-of-to-assign`
+ * [#8409](https://github.com/babel/babel/pull/8409) Add LICENSE file to published npm packages [skip ci]. ([@opichals](https://github.com/opichals))
+* Other
+ * [#8504](https://github.com/babel/babel/pull/8504) Update Babel to rc.2. ([@hzoo](https://github.com/hzoo))
+
+## v7.0.0-rc.2 (2018-08-21)
+
+A notable change is the addition of https://github.com/babel/babel/pull/8485 which enables https://github.com/babel/babel-loader/pull/660 (automatically doing `modules: false` for `@babel/preset-env` when using `babel-loader`.
+
+#### :boom: Breaking Change
+* `babel-core`
+ * [#8470](https://github.com/babel/babel/pull/8470) Remove File#resolveModuleSource. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+ * [#8473](https://github.com/babel/babel/pull/8473) Allow babel-plugin/preset prefix to not be a prefix, when used in a scope.. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-core`, `babel-parser`, `babel-plugin-syntax-decorators`
+ * [#8465](https://github.com/babel/babel/pull/8465) Require decoratorsBeforeExport option for decorators. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+#### :rocket: New Feature
+* `babel-preset-env`
+ * [#8500](https://github.com/babel/babel/pull/8500) Add missing es7.promise.finally polyfill when using useBuiltIns: usage. ([@jsnajdr](https://github.com/jsnajdr))
+* `babel-cli`, `babel-core`, `babel-node`, `babel-preset-env`, `babel-register`
+ * [#8485](https://github.com/babel/babel/pull/8485) Allow preset-env to toggle module handling based on flags from the caller (like babel-loader). ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-core`
+ * [#8474](https://github.com/babel/babel/pull/8474) Preserve 'false'-options for disabled plugins/presets.. ([@loganfsmyth](https://github.com/loganfsmyth))
+ * [#8473](https://github.com/babel/babel/pull/8473) Allow babel-plugin/preset prefix to not be a prefix, when used in a scope.. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-helper-transform-fixture-test-runner`, `babel-plugin-transform-runtime`
+ * [#8435](https://github.com/babel/babel/pull/8435) Allow transform-runtime to insert runtime references with absolute paths.. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+#### :bug: Bug Fix
+* `babel-parser`
+ * [#8488](https://github.com/babel/babel/pull/8488) Fix trailingComments for FunctionExpression that is CallExpression arguments. ([@jiaxuan](https://github.com/jiaxuan))
+* `babel-core`
+ * [#8493](https://github.com/babel/babel/pull/8493) Take top-level config source into consideration when processing nested env/overrides.. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-helpers`, `babel-plugin-proposal-decorators`
+ * [#7429](https://github.com/babel/babel/pull/7429) Fix default descriptor setting for class properties with decorators. ([@yhpark](https://github.com/yhpark))
+* `babel-plugin-transform-parameters`
+ * [#8479](https://github.com/babel/babel/pull/8479) Fixes setter paratemer default value. ([@nikolayemrikh](https://github.com/nikolayemrikh))
+
+#### :nail_care: Polish
+* `babel-core`
+ * [#8494](https://github.com/babel/babel/pull/8494) Cache individual programmatic descriptors along with the overall list.. ([@loganfsmyth](https://github.com/loganfsmyth))
+ * [#8493](https://github.com/babel/babel/pull/8493) Take top-level config source into consideration when processing nested env/overrides.. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+#### :house: Internal
+* `babel-core`
+ * [#8493](https://github.com/babel/babel/pull/8493) Take top-level config source into consideration when processing nested env/overrides.. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-plugin-transform-classes`
+ * [#8472](https://github.com/babel/babel/pull/8472) Remove unused file. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+
+## v7.0.0-rc.1 (2018-08-09)
+
+Same as rc.0 but fixes the peerDep issue #8443. It's changed to just be ^7.0.0-0
+
+## v7.0.0-rc.0 (2018-08-09)
+
+> This had an issue with `peerDependencies` so please use `rc.1`.
+
+Alright finally at the end 🙂. Shouldn't have anymore breaking changes and going to wait some time to fix bugs/regressions
+
+> Summary: `@babel/polyfill` will not include proposal polyfills by default and fixed a regression.
+
+#### :boom: Breaking Change
+* `babel-polyfill`
+ * [#8440](https://github.com/babel/babel/pull/8440) remove proposals polyfills from default import [skip ci]. ([@hzoo](https://github.com/hzoo))
+
+> Will add this to the upgrade guide/polyfill docs. I guess we could include a `babel-upgrade` for this too, not sure.
+
+#### :bug: Bug Fix
+* `babel-cli`
+ * [#8436](https://github.com/babel/babel/pull/8436) Require v1.1.0 so that correct filter params are passed.. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+## v7.0.0-beta.56 (2018-08-03)
+
+- Separate `@babel/runtime`: should work for helpers alone and opt-into core-js if necessary.
+- More details in http://babeljs.io/docs/en/next/babel-runtime, http://babeljs.io/docs/en/next/babel-plugin-transform-runtime (via https://github.com/babel/babel/pull/8266, https://github.com/babel/website/pull/1714)
+- `babel-upgrade` issue: https://github.com/babel/babel-upgrade/issues/70
+
+#### :boom: Breaking Change
+* `babel-plugin-transform-regenerator`, `babel-plugin-transform-runtime`, `babel-runtime-corejs2`, `babel-runtime`
+ * [#8266](https://github.com/babel/babel/pull/8266) Split @babel/runtime into 2 modules via @babel/runtime-corejs2. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-core`, `babel-helper-module-imports`, `babel-helpers`, `babel-plugin-external-helpers`, `babel-plugin-transform-runtime`
+ * [#8398](https://github.com/babel/babel/pull/8398) Only reference helpers from external/runtime helpers if they are known to be available.. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+#### :rocket: New Feature
+* `babel-plugin-transform-regenerator`, `babel-plugin-transform-runtime`, `babel-runtime-corejs2`, `babel-runtime`
+ * [#8266](https://github.com/babel/babel/pull/8266) Split @babel/runtime into 2 modules via @babel/runtime-corejs2. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+#### :bug: Bug Fix
+* `babel-parser`, `babel-plugin-transform-typescript`
+ * [#8408](https://github.com/babel/babel/pull/8408) Allow TSInterfaceDeclaration to be default export. ([@existentialism](https://github.com/existentialism))
+* `babel-preset-env`
+ * [#8403](https://github.com/babel/babel/pull/8403) Ensure esmodule targets are parsed by browserslist. ([@existentialism](https://github.com/existentialism))
+* Other
+ * [#8024](https://github.com/babel/babel/pull/8024) Run transform-runtime on the standalone bundle so it stays ES5-compatible.. ([@loganfsmyth](https://github.com/loganfsmyth))
+
+#### :memo: Documentation
+* [#8412](https://github.com/babel/babel/pull/8412) Update Documentation[skip ci]. ([@leongjiameng](https://github.com/leongjiameng))
+
+## v7.0.0-beta.55 (2018-07-28)
+
+Breaking Change in beta:
+
+> Throws an error on using Stage presets: https://babeljs.io/blog/2018/07/27/removing-babels-stage-presets
+
+#### :boom: Breaking Change
+* `babel-core`, `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-decorators`, `babel-preset-stage-0`, `babel-preset-stage-1`, `babel-preset-stage-2`, `babel-preset-stage-3`, `babel-standalone`
+ * [#8293](https://github.com/babel/babel/pull/8293) Remove Stage presets. ([@hzoo](https://github.com/hzoo))
+
+#### :rocket: New Feature
+* `babel-generator`, `babel-parser`, `babel-plugin-transform-typescript`, `babel-types`
+ * [#7754](https://github.com/babel/babel/pull/7754) TypeScript: Support type arguments on tagged templates. ([@andy-ms](https://github.com/andy-ms))
+
+#### :bug: Bug Fix
+* `babel-cli`, `babel-core`, `babel-generator`
+ * [#8380](https://github.com/babel/babel/pull/8380) Ensure that Identifier source mappings explicitly start and stop on the generated range. ([@loganfsmyth](https://github.com/loganfsmyth))
+* `babel-preset-env`
+ * [#8391](https://github.com/babel/babel/pull/8391) Ensure preset-env doesn't clobber browserslist defaults. ([@existentialism](https://github.com/existentialism))
+* `babel-core`
+ * [#8376](https://github.com/babel/babel/pull/8376) Fix order of optional argument reordering. ([@Qix-](https://github.com/Qix-))
+ * [#8381](https://github.com/babel/babel/pull/8381) Allow an Array for `babelrcRoots`.. ([@wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg))
+ * [#8342](https://github.com/babel/babel/pull/8342) Do not mutate ast. ([@thiagoarrais](https://github.com/thiagoarrais))
+* `babel-parser`
+ * [#8374](https://github.com/babel/babel/pull/8374) Correctly parse interface methods named 'static'. ([@bakkot](https://github.com/bakkot))
+
+#### :nail_care: Polish
+* `babel-parser`
+ * [#8355](https://github.com/babel/babel/pull/8355) remove .then from `dynamic import` parser exception message. ([@dnalborczyk](https://github.com/dnalborczyk))
+
+#### :house: Internal
+* `babel-core`, `babel-preset-stage-0`, `babel-preset-stage-1`, `babel-preset-stage-2`, `babel-preset-stage-3`, `babel-standalone`
+ * [#8397](https://github.com/babel/babel/pull/8397) Remove our own use of stage presets. ([@hzoo](https://github.com/hzoo))
+* `babel-helpers`, `babel-plugin-proposal-class-properties`
+ * [#8318](https://github.com/babel/babel/pull/8318) Save full descriptor instead of only value for private fields.. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
+* `babel-core`
+ * [#8381](https://github.com/babel/babel/pull/8381) Allow an Array for `babelrcRoots`.. ([@wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg))
+* `babel-cli`, `babel-core`, `babel-generator`, `babel-helper-define-map`, `babel-helper-fixtures`, `babel-helper-module-imports`, `babel-helper-module-transforms`, `babel-helper-regex`, `babel-helper-simple-access`, `babel-helper-transform-fixture-test-runner`, `babel-node`, `babel-plugin-transform-block-scoping`, `babel-register`, `babel-template`, `babel-traverse`, `babel-types`
+ * [#8377](https://github.com/babel/babel/pull/8377) Bumped lodash to 4.17.10. ([@Berkmann18](https://github.com/Berkmann18))
+
## v7.0.0-beta.54 (2018-07-16)
> Regarding https://github.com/babel/babel/issues/8184, we aren't using `micromatch` for paths, just basic `*/**` substitution now. For anything more complicated we will recommend using a regex/`.js` config.
@@ -40,7 +1052,7 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0
## v7.0.0-beta.53 (2018-07-11)
- Fix for regression with paths on windows due to micromatch upgrade, remove yearly presets (not published)
-- (There was an issue with the Stage presets in this release, but it is also deprecated)
+- (There was an issue with the Stage presets in this release, but it is also deprecated)
#### :boom: Breaking Change
* `babel-*`
@@ -1694,7 +2706,7 @@ Initial release of typescript equivalent of how Babel handles flow with a new `b
* `babel-plugin-check-es2015-constants`
* [#5930](https://github.com/babel/babel/pull/5930) Spec compliancy of check-es2015-constants plugin. ([@maurobringolf](https://github.com/maurobringolf))
-> Instead of throwing a compile time error when const is violated, Babel should insert a throw statement before the violation.
+> 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`
@@ -2261,7 +3273,7 @@ Also started Babel to compile itself with Babel 7! (We'll be working on making i
#### :nail_care: Polish
* `babel-register`
- * [#5411](https://github.com/babel/babel/pull/5411) Seperate version env cache files. ([@pwmckenna](https://github.com/pwmckenna))
+ * [#5411](https://github.com/babel/babel/pull/5411) Separate version env cache files. ([@pwmckenna](https://github.com/pwmckenna))
#### :memo: Documentation
* `babel-plugin-transform-runtime`
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9c5a3ec7910c..e7b9bd953b54 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -310,7 +310,7 @@ Note that the code shown in Chrome DevTools is compiled code and therefore diffe
- Create a new issue that describes the proposal (ex: [#538](https://github.com/babel/babylon/issues/538)). Include any relevant information like proposal repo/author, examples, parsing approaches, meeting notes, presentation slides, and more.
- The pull request should include:
- [ ] An update to the [plugins](https://github.com/babel/babel/tree/master/packages/babel-parser#plugins) part of the readme. Add a new entry to that list for the new plugin flag (and link to the proposal)
- - [ ] If any new nodes or modifications need to be added to the AST, update [ast/spec.md](https://github.com/babel/babel/bloc/master/packages/babel-parser/ast/spec.md)
+ - [ ] If any new nodes or modifications need to be added to the AST, update [ast/spec.md](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md)
- [ ] Make sure you use the `this.hasPlugin("plugin-name-here")` check in the babel parser so that your new plugin code only runs when that flag is turned on (not default behavior)
- [ ] Add failing/passing tests according to spec behavior
- Start working about the Babel transform itself!
diff --git a/Gulpfile.js b/Gulpfile.js
index a03b34f15915..5df9882ca3f2 100644
--- a/Gulpfile.js
+++ b/Gulpfile.js
@@ -6,19 +6,17 @@ const chalk = require("chalk");
const newer = require("gulp-newer");
const babel = require("gulp-babel");
const gulpWatch = require("gulp-watch");
-const gutil = require("gulp-util");
+const fancyLog = require("fancy-log");
const filter = require("gulp-filter");
const gulp = require("gulp");
const path = require("path");
const webpack = require("webpack");
const merge = require("merge-stream");
-const rollup = require("rollup-stream");
-const source = require("vinyl-source-stream");
-const buffer = require("vinyl-buffer");
+const rollup = require("rollup");
const rollupBabel = require("rollup-plugin-babel");
const rollupNodeResolve = require("rollup-plugin-node-resolve");
-const registerStandalonePackageTask = require("./scripts/gulp-tasks")
- .registerStandalonePackageTask;
+const rollupReplace = require("rollup-plugin-replace");
+const { registerStandalonePackageTask } = require("./scripts/gulp-tasks");
const sources = ["codemods", "packages"];
@@ -36,13 +34,9 @@ function getIndexFromPackage(name) {
return `${name}/src/index.js`;
}
-function compilationLogger(rollup) {
+function compilationLogger() {
return through.obj(function(file, enc, callback) {
- gutil.log(
- `Compiling '${chalk.cyan(file.relative)}'${
- rollup ? " with rollup " : ""
- }...`
- );
+ fancyLog(`Compiling '${chalk.cyan(file.relative)}'...`);
callback(null, file);
});
}
@@ -50,7 +44,7 @@ function compilationLogger(rollup) {
function errorsLogger() {
return plumber({
errorHandler(err) {
- gutil.log(err.stack);
+ fancyLog(err.stack);
},
});
}
@@ -91,32 +85,40 @@ function buildBabel(exclude) {
}
function buildRollup(packages) {
- return merge(
+ return Promise.all(
packages.map(pkg => {
- return rollup({
- input: getIndexFromPackage(pkg),
- format: "cjs",
- plugins: [
- rollupBabel({
- envName: "babel-parser",
- }),
- rollupNodeResolve(),
- ],
- })
- .pipe(source("index.js"))
- .pipe(buffer())
- .pipe(errorsLogger())
- .pipe(compilationLogger(/* rollup */ true))
- .pipe(gulp.dest(path.join(pkg, "lib")));
+ const input = getIndexFromPackage(pkg);
+ fancyLog(`Compiling '${chalk.cyan(input)}' with rollup ...`);
+ return rollup
+ .rollup({
+ input,
+ plugins: [
+ rollupReplace({
+ "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
+ }),
+ rollupBabel({
+ envName: "babel-parser",
+ }),
+ rollupNodeResolve(),
+ ],
+ })
+ .then(bundle => {
+ return bundle.write({
+ file: path.join(pkg, "lib/index.js"),
+ format: "cjs",
+ name: "babel-parser",
+ sourcemap: process.env.NODE_ENV !== "production",
+ });
+ });
})
);
}
-gulp.task("build", function() {
- const bundles = ["packages/babel-parser"];
+const bundles = ["packages/babel-parser"];
- return merge([buildBabel(/* exclude */ bundles), buildRollup(bundles)]);
-});
+gulp.task("build-rollup", () => buildRollup(bundles));
+gulp.task("build-babel", () => buildBabel(/* exclude */ bundles));
+gulp.task("build", gulp.parallel("build-rollup", "build-babel"));
gulp.task("default", gulp.series("build"));
@@ -138,7 +140,7 @@ registerStandalonePackageTask(
"babel",
"Babel",
path.join(__dirname, "packages"),
- require("./packages/babel-core/package.json").version
+ require("./packages/babel-standalone/package.json").version
);
const presetEnvWebpackPlugins = [
@@ -167,6 +169,6 @@ registerStandalonePackageTask(
"babel-preset-env",
"babelPresetEnv",
path.join(__dirname, "packages"),
- require("./packages/babel-preset-env/package.json").version,
+ require("./packages/babel-preset-env-standalone/package.json").version,
presetEnvWebpackPlugins
);
diff --git a/LICENSE b/LICENSE
index a06ec0e70f28..f31575ec773b 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
+Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/Makefile b/Makefile
index 0e50484068f1..5fa5cb0cfdbf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
MAKEFLAGS = -j1
-FLOW_COMMIT = bea8b83f50f597454941d2a7ecef6e93a881e576
-TEST262_COMMIT = f90a52b39609a620c0854e0bd0b3a906c930fd17
+FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9
+TEST262_COMMIT = de567d3aa5de4eaa11e00131d26b9fe77997dfb0
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
export FORCE_COLOR = true
@@ -11,12 +11,13 @@ SOURCES = packages codemods
build: clean clean-lib
./node_modules/.bin/gulp build
+ node ./packages/babel-standalone/scripts/generate.js
node ./packages/babel-types/scripts/generateTypeHelpers.js
# call build again as the generated files might need to be compiled again.
./node_modules/.bin/gulp build
# generate flow and typescript typings
- node scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
- node scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts
+ node packages/babel-types/scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
+ node packages/babel-types/scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts
ifneq ("$(BABEL_COVERAGE)", "true")
make build-standalone
make build-preset-env-standalone
@@ -28,6 +29,12 @@ build-standalone:
build-preset-env-standalone:
./node_modules/.bin/gulp build-babel-preset-env-standalone
+prepublish-build-standalone:
+ BABEL_ENV=production IS_PUBLISH=true ./node_modules/.bin/gulp build-babel-standalone
+
+prepublish-build-preset-env-standalone:
+ BABEL_ENV=production IS_PUBLISH=true ./node_modules/.bin/gulp build-babel-preset-env-standalone
+
build-dist: build
cd packages/babel-polyfill; \
scripts/build-dist.sh
@@ -40,7 +47,8 @@ watch: clean clean-lib
# development too.
BABEL_ENV=development ./node_modules/.bin/gulp build-no-bundle
node ./packages/babel-types/scripts/generateTypeHelpers.js
- node scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
+ node packages/babel-types/scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
+ node packages/babel-types/scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts
BABEL_ENV=development ./node_modules/.bin/gulp watch
flow:
@@ -56,6 +64,7 @@ fix-json:
./node_modules/.bin/prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn
clean: test-clean
+ rm -f .npmrc
rm -rf packages/babel-polyfill/browser*
rm -rf packages/babel-polyfill/dist
rm -rf coverage
@@ -82,7 +91,7 @@ test-ci-coverage:
bootstrap-flow:
rm -rf ./build/flow
mkdir -p ./build
- git clone --branch=master --single-branch --shallow-since=2017-01-01 https://github.com/facebook/flow.git ./build/flow
+ git clone --branch=master --single-branch --shallow-since=2018-11-01 https://github.com/facebook/flow.git ./build/flow
cd build/flow && git checkout $(FLOW_COMMIT)
test-flow:
@@ -96,7 +105,7 @@ test-flow-update-whitelist:
bootstrap-test262:
rm -rf ./build/test262
mkdir -p ./build
- git clone --branch=master --single-branch --shallow-since=2017-01-01 https://github.com/tc39/test262.git ./build/test262
+ git clone --branch=master --single-branch --shallow-since=2019-01-01 https://github.com/tc39/test262.git ./build/test262
cd build/test262 && git checkout $(TEST262_COMMIT)
test-test262:
@@ -115,22 +124,39 @@ prepublish-build:
rm -rf packages/babel-runtime/helpers
rm -rf packages/babel-runtime-corejs2/helpers
rm -rf packages/babel-runtime-corejs2/core-js
- BABEL_ENV=production make build-dist
+ NODE_ENV=production BABEL_ENV=production make build-dist
make clone-license
prepublish:
- git pull --rebase
+ make bootstrap-only
make prepublish-build
make test
+new-version:
+ git pull --rebase
+ ./node_modules/.bin/lerna version --force-publish="@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone"
+
+# NOTE: Run make new-version first
publish: prepublish
- # --only-explicit-updates
- ./node_modules/.bin/lerna publish
+ ./node_modules/.bin/lerna publish from-git --require-scripts
make clean
-bootstrap: clean-all
+publish-ci: prepublish
+ifneq ("$(NPM_TOKEN)", "")
+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
+else
+ echo "Missing NPM_TOKEN env var"
+ exit 1
+endif
+ ./node_modules/.bin/lerna publish from-git --require-scripts --yes
+ rm -f .npmrc
+ make clean
+
+bootstrap-only: clean-all
yarn --ignore-engines
./node_modules/.bin/lerna bootstrap -- --ignore-engines
+
+bootstrap: bootstrap-only
make build
cd packages/babel-plugin-transform-runtime; \
node scripts/build-dist.js
diff --git a/README.md b/README.md
index cc2f50d52efa..579b85a7cd88 100644
--- a/README.md
+++ b/README.md
@@ -8,12 +8,16 @@
The compiler for writing next generation JavaScript.
+
+
+
+
-
+
Supporting Babel
@@ -27,11 +31,11 @@
Babel (pronounced ["babble"](https://soundcloud.com/sebmck/how-to-pronounce-babel)) is a community-driven project used by many companies and projects, and is maintained by a group of [volunteers](https://babeljs.io/team). If you'd like to help support the future of the project, please consider:
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/) for guidance!)
-- Giving funds by becoming a sponsor (see below)!
+- Giving funds by becoming a sponsor on [Open Collective](https://opencollective.com/babel) or [Patreon](https://www.patreon.com/henryzhu)!
-## Open Collective Sponsors
+## Sponsors
-Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/babel#sponsor)]
+Our top sponsors are shown below! [[Become a sponsor](https://opencollective.com/babel#sponsor)]
@@ -48,35 +52,6 @@ Become a sponsor and get your logo on our README on Github with a link to your s
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## Patreon Sponsors
-
-Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://www.patreon.com/henryzhu)]
-
-## Silver
-
-
-
-## Bronze
-
-
-
-Mike Sherov
## Intro
@@ -103,11 +78,11 @@ Try it out at our [REPL](https://babeljs.io/repl/build/master#?code_lz=NoRgNATGD
### Who maintains Babel?
-Mostly a handful of volunteers! Please check out our [team page](https://babeljs.io/team)!
+Mostly a handful of volunteers, funded by you! Please check out our [team page](https://babeljs.io/team)!
### Looking for support?
-For questions and support please visit join our [Slack Community](https://slack.babeljs.io/) (you can sign-up [here](https://slack.babeljs.io/) for an invite), ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs).
+For questions and support please join our [Slack Community](https://slack.babeljs.io/) (you can sign-up [here](https://slack.babeljs.io/) for an invite), ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs).
### Is there a Babel song?
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000000..7fe81999cccc
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,19 @@
+# Security Policy
+
+## Supported Versions
+
+This is the list of versions of `babel` which are
+currently being supported with security updates.
+
+| Version | Supported |
+| -------- | ------------------ |
+| 7.x | :white_check_mark: |
+| 6.26.x | :white_check_mark: |
+| < 6.26.0 | :x: |
+
+## Reporting a Vulnerability
+
+To report a vulnerability please send an email with the details to security@babeljs.io.
+This will help us to assess the risk and start the necessary steps.
+
+Thanks for helping to keep babel secure.
diff --git a/SONG.md b/SONG.md
index a6939e15af28..234b5ed3e373 100644
--- a/SONG.md
+++ b/SONG.md
@@ -19,7 +19,8 @@ Generators, const and let
I used them all without regret
And it’s a terse and a destructured Hallelujah
-Hallelujah etc.
+Hallelujah, Hallelujah
+Hallelujah, Hallelujah
Well my faith was strong but I needed proof
The standard was my source of truth
@@ -28,7 +29,9 @@ So even though you weren’t impressed
I checked the build against the spec
And it’s a more-or-less compliant Hallelujah
-Hallelujah etc.
+
+Hallelujah, Hallelujah
+Hallelujah, Hallelujah
Now you say the build step’s too complex
And you claim no need for ES Next
@@ -37,7 +40,9 @@ But your code grows older with each line
It’s a joyless dirge on a withered vine
It’s a threnody for a bygone Hallelujah
-Hallelujah etc.
+
+Hallelujah, Hallelujah
+Hallelujah, Hallelujah
Yes I learned about the danger signs
How they’d polyfilled a thousand lines
@@ -46,7 +51,9 @@ Still I disregarded common sense
Now my source is small but the build’s immense
And it’s a slow and unresponsive Hallelujah
-Hallelujah etc.
+
+Hallelujah, Hallelujah
+Hallelujah, Hallelujah
There was a time when they let me know
What’s really going on below
@@ -55,7 +62,9 @@ And debugging’s not a progress march
It’s a frenzied fumble in the dark
It’s a labyrinthine search for Hallelujah
-Hallelujah etc.
+
+Hallelujah, Hallelujah
+Hallelujah, Hallelujah
Well, maybe there’s a god up there
But all I ever got from prayers
@@ -64,6 +73,8 @@ And that anguished cry you hear at night
Is the plugin I forgot to write
It’s a cold and it’s a broken Hallelujah
-Hallelujah etc.
+
+Hallelujah, Hallelujah
+Hallelujah, Hallelujah
[Angus Croll](https://github.com/angus-c)
diff --git a/babel.config.js b/babel.config.js
index ce4eb1d5653c..82966a7f07ca 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -5,21 +5,26 @@ module.exports = function(api) {
const includeCoverage = process.env.BABEL_COVERAGE === "true";
- const envOpts = {
+ const envOptsNoTargets = {
loose: true,
modules: false,
exclude: ["transform-typeof-symbol"],
};
+ const envOpts = Object.assign({}, envOptsNoTargets);
let convertESM = true;
let ignoreLib = true;
let includeRuntime = false;
+ const nodeVersion = "6.9";
switch (env) {
// Configs used during bundling builds.
case "babel-parser":
convertESM = false;
ignoreLib = false;
+ envOpts.targets = {
+ node: nodeVersion,
+ };
break;
case "standalone":
convertESM = false;
@@ -29,7 +34,7 @@ module.exports = function(api) {
case "production":
// Config during builds before publish.
envOpts.targets = {
- node: "6.9",
+ node: nodeVersion,
};
break;
case "development":
@@ -93,6 +98,11 @@ module.exports = function(api) {
convertESM ? "@babel/transform-modules-commonjs" : null,
].filter(Boolean),
},
+ {
+ test: "./packages/babel-polyfill",
+ presets: [["@babel/env", envOptsNoTargets]],
+ plugins: [["@babel/transform-modules-commonjs", { lazy: false }]],
+ },
{
// The vast majority of our src files are modules, but we use
// unambiguous to keep things simple until we get around to renaming
@@ -111,9 +121,11 @@ module.exports = function(api) {
"packages/babel-runtime",
/[\\/]node_modules[\\/](?:@babel\/runtime|babel-runtime|core-js)[\\/]/,
],
- plugins: [includeRuntime ? "@babel/transform-runtime" : null].filter(
- Boolean
- ),
+ plugins: [
+ includeRuntime
+ ? ["@babel/transform-runtime", { version: "7.4.4" }]
+ : null,
+ ].filter(Boolean),
},
].filter(Boolean),
};
diff --git a/codecov.yml b/codecov.yml
index 9937c4cc4949..ed4545a1bf7d 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -8,3 +8,5 @@ coverage:
target: "80%"
patch:
enabled: false
+ignore:
+ - packages/babel-types/src/*/generated/index.js
diff --git a/codemods/babel-plugin-codemod-optional-catch-binding/test/fixtures/codemod-optional-catch-binding/try-catch-block-duplicate-variable-declaration/input.js b/codemods/babel-plugin-codemod-optional-catch-binding/test/fixtures/codemod-optional-catch-binding/try-catch-block-duplicate-variable-declaration/input.js
deleted file mode 100644
index 520eab559fbd..000000000000
--- a/codemods/babel-plugin-codemod-optional-catch-binding/test/fixtures/codemod-optional-catch-binding/try-catch-block-duplicate-variable-declaration/input.js
+++ /dev/null
@@ -1,5 +0,0 @@
-try {
- throw 0;
-} catch (e) {
- let e = new TypeError('Duplicate variable declaration; will throw an error.');
-}
diff --git a/codemods/babel-plugin-codemod-optional-catch-binding/test/fixtures/codemod-optional-catch-binding/try-catch-block-duplicate-variable-declaration/options.json b/codemods/babel-plugin-codemod-optional-catch-binding/test/fixtures/codemod-optional-catch-binding/try-catch-block-duplicate-variable-declaration/options.json
deleted file mode 100644
index ab01b7471a66..000000000000
--- a/codemods/babel-plugin-codemod-optional-catch-binding/test/fixtures/codemod-optional-catch-binding/try-catch-block-duplicate-variable-declaration/options.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "plugins": ["../../../../lib"],
- "throws": "Duplicate declaration \"e\""
-}
diff --git a/eslint-local-rules.js b/eslint-local-rules.js
deleted file mode 100644
index 73af83e4840e..000000000000
--- a/eslint-local-rules.js
+++ /dev/null
@@ -1,9 +0,0 @@
-"use strict";
-
-const noDeprecatedClone = require("./scripts/eslint_rules/no-deprecated-clone");
-const noUndefinedIdentifier = require("./scripts/eslint_rules/no-undefined-identifier");
-
-module.exports = {
- "no-deprecated-clone": noDeprecatedClone,
- "no-undefined-identifier": noUndefinedIdentifier,
-};
diff --git a/lerna.json b/lerna.json
index 0a083def2273..10d091d9337f 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,34 +1,34 @@
{
- "lerna": "2.11.0",
- "version": "7.1.0",
+ "version": "7.5.5",
"changelog": {
"repo": "babel/babel",
"cacheDir": ".changelog",
"labels": {
- "PR: Spec Compliancy :eyeglasses:": ":eyeglasses: Spec Compliancy",
+ "PR: Spec Compliance :eyeglasses:": ":eyeglasses: Spec Compliance",
"PR: Breaking Change :boom:": ":boom: Breaking Change",
"PR: New Feature :rocket:": ":rocket: New Feature",
"PR: Bug Fix :bug:": ":bug: Bug Fix",
"PR: Polish :nail_care:": ":nail_care: Polish",
"PR: Docs :memo:": ":memo: Documentation",
- "PR: Internal :house:": ":house: Internal"
+ "PR: Internal :house:": ":house: Internal",
+ "PR: Performance :running_woman:": ":running_woman: Performance"
}
},
- "commands": {
+ "command": {
"publish": {
- "ignore": [
+ "ignoreChanges": [
"*.md",
- "*.json",
"*.txt",
"test/**",
"codemods/**",
- "package.json"
+ "# We ignore every JSON file, except for built-in-modules, built-ins and plugins defined in babel-preset-env/data.",
+ "@(!(built-in-modules|built-ins|plugins|package)).json"
]
}
},
"packages": [
- "packages/*",
- "codemods/*"
+ "codemods/*",
+ "packages/*"
],
"npmClient": "yarn",
"npmClientArgs": [
diff --git a/lib/third-party-libs.js.flow b/lib/third-party-libs.js.flow
index 74913a5df11a..c21a2797acfe 100644
--- a/lib/third-party-libs.js.flow
+++ b/lib/third-party-libs.js.flow
@@ -2,12 +2,6 @@
* Basic declarations for the npm modules we use.
*/
-declare module "micromatch" {
- declare module.exports: {
- (Array, Array, ?{ nocase: boolean }): Array,
- };
-}
-
declare module "resolve" {
declare export default {
sync: (string, {| basedir: string |}) => string;
@@ -33,16 +27,31 @@ declare module "lodash/merge" {
}
declare module "semver" {
+ declare class SemVer {
+ build: Array;
+ loose: ?boolean;
+ major: number;
+ minor: number;
+ patch: number;
+ prerelease: Array;
+ raw: string;
+ version: string;
+
+ constructor(version: string | SemVer): SemVer;
+ }
+
declare module.exports: {
- valid(v: string): boolean;
+ SemVer: SemVer;
+
+ coerce(version: string | SemVer): SemVer | null;
gt(v1: string, v2: string): boolean;
+ intersects(r1: string, r2: string): boolean;
lt(v1: string, v2: string): boolean;
major(v: string): number;
minor(v: string): number;
patch(v: string): number;
satisfies(v1: string, r1: string): boolean;
-
- intersects(r1: string, r2: string): boolean;
+ valid(v: string): boolean;
}
}
@@ -186,3 +195,13 @@ declare module "js-levenshtein" {
(string, string): number,
};
}
+
+declare module "core-js-compat/data" {
+ declare type Target = "node" | "chrome" | "opera" | "edge" | "firefox" | "safari" | "ie" | "ios" | "android" | "electron" | "samsung";
+
+ declare module.exports: {
+ [key: string]: {
+ [target: Target]: string;
+ }
+ }
+}
diff --git a/package.json b/package.json
index 3dd415a9d732..bd04e0638455 100644
--- a/package.json
+++ b/package.json
@@ -6,73 +6,75 @@
"build": "make build",
"fix": "make fix",
"lint": "make lint",
- "precommit": "lint-staged",
"test": "make test"
},
"devDependencies": {
- "@babel/cli": "^7.0.0",
- "@babel/core": "^7.0.0",
- "@babel/plugin-proposal-class-properties": "^7.0.0",
- "@babel/plugin-proposal-export-namespace-from": "^7.0.0",
- "@babel/plugin-proposal-numeric-separator": "^7.0.0",
- "@babel/plugin-transform-modules-commonjs": "^7.0.0",
- "@babel/plugin-transform-runtime": "^7.0.0",
- "@babel/preset-env": "^7.0.0",
+ "@babel/cli": "^7.4.4",
+ "@babel/core": "^7.4.5",
+ "@babel/eslint-plugin-development": "^1.0.1",
+ "@babel/plugin-proposal-class-properties": "^7.4.4",
+ "@babel/plugin-proposal-export-namespace-from": "^7.2.0",
+ "@babel/plugin-proposal-numeric-separator": "^7.2.0",
+ "@babel/plugin-transform-modules-commonjs": "^7.4.4",
+ "@babel/plugin-transform-runtime": "^7.4.4",
+ "@babel/preset-env": "^7.4.5",
"@babel/preset-flow": "^7.0.0",
- "@babel/register": "^7.0.0",
- "@babel/runtime": "^7.0.0",
- "babel-core": "^7.0.0-0",
- "babel-eslint": "^9.0.0",
- "babel-jest": "^23.4.0",
- "babel-loader": "8.0.0-beta.4",
- "babel-plugin-transform-charcodes": "^0.1.0",
- "browserify": "^16.2.2",
+ "@babel/register": "^7.4.4",
+ "@babel/runtime": "^7.4.5",
+ "babel-eslint": "^11.0.0-beta.0",
+ "babel-jest": "^24.8.0",
+ "babel-loader": "^8.0.6",
+ "babel-plugin-transform-charcodes": "^0.2.0",
+ "browserify": "^16.2.3",
"bundle-collapser": "^1.2.1",
- "chalk": "^2.3.2",
- "charcodes": "^0.1.0",
+ "chalk": "^2.4.2",
+ "charcodes": "^0.2.0",
"derequire": "^2.0.2",
+ "duplicate-package-checker-webpack-plugin": "^2.1.0",
"enhanced-resolve": "^3.0.0",
- "eslint": "^5.3.0",
- "eslint-config-babel": "^8.0.0",
- "eslint-plugin-flowtype": "^2.50.0",
- "eslint-plugin-local-rules": "0.1.0",
- "eslint-plugin-prettier": "^2.6.2",
- "flow-bin": "^0.80.0",
- "graceful-fs": "^4.1.11",
- "gulp": "^4.0.0",
- "gulp-babel": "^8.0.0-beta.2",
+ "eslint": "^5.16.0",
+ "eslint-config-babel": "^9.0.0",
+ "eslint-plugin-flowtype": "^3.8.2",
+ "eslint-plugin-import": "^2.17.2",
+ "eslint-plugin-prettier": "^3.1.0",
+ "fancy-log": "^1.3.3",
+ "flow-bin": "^0.94.0",
+ "graceful-fs": "^4.1.15",
+ "gulp": "^4.0.2",
+ "gulp-babel": "^8.0.0",
"gulp-filter": "^5.1.0",
"gulp-newer": "^1.0.0",
- "gulp-plumber": "^1.0.1",
- "gulp-rename": "^1.2.2",
- "gulp-uglify": "^3.0.0",
- "gulp-util": "^3.0.7",
- "gulp-watch": "^5.0.0",
- "husky": "^0.14.3",
- "jest": "^23.4.1",
- "lerna": "^2.11.0",
+ "gulp-plumber": "^1.2.1",
+ "gulp-rename": "^1.4.0",
+ "gulp-uglify": "^3.0.2",
+ "gulp-watch": "^5.0.1",
+ "husky": "^2.3.0",
+ "jest": "^24.8.0",
+ "lerna": "^3.14.2",
"lerna-changelog": "^0.5.0",
- "lint-staged": "^6.0.1",
- "lodash": "^4.17.10",
+ "lint-staged": "^8.1.7",
+ "lodash": "^4.17.13",
"merge-stream": "^1.0.1",
"output-file-sync": "^2.0.0",
- "prettier": "^1.13.7",
- "pump": "^1.0.2",
- "rimraf": "^2.4.3",
- "rollup-plugin-babel": "^4.0.0-beta.0",
- "rollup-plugin-node-resolve": "^3.0.2",
- "rollup-stream": "^1.24.1",
+ "prettier": "^1.17.1",
+ "pump": "^3.0.0",
+ "rimraf": "^2.6.3",
+ "rollup": "^1.12.0",
+ "rollup-plugin-babel": "^4.0.0",
+ "rollup-plugin-node-resolve": "^5.0.0",
+ "rollup-plugin-replace": "^2.2.0",
"test262-stream": "^1.2.0",
"through2": "^2.0.0",
- "uglify-js": "^2.4.16",
- "vinyl-buffer": "^1.0.1",
- "vinyl-source-stream": "^2.0.0",
+ "warnings-to-errors-webpack-plugin": "^2.0.0",
"webpack": "^3.4.1",
"webpack-dependency-suite": "^2.4.4",
"webpack-stream": "^4.0.0"
},
+ "resolutions": {
+ "@lerna/**/@lerna/collect-updates": "https://github.com/babel/lerna.git#babel-collect-updates"
+ },
"engines": {
- "node": ">= 6.9.0 <= 11.0.0-0",
+ "node": ">= 6.9.0 < 13.0.0",
"npm": ">= 3.x <= 6.x",
"yarn": ">=0.27.5 || >=1.0.0-20170811"
},
@@ -81,6 +83,11 @@
"eslint --format=codeframe"
]
},
+ "husky": {
+ "hooks": {
+ "pre-commit": "lint-staged"
+ }
+ },
"jest": {
"collectCoverageFrom": [
"packages/*/src/**/*.mjs",
@@ -102,7 +109,9 @@
"_browser\\.js"
],
"testEnvironment": "node",
- "setupTestFrameworkScriptFile": "/test/testSetupFile.js",
+ "setupFilesAfterEnv": [
+ "/test/testSetupFile.js"
+ ],
"transformIgnorePatterns": [
"/node_modules/",
"/packages/babel-standalone/babel(\\.min)?\\.js",
@@ -121,6 +130,10 @@
"/test/tmp/",
"/test/__data__/",
"/build/"
- ]
- }
+ ],
+ "moduleNameMapper": {
+ "^@babel/([a-zA-Z0-9_-]+)$": "/packages/babel-$1/"
+ }
+ },
+ "dependencies": {}
}
diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json
index e5446c644c0e..0b4bd8731363 100644
--- a/packages/babel-cli/package.json
+++ b/packages/babel-cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@babel/cli",
- "version": "7.1.0",
+ "version": "7.5.5",
"description": "Babel command line.",
"author": "Sebastian McKenzie ",
"homepage": "https://babeljs.io/",
@@ -23,21 +23,21 @@
"convert-source-map": "^1.1.0",
"fs-readdir-recursive": "^1.1.0",
"glob": "^7.0.0",
- "lodash": "^4.17.10",
+ "lodash": "^4.17.13",
"mkdirp": "^0.5.1",
"output-file-sync": "^2.0.0",
"slash": "^2.0.0",
"source-map": "^0.5.0"
},
"optionalDependencies": {
- "chokidar": "^2.0.3"
+ "chokidar": "^2.0.4"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
- "@babel/core": "^7.0.0",
- "@babel/helper-fixtures": "^7.0.0"
+ "@babel/core": "^7.5.5",
+ "@babel/helper-fixtures": "^7.5.5"
},
"bin": {
"babel": "./bin/babel.js",
diff --git a/packages/babel-cli/src/babel/file.js b/packages/babel-cli/src/babel/file.js
index 31433b33da3f..f0678e27ed39 100644
--- a/packages/babel-cli/src/babel/file.js
+++ b/packages/babel-cli/src/babel/file.js
@@ -137,7 +137,11 @@ export default async function({ cliOptions, babelOptions }) {
const dirname = filename;
util
- .readdirForCompilable(filename, cliOptions.includeDotfiles)
+ .readdirForCompilable(
+ filename,
+ cliOptions.includeDotfiles,
+ cliOptions.extensions,
+ )
.forEach(function(filename) {
_filenames.push(path.join(dirname, filename));
});
diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js
index 16a9c025bcd9..41cc0fb83e7f 100644
--- a/packages/babel-cli/src/babel/options.js
+++ b/packages/babel-cli/src/babel/options.js
@@ -22,7 +22,7 @@ commander.option(
"comma-separated list of plugin names",
collect,
);
-commander.option("--config-file [path]", "Path a to .babelrc file to use");
+commander.option("--config-file [path]", "Path to a .babelrc file to use");
commander.option(
"--env-name [name]",
"The name of the 'env' to use when loading configs and plugins. " +
@@ -81,7 +81,7 @@ commander.option(
"print a comment after any injected non-user code",
);
-// General soucemap formatting.
+// General source map formatting.
commander.option("-s, --source-maps [true|false|inline|both]", "", booleanify);
commander.option(
"--source-map-target [string]",
@@ -221,36 +221,47 @@ export default function parseArgv(args: Array) {
const opts = commander.opts();
+ const babelOptions = {
+ presets: opts.presets,
+ plugins: opts.plugins,
+ rootMode: opts.rootMode,
+ configFile: opts.configFile,
+ envName: opts.envName,
+ sourceType: opts.sourceType,
+ ignore: opts.ignore,
+ only: opts.only,
+ retainLines: opts.retainLines,
+ compact: opts.compact,
+ minified: opts.minified,
+ auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
+ auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
+ sourceMaps: opts.sourceMaps,
+ sourceFileName: opts.sourceFileName,
+ sourceRoot: opts.sourceRoot,
+ moduleRoot: opts.moduleRoot,
+ moduleIds: opts.moduleIds,
+ moduleId: opts.moduleId,
+
+ // Commander will default the "--no-" arguments to true, but we want to
+ // leave them undefined so that @babel/core can handle the
+ // default-assignment logic on its own.
+ babelrc: opts.babelrc === true ? undefined : opts.babelrc,
+ highlightCode: opts.highlightCode === true ? undefined : opts.highlightCode,
+ comments: opts.comments === true ? undefined : opts.comments,
+ };
+
+ // If the @babel/cli version is newer than the @babel/core version, and we have added
+ // new options for @babel/core, we'll potentially get option validation errors from
+ // @babel/core. To avoid that, we delete undefined options, so @babel/core will only
+ // give the error if users actually pass an unsupported CLI option.
+ for (const key of Object.keys(babelOptions)) {
+ if (babelOptions[key] === undefined) {
+ delete babelOptions[key];
+ }
+ }
+
return {
- babelOptions: {
- presets: opts.presets,
- plugins: opts.plugins,
- rootMode: opts.rootMode,
- configFile: opts.configFile,
- envName: opts.envName,
- sourceType: opts.sourceType,
- ignore: opts.ignore,
- only: opts.only,
- retainLines: opts.retainLines,
- compact: opts.compact,
- minified: opts.minified,
- auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
- auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
- sourceMaps: opts.sourceMaps,
- sourceFileName: opts.sourceFileName,
- sourceRoot: opts.sourceRoot,
- moduleRoot: opts.moduleRoot,
- moduleIds: opts.moduleIds,
- moduleId: opts.moduleId,
-
- // Commander will default the "--no-" arguments to true, but we want to
- // leave them undefined so that @babel/core can handle the
- // default-assignment logic on its own.
- babelrc: opts.babelrc === true ? undefined : opts.babelrc,
- highlightCode:
- opts.highlightCode === true ? undefined : opts.highlightCode,
- comments: opts.comments === true ? undefined : opts.comments,
- },
+ babelOptions,
cliOptions: {
filename: opts.filename,
filenames,
diff --git a/packages/babel-cli/src/babel/util.js b/packages/babel-cli/src/babel/util.js
index ad972fd0cd15..99c9ae9b00cd 100644
--- a/packages/babel-cli/src/babel/util.js
+++ b/packages/babel-cli/src/babel/util.js
@@ -29,8 +29,11 @@ export function readdir(
export function readdirForCompilable(
dirname: string,
includeDotfiles: boolean,
+ altExts?: Array,
) {
- return readdir(dirname, includeDotfiles, isCompilableExtension);
+ return readdir(dirname, includeDotfiles, function(filename) {
+ return isCompilableExtension(filename, altExts);
+ });
}
/**
diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/in-files/src/bar/bar.es b/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/in-files/src/bar/bar.es
new file mode 100644
index 000000000000..9e99278492df
--- /dev/null
+++ b/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/in-files/src/bar/bar.es
@@ -0,0 +1 @@
+ (() => 42)
\ No newline at end of file
diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/in-files/src/foo.es b/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/in-files/src/foo.es
new file mode 100644
index 000000000000..4bc9539528d4
--- /dev/null
+++ b/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/in-files/src/foo.es
@@ -0,0 +1 @@
+arr.map(x => x * MULTIPLIER);
diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/options.json
new file mode 100644
index 000000000000..cb501c3b853c
--- /dev/null
+++ b/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/options.json
@@ -0,0 +1,3 @@
+{
+ "args": ["src", "--out-file", "test.js", "--extensions", ".es"]
+}
diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/out-files/test.js b/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/out-files/test.js
new file mode 100644
index 000000000000..d3e579815a50
--- /dev/null
+++ b/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/out-files/test.js
@@ -0,0 +1,10 @@
+"use strict";
+
+(function () {
+ return 42;
+});
+"use strict";
+
+arr.map(function (x) {
+ return x * MULTIPLIER;
+});
diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/stdout.txt b/packages/babel-cli/test/fixtures/babel/dir --out-file --extensions/stdout.txt
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/packages/babel-cli/test/index.js b/packages/babel-cli/test/index.js
index 0654cadf0d16..64f64273319c 100644
--- a/packages/babel-cli/test/index.js
+++ b/packages/babel-cli/test/index.js
@@ -86,7 +86,7 @@ const assertTest = function(stdout, stderr, opts, cwd) {
}
if (opts.outFiles) {
- const actualFiles = readDir(path.join(tmpLoc), fileFilter);
+ const actualFiles = readDir(tmpLoc, fileFilter);
Object.keys(actualFiles).forEach(function(filename) {
if (
@@ -171,12 +171,12 @@ const buildTest = function(binName, testName, opts) {
};
fs.readdirSync(fixtureLoc).forEach(function(binName) {
- if (binName[0] === ".") return;
+ if (binName.startsWith(".")) return;
const suiteLoc = path.join(fixtureLoc, binName);
describe("bin/" + binName, function() {
fs.readdirSync(suiteLoc).forEach(function(testName) {
- if (testName[0] === ".") return;
+ if (testName.startsWith(".")) return;
const testLoc = path.join(suiteLoc, testName);
diff --git a/packages/babel-code-frame/package.json b/packages/babel-code-frame/package.json
index 7e0609b321b4..0b753eb11230 100644
--- a/packages/babel-code-frame/package.json
+++ b/packages/babel-code-frame/package.json
@@ -1,6 +1,6 @@
{
"name": "@babel/code-frame",
- "version": "7.0.0",
+ "version": "7.5.5",
"description": "Generate errors that contain a code frame that point to source locations.",
"author": "Sebastian McKenzie ",
"homepage": "https://babeljs.io/",
diff --git a/packages/babel-code-frame/src/index.js b/packages/babel-code-frame/src/index.js
index 11e0095aa8ab..0aae7fabcd23 100644
--- a/packages/babel-code-frame/src/index.js
+++ b/packages/babel-code-frame/src/index.js
@@ -76,7 +76,7 @@ function getMarkerLines(
} else if (i === 0) {
const sourceLength = source[lineNumber - 1].length;
- markerLines[lineNumber] = [startColumn, sourceLength - startColumn];
+ markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
} else if (i === lineDiff) {
markerLines[lineNumber] = [0, endColumn];
} else {
@@ -112,15 +112,16 @@ export function codeFrameColumns(
const maybeHighlight = (chalkFn, string) => {
return highlighted ? chalkFn(string) : string;
};
- if (highlighted) rawLines = highlight(rawLines, opts);
-
const lines = rawLines.split(NEWLINE);
const { start, end, markerLines } = getMarkerLines(loc, lines, opts);
const hasColumns = loc.start && typeof loc.start.column === "number";
const numberMaxWidth = String(end).length;
- let frame = lines
+ const highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines;
+
+ let frame = highlightedLines
+ .split(NEWLINE)
.slice(start, end)
.map((line, index) => {
const number = start + 1 + index;
diff --git a/packages/babel-code-frame/test/index.js b/packages/babel-code-frame/test/index.js
index c06214c5b4e5..23f724ee3209 100644
--- a/packages/babel-code-frame/test/index.js
+++ b/packages/babel-code-frame/test/index.js
@@ -102,6 +102,45 @@ describe("@babel/code-frame", function() {
);
});
+ test("opts.highlightCode with multiple columns and lines", function() {
+ // prettier-ignore
+ const rawLines = [
+ "function a(b, c) {",
+ " return b + c;",
+ "}"
+ ].join("\n");
+
+ const result = codeFrameColumns(
+ rawLines,
+ {
+ start: {
+ line: 1,
+ column: 1,
+ },
+ end: {
+ line: 3,
+ column: 1,
+ },
+ },
+ {
+ highlightCode: true,
+ message: "Message about things",
+ },
+ );
+ const stripped = stripAnsi(result);
+ expect(stripped).toEqual(
+ // prettier-ignore
+ [
+ "> 1 | function a(b, c) {",
+ " | ^^^^^^^^^^^^^^^^^^",
+ "> 2 | return b + c;",
+ " | ^^^^^^^^^^^^^^^",
+ "> 3 | }",
+ " | ^ Message about things",
+ ].join('\n'),
+ );
+ });
+
test("opts.linesAbove", function() {
const rawLines = [
"/**",
diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json
index e6fbbdc26ef8..56efb4a95fc5 100644
--- a/packages/babel-core/package.json
+++ b/packages/babel-core/package.json
@@ -1,6 +1,6 @@
{
"name": "@babel/core",
- "version": "7.1.0",
+ "version": "7.5.5",
"description": "Babel compiler core.",
"main": "lib/index.js",
"author": "Sebastian McKenzie ",
@@ -33,23 +33,23 @@
"./lib/transform-file.js": "./lib/transform-file-browser.js"
},
"dependencies": {
- "@babel/code-frame": "^7.0.0",
- "@babel/generator": "^7.0.0",
- "@babel/helpers": "^7.1.0",
- "@babel/parser": "^7.1.0",
- "@babel/template": "^7.1.0",
- "@babel/traverse": "^7.1.0",
- "@babel/types": "^7.0.0",
+ "@babel/code-frame": "^7.5.5",
+ "@babel/generator": "^7.5.5",
+ "@babel/helpers": "^7.5.5",
+ "@babel/parser": "^7.5.5",
+ "@babel/template": "^7.4.4",
+ "@babel/traverse": "^7.5.5",
+ "@babel/types": "^7.5.5",
"convert-source-map": "^1.1.0",
- "debug": "^3.1.0",
- "json5": "^0.5.0",
- "lodash": "^4.17.10",
+ "debug": "^4.1.0",
+ "json5": "^2.1.0",
+ "lodash": "^4.17.13",
"resolve": "^1.3.2",
"semver": "^5.4.1",
"source-map": "^0.5.0"
},
"devDependencies": {
- "@babel/helper-transform-fixture-test-runner": "^7.0.0",
- "@babel/register": "^7.0.0"
+ "@babel/helper-transform-fixture-test-runner": "^7.5.5",
+ "@babel/register": "^7.5.5"
}
}
diff --git a/packages/babel-core/src/config/caching.js b/packages/babel-core/src/config/caching.js
index c8db5a166c71..5b915e7f7767 100644
--- a/packages/babel-core/src/config/caching.js
+++ b/packages/babel-core/src/config/caching.js
@@ -54,6 +54,7 @@ function makeCachedFunction<
ArgT,
ResultT,
SideChannel,
+ // $FlowIssue https://github.com/facebook/flow/issues/4528
Cache: CacheMap,
>(
callCache: Cache,
diff --git a/packages/babel-core/src/config/config-chain.js b/packages/babel-core/src/config/config-chain.js
index b9e13a130797..3bbedcdff1a9 100644
--- a/packages/babel-core/src/config/config-chain.js
+++ b/packages/babel-core/src/config/config-chain.js
@@ -67,7 +67,7 @@ export function buildPresetChain(
return {
plugins: dedupDescriptors(chain.plugins),
presets: dedupDescriptors(chain.presets),
- options: chain.options,
+ options: chain.options.map(o => normalizeOptions(o)),
};
}
@@ -155,6 +155,7 @@ export function buildRootChain(
}
let { babelrc, babelrcRoots } = opts;
+ let babelrcRootsDirectory = context.cwd;
const configFileChain = emptyChain();
if (configFile) {
@@ -168,6 +169,7 @@ export function buildRootChain(
babelrc = validatedFile.options.babelrc;
}
if (babelrcRoots === undefined) {
+ babelrcRootsDirectory = validatedFile.dirname;
babelrcRoots = validatedFile.options.babelrcRoots;
}
@@ -185,7 +187,7 @@ export function buildRootChain(
if (
(babelrc === true || babelrc === undefined) &&
pkgData &&
- babelrcLoadEnabled(context, pkgData, babelrcRoots)
+ babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)
) {
({ ignore: ignoreFile, config: babelrcFile } = findRelativeConfig(
pkgData,
@@ -229,6 +231,7 @@ function babelrcLoadEnabled(
context: ConfigContext,
pkgData: FilePackageData,
babelrcRoots: BabelrcSearch | void,
+ babelrcRootsDirectory: string,
): boolean {
if (typeof babelrcRoots === "boolean") return babelrcRoots;
@@ -243,7 +246,9 @@ function babelrcLoadEnabled(
let babelrcPatterns = babelrcRoots;
if (!Array.isArray(babelrcPatterns)) babelrcPatterns = [babelrcPatterns];
babelrcPatterns = babelrcPatterns.map(pat => {
- return typeof pat === "string" ? path.resolve(context.cwd, pat) : pat;
+ return typeof pat === "string"
+ ? path.resolve(babelrcRootsDirectory, pat)
+ : pat;
});
// Fast path to avoid having to match patterns if the babelrc is just
@@ -253,10 +258,12 @@ function babelrcLoadEnabled(
}
return babelrcPatterns.some(pat => {
- if (typeof pat === "string") pat = pathPatternToRegex(pat, context.cwd);
+ if (typeof pat === "string") {
+ pat = pathPatternToRegex(pat, babelrcRootsDirectory);
+ }
return pkgData.directories.some(directory => {
- return matchPattern(pat, context.cwd, directory, context);
+ return matchPattern(pat, babelrcRootsDirectory, directory, context);
});
});
}
diff --git a/packages/babel-core/src/config/files/configuration.js b/packages/babel-core/src/config/files/configuration.js
index 279da6b7cf08..ab3353f6fde3 100644
--- a/packages/babel-core/src/config/files/configuration.js
+++ b/packages/babel-core/src/config/files/configuration.js
@@ -10,7 +10,7 @@ import {
makeWeakCache,
type CacheConfigurator,
} from "../caching";
-import makeAPI from "../helpers/config-api";
+import makeAPI, { type PluginAPI } from "../helpers/config-api";
import { makeStaticFileCache } from "./utils";
import pathPatternToRegex from "../pattern-to-regex";
import type { FilePackageData, RelativeConfig, ConfigFile } from "./types";
@@ -114,7 +114,7 @@ export function findRootConfig(
const conf = readConfig(filepath, envName, caller);
if (conf) {
- debug("Found root config %o in $o.", BABEL_CONFIG_JS_FILENAME, dirname);
+ debug("Found root config %o in %o.", BABEL_CONFIG_JS_FILENAME, dirname);
}
return conf;
}
@@ -132,7 +132,7 @@ export function loadConfig(
throw new Error(`Config file ${filepath} contains no configuration data`);
}
- debug("Loaded config %o from $o.", name, dirname);
+ debug("Loaded config %o from %o.", name, dirname);
return conf;
}
@@ -150,7 +150,7 @@ const LOADING_CONFIGS = new Set();
const readConfigJS = makeStrongCache(
(
- filepath,
+ filepath: string,
cache: CacheConfigurator<{
envName: string,
caller: CallerMetadata | void,
@@ -193,7 +193,7 @@ const readConfigJS = makeStrongCache(
}
if (typeof options === "function") {
- options = options(makeAPI(cache));
+ options = ((options: any): (api: PluginAPI) => {})(makeAPI(cache));
if (!cache.configured()) throwConfigError();
}
diff --git a/packages/babel-core/src/config/files/plugins.js b/packages/babel-core/src/config/files/plugins.js
index 6bef09039d8f..be20468d1615 100644
--- a/packages/babel-core/src/config/files/plugins.js
+++ b/packages/babel-core/src/config/files/plugins.js
@@ -132,7 +132,7 @@ function resolveStandardizedName(
} catch (e2) {}
if (resolvedOppositeType) {
- e.message += `\n- Did you accidentally pass a ${type} as a ${oppositeType}?`;
+ e.message += `\n- Did you accidentally pass a ${oppositeType} as a ${type}?`;
}
throw e;
diff --git a/packages/babel-core/src/config/full.js b/packages/babel-core/src/config/full.js
index af4212953f67..88c65ff882be 100644
--- a/packages/babel-core/src/config/full.js
+++ b/packages/babel-core/src/config/full.js
@@ -202,7 +202,7 @@ const loadDescriptor = makeWeakCache(
if (typeof item.then === "function") {
throw new Error(
`You appear to be using an async plugin, ` +
- `which your current version of Babel does not support.` +
+ `which your current version of Babel does not support. ` +
`If you're using a published plugin, ` +
`you may need to upgrade your @babel/core version.`,
);
diff --git a/packages/babel-core/src/config/helpers/config-api.js b/packages/babel-core/src/config/helpers/config-api.js
index fa106f0ce24b..a93756ae9fa3 100644
--- a/packages/babel-core/src/config/helpers/config-api.js
+++ b/packages/babel-core/src/config/helpers/config-api.js
@@ -55,6 +55,7 @@ export default function makeAPI(
async: () => false,
caller,
assertVersion,
+ tokTypes: undefined,
};
}
diff --git a/packages/babel-core/src/config/validation/option-assertions.js b/packages/babel-core/src/config/validation/option-assertions.js
index 321e1c063229..87244b4f16b3 100644
--- a/packages/babel-core/src/config/validation/option-assertions.js
+++ b/packages/babel-core/src/config/validation/option-assertions.js
@@ -231,7 +231,7 @@ function assertIgnoreItem(loc: GeneralPath, value: mixed): IgnoreItem {
throw new Error(
`${msg(
loc,
- )} must be an array of string/Funtion/RegExp values, or undefined`,
+ )} must be an array of string/Function/RegExp values, or undefined`,
);
}
return value;
@@ -337,7 +337,7 @@ function assertPluginItem(loc: GeneralPath, value: mixed): PluginItem {
if (
opts !== undefined &&
opts !== false &&
- (typeof opts !== "object" || Array.isArray(opts))
+ (typeof opts !== "object" || Array.isArray(opts) || opts === null)
) {
throw new Error(
`${msg(access(loc, 1))} must be an object, false, or undefined`,
diff --git a/packages/babel-core/src/config/validation/options.js b/packages/babel-core/src/config/validation/options.js
index c790adfac9f9..3ee072ae344f 100644
--- a/packages/babel-core/src/config/validation/options.js
+++ b/packages/babel-core/src/config/validation/options.js
@@ -350,7 +350,7 @@ function validateNested(loc: NestingPath, opts: {}) {
NONPRESET_VALIDATORS[key] ||
BABELRC_VALIDATORS[key] ||
ROOT_VALIDATORS[key] ||
- throwUnknownError;
+ (throwUnknownError: Validator);
validator(optLoc, opts[key]);
});
diff --git a/packages/babel-core/src/index.js b/packages/babel-core/src/index.js
index 075351715ab1..e7ae7c0edfc6 100644
--- a/packages/babel-core/src/index.js
+++ b/packages/babel-core/src/index.js
@@ -10,6 +10,8 @@ export { version } from "../package.json";
export { getEnv } from "./config/helpers/environment";
export * as types from "@babel/types";
+export { tokTypes } from "@babel/parser";
+
export { default as traverse } from "@babel/traverse";
export { default as template } from "@babel/template";
diff --git a/packages/babel-core/src/transform-file-browser.js b/packages/babel-core/src/transform-file-browser.js
index ed74df780202..fc1b12af0e50 100644
--- a/packages/babel-core/src/transform-file-browser.js
+++ b/packages/babel-core/src/transform-file-browser.js
@@ -1,14 +1,29 @@
// @flow
-import type { FileResult } from "./transformation";
-export default function transformFile(
- filename: string,
- opts?: Object = {},
- callback: (?Error, FileResult | null) => void,
+// duplicated from transform-file so we do not have to import anything here
+type TransformFile = {
+ (filename: string, callback: Function): void,
+ (filename: string, opts: ?Object, callback: Function): void,
+};
+
+export const transformFile: TransformFile = (function transformFile(
+ filename,
+ opts,
+ callback,
) {
if (typeof opts === "function") {
callback = opts;
}
callback(new Error("Transforming files is not supported in browsers"), null);
+}: Function);
+
+export function transformFileSync() {
+ throw new Error("Transforming files is not supported in browsers");
+}
+
+export function transformFileAsync() {
+ return Promise.reject(
+ new Error("Transforming files is not supported in browsers"),
+ );
}
diff --git a/packages/babel-core/src/transform-file-sync-browser.js b/packages/babel-core/src/transform-file-sync-browser.js
deleted file mode 100644
index 144242f3e383..000000000000
--- a/packages/babel-core/src/transform-file-sync-browser.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// @flow
-
-export default function transformFileSync() {
- throw new Error("Transforming files is not supported in browsers");
-}
diff --git a/packages/babel-core/src/transform-file.js b/packages/babel-core/src/transform-file.js
index 1011bd8a4d89..d3c9ab640fc3 100644
--- a/packages/babel-core/src/transform-file.js
+++ b/packages/babel-core/src/transform-file.js
@@ -9,6 +9,14 @@ import {
type FileResultCallback,
} from "./transformation";
+import typeof * as transformFileBrowserType from "./transform-file-browser";
+import typeof * as transformFileType from "./transform-file";
+
+// Kind of gross, but essentially asserting that the exports of this module are the same as the
+// exports of transform-file-browser, since this file may be replaced at bundle time with
+// transform-file-browser.
+((({}: any): $Exact): $Exact);
+
type TransformFile = {
(filename: string, callback: FileResultCallback): void,
(filename: string, opts: ?InputOptions, callback: FileResultCallback): void,
diff --git a/packages/babel-core/src/transformation/file/file.js b/packages/babel-core/src/transformation/file/file.js
index bbc28767180e..a0a9f65bcdf4 100644
--- a/packages/babel-core/src/transformation/file/file.js
+++ b/packages/babel-core/src/transformation/file/file.js
@@ -183,7 +183,7 @@ export default class File {
// and this fails because a prerelease version can only satisfy a range
// if it is a prerelease within the same major/minor/patch range.
//
- // Note: If this is found to have issues, please also revist the logic in
+ // Note: If this is found to have issues, please also revisit the logic in
// transform-runtime's definitions.js file.
if (semver.valid(versionRange)) versionRange = `^${versionRange}`;
@@ -203,6 +203,9 @@ export default class File {
if (res) return res;
}
+ // make sure that the helper exists
+ helpers.ensure(name);
+
const uid = (this.declarations[name] = this.scope.generateUidIdentifier(
name,
));
diff --git a/packages/babel-core/src/transformation/file/merge-map.js b/packages/babel-core/src/transformation/file/merge-map.js
index 991373862e1e..ff2e65b042b8 100644
--- a/packages/babel-core/src/transformation/file/merge-map.js
+++ b/packages/babel-core/src/transformation/file/merge-map.js
@@ -94,7 +94,7 @@ export default function mergeSourceMap(
}
function makeMappingKey(item: { line: number, columnStart: number }) {
- return JSON.stringify([item.line, item.columnStart]);
+ return `${item.line}/${item.columnStart}`;
}
function eachOverlappingGeneratedOutputRange(
diff --git a/packages/babel-core/src/transformation/index.js b/packages/babel-core/src/transformation/index.js
index 8174f7bd8228..a03c4db0cf2a 100644
--- a/packages/babel-core/src/transformation/index.js
+++ b/packages/babel-core/src/transformation/index.js
@@ -93,7 +93,7 @@ function transformFile(file: File, pluginPasses: PluginPasses): void {
if (isThenable(result)) {
throw new Error(
`You appear to be using an plugin with an async .pre, ` +
- `which your current version of Babel does not support.` +
+ `which your current version of Babel does not support. ` +
`If you're using a published plugin, you may need to upgrade ` +
`your @babel/core version.`,
);
@@ -117,7 +117,7 @@ function transformFile(file: File, pluginPasses: PluginPasses): void {
if (isThenable(result)) {
throw new Error(
`You appear to be using an plugin with an async .post, ` +
- `which your current version of Babel does not support.` +
+ `which your current version of Babel does not support. ` +
`If you're using a published plugin, you may need to upgrade ` +
`your @babel/core version.`,
);
@@ -131,6 +131,7 @@ function isThenable(val: mixed): boolean {
return (
!!val &&
(typeof val === "object" || typeof val === "function") &&
+ !!val.then &&
typeof val.then === "function"
);
}
diff --git a/packages/babel-core/src/transformation/util/missing-plugin-helper.js b/packages/babel-core/src/transformation/util/missing-plugin-helper.js
index 2f1090c9110e..b0642c50c3cf 100644
--- a/packages/babel-core/src/transformation/util/missing-plugin-helper.js
+++ b/packages/babel-core/src/transformation/util/missing-plugin-helper.js
@@ -1,16 +1,6 @@
// @flow
const pluginNameMap = {
- asyncGenerators: {
- syntax: {
- name: "@babel/plugin-syntax-async-generators",
- url: "https://git.io/vb4SY",
- },
- transform: {
- name: "@babel/plugin-proposal-async-generator-functions",
- url: "https://git.io/vb4yp",
- },
- },
classProperties: {
syntax: {
name: "@babel/plugin-syntax-class-properties",
@@ -143,26 +133,6 @@ const pluginNameMap = {
url: "https://git.io/vb4yS",
},
},
- objectRestSpread: {
- syntax: {
- name: "@babel/plugin-syntax-object-rest-spread",
- url: "https://git.io/vb4y5",
- },
- transform: {
- name: "@babel/plugin-proposal-object-rest-spread",
- url: "https://git.io/vb4Ss",
- },
- },
- optionalCatchBinding: {
- syntax: {
- name: "@babel/plugin-syntax-optional-catch-binding",
- url: "https://git.io/vb4Sn",
- },
- transform: {
- name: "@babel/plugin-proposal-optional-catch-binding",
- url: "https://git.io/vb4SI",
- },
- },
optionalChaining: {
syntax: {
name: "@babel/plugin-syntax-optional-chaining",
@@ -203,6 +173,41 @@ const pluginNameMap = {
url: "https://git.io/vb4Sm",
},
},
+
+ // TODO: This plugins are now supported by default by @babel/parser: they can
+ // be removed from this list. Although removing them isn't a breaking change,
+ // it's better to keep a nice error message for users using older versions of
+ // the parser. They can be removed in Babel 8.
+ asyncGenerators: {
+ syntax: {
+ name: "@babel/plugin-syntax-async-generators",
+ url: "https://git.io/vb4SY",
+ },
+ transform: {
+ name: "@babel/plugin-proposal-async-generator-functions",
+ url: "https://git.io/vb4yp",
+ },
+ },
+ objectRestSpread: {
+ syntax: {
+ name: "@babel/plugin-syntax-object-rest-spread",
+ url: "https://git.io/vb4y5",
+ },
+ transform: {
+ name: "@babel/plugin-proposal-object-rest-spread",
+ url: "https://git.io/vb4Ss",
+ },
+ },
+ optionalCatchBinding: {
+ syntax: {
+ name: "@babel/plugin-syntax-optional-catch-binding",
+ url: "https://git.io/vb4Sn",
+ },
+ transform: {
+ name: "@babel/plugin-proposal-optional-catch-binding",
+ url: "https://git.io/vb4SI",
+ },
+ },
};
const getNameURLCombination = ({ name, url }) => `${name} (${url})`;
diff --git a/packages/babel-core/test/api.js b/packages/babel-core/test/api.js
index 5c3a97c7a376..9f2f955f1d7e 100644
--- a/packages/babel-core/test/api.js
+++ b/packages/babel-core/test/api.js
@@ -154,6 +154,14 @@ describe("api", function() {
);
});
+ it("exposes types", function() {
+ expect(babel.types).toBeDefined();
+ });
+
+ it("exposes the parser's token types", function() {
+ expect(babel.tokTypes).toBeDefined();
+ });
+
it("transformFile", function(done) {
const options = {
babelrc: false,
@@ -769,10 +777,10 @@ describe("api", function() {
options,
function(err) {
expect(err.message).toMatch(
- "Support for the experimental syntax 'asyncGenerators' isn't currently enabled (1:15):",
+ "Support for the experimental syntax 'logicalAssignment' isn't currently enabled (1:3):",
);
expect(err.message).toMatch(
- "Add @babel/plugin-proposal-async-generator-functions (https://git.io/vb4yp) to the " +
+ "Add @babel/plugin-proposal-logical-assignment-operators (https://git.io/vAlRe) to the " +
"'plugins' section of your Babel config to enable transformation.",
);
done();
@@ -780,4 +788,28 @@ describe("api", function() {
);
});
});
+
+ describe("missing helpers", function() {
+ it("should always throw", function() {
+ expect(() =>
+ babel.transformSync(``, {
+ configFile: false,
+ plugins: [
+ function() {
+ return {
+ visitor: {
+ Program(path) {
+ try {
+ path.pushContainer("body", this.addHelper("fooBar"));
+ } catch {}
+ path.pushContainer("body", this.addHelper("fooBar"));
+ },
+ },
+ };
+ },
+ ],
+ }),
+ ).toThrow();
+ });
+ });
});
diff --git a/packages/babel-core/test/fixtures/api/parsing-errors/syntax-and-transform/file.js b/packages/babel-core/test/fixtures/api/parsing-errors/syntax-and-transform/file.js
index a0eb4637c6d8..0cb4253cd41b 100644
--- a/packages/babel-core/test/fixtures/api/parsing-errors/syntax-and-transform/file.js
+++ b/packages/babel-core/test/fixtures/api/parsing-errors/syntax-and-transform/file.js
@@ -1,4 +1 @@
-async function* agf() {
- await 1;
- yield 2;
-}
+a ||= 2;
diff --git a/packages/babel-core/test/fixtures/transformation/misc/regression-1169/output.js b/packages/babel-core/test/fixtures/transformation/misc/regression-1169/output.js
index d2974e11c46d..910053ac4d12 100644
--- a/packages/babel-core/test/fixtures/transformation/misc/regression-1169/output.js
+++ b/packages/babel-core/test/fixtures/transformation/misc/regression-1169/output.js
@@ -2,8 +2,8 @@ function foo() {
var input = ['a', 'b', 'c'];
var output = {};
- for (var _i = 0; _i < input.length; _i++) {
- var c = input[_i];
+ for (var _i = 0, _input = input; _i < _input.length; _i++) {
+ var c = _input[_i];
var name = c;
output[name] = name;
}
diff --git a/packages/babel-core/test/fixtures/transformation/misc/regression-2892/output.js b/packages/babel-core/test/fixtures/transformation/misc/regression-2892/output.js
index 11385a0a000b..ec30a24e9b09 100644
--- a/packages/babel-core/test/fixtures/transformation/misc/regression-2892/output.js
+++ b/packages/babel-core/test/fixtures/transformation/misc/regression-2892/output.js
@@ -3,7 +3,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
-exports.default = void 0;
+exports["default"] = void 0;
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
@@ -40,19 +40,21 @@ function () {
return _context.stop();
}
}
- }, _callee, this);
+ }, _callee);
}));
- return function bar() {
+ function bar() {
return _bar.apply(this, arguments);
- };
+ }
+
+ return bar;
}()
}]);
return Foo;
}();
-exports.default = Foo;
+exports["default"] = Foo;
function foo() {
return _foo.apply(this, arguments);
@@ -84,7 +86,7 @@ function _foo() {
return _context2.stop();
}
}
- }, _callee2, this);
+ }, _callee2);
}));
return _bar2.apply(this, arguments);
};
@@ -98,7 +100,7 @@ function _foo() {
return _context3.stop();
}
}
- }, _callee3, this);
+ }, _callee3);
}));
return _foo.apply(this, arguments);
}
diff --git a/packages/babel-core/test/fixtures/transformation/misc/regression-4855/options.json b/packages/babel-core/test/fixtures/transformation/misc/regression-4855/options.json
index 2f59220d176b..489d3a868c4b 100644
--- a/packages/babel-core/test/fixtures/transformation/misc/regression-4855/options.json
+++ b/packages/babel-core/test/fixtures/transformation/misc/regression-4855/options.json
@@ -1,5 +1,8 @@
{
"compact": false,
"presets": ["env"],
- "plugins": ["external-helpers", "proposal-object-rest-spread"]
+ "plugins": [
+ ["external-helpers", { "helperVersion": "7.1.5" }],
+ "proposal-object-rest-spread"
+ ]
}
diff --git a/packages/babel-core/test/option-manager.js b/packages/babel-core/test/option-manager.js
index 28830f58f33d..4a6301ab4777 100644
--- a/packages/babel-core/test/option-manager.js
+++ b/packages/babel-core/test/option-manager.js
@@ -38,6 +38,17 @@ describe("option-manager", () => {
expect(calls).toEqual([]);
});
+ it("throws for null options", () => {
+ const { calls, plugin } = makePlugin();
+ expect(() => {
+ loadOptions({
+ plugins: [[plugin, null]],
+ }).toThrow(/.plugins[0][1] must be an object, false, or undefined/);
+ });
+
+ expect(calls).toEqual([]);
+ });
+
it("should not throw if a repeated plugin has a different name", () => {
const { calls: calls1, plugin: plugin1 } = makePlugin();
const { calls: calls2, plugin: plugin2 } = makePlugin();
@@ -87,7 +98,6 @@ describe("option-manager", () => {
expect(calls1).toEqual([{ arg: 1 }]);
expect(calls2).toEqual([{ arg: 2 }]);
});
-
it("should merge .env[] presets with parent presets", () => {
const { calls: calls1, plugin: preset1 } = makePlugin();
const { calls: calls2, plugin: preset2 } = makePlugin();
diff --git a/packages/babel-core/test/resolution.js b/packages/babel-core/test/resolution.js
index 4280b27ddd76..203d76ec5769 100644
--- a/packages/babel-core/test/resolution.js
+++ b/packages/babel-core/test/resolution.js
@@ -400,7 +400,7 @@ describe("addon resolution", function() {
presets: ["testplugin"],
});
}).toThrow(
- /Cannot find module 'babel-preset-testplugin'.*\n- Did you accidentally pass a preset as a plugin\?/,
+ /Cannot find module 'babel-preset-testplugin'.*\n- Did you accidentally pass a plugin as a preset\?/,
);
});
@@ -414,7 +414,7 @@ describe("addon resolution", function() {
plugins: ["testpreset"],
});
}).toThrow(
- /Cannot find module 'babel-plugin-testpreset'.*\n- Did you accidentally pass a plugin as a preset\?/,
+ /Cannot find module 'babel-plugin-testpreset'.*\n- Did you accidentally pass a preset as a plugin\?/,
);
});
diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json
index 42155d2bd44c..815171acf262 100644
--- a/packages/babel-generator/package.json
+++ b/packages/babel-generator/package.json
@@ -1,6 +1,6 @@
{
"name": "@babel/generator",
- "version": "7.0.0",
+ "version": "7.5.5",
"description": "Turns an AST into code.",
"author": "Sebastian McKenzie ",
"homepage": "https://babeljs.io/",
@@ -14,14 +14,14 @@
"lib"
],
"dependencies": {
- "@babel/types": "^7.0.0",
+ "@babel/types": "^7.5.5",
"jsesc": "^2.5.1",
- "lodash": "^4.17.10",
+ "lodash": "^4.17.13",
"source-map": "^0.5.0",
"trim-right": "^1.0.1"
},
"devDependencies": {
- "@babel/helper-fixtures": "^7.0.0",
- "@babel/parser": "^7.0.0"
+ "@babel/helper-fixtures": "^7.5.5",
+ "@babel/parser": "^7.5.5"
}
}
diff --git a/packages/babel-generator/src/buffer.js b/packages/babel-generator/src/buffer.js
index f49bfad8c545..fd64201a921b 100644
--- a/packages/babel-generator/src/buffer.js
+++ b/packages/babel-generator/src/buffer.js
@@ -235,7 +235,7 @@ export default class Buffer {
source(prop: string, loc: Location, force?: boolean): void {
if (prop && !loc) return;
- // Since this is called extremly often, we re-use the same _sourcePosition
+ // Since this is called extremely often, we re-use the same _sourcePosition
// object for the whole lifetime of the buffer.
this._normalizePosition(prop, loc, this._sourcePosition, force);
}
diff --git a/packages/babel-generator/src/generators/base.js b/packages/babel-generator/src/generators/base.js
index 49a1cb2c88b5..dd45014377f6 100644
--- a/packages/babel-generator/src/generators/base.js
+++ b/packages/babel-generator/src/generators/base.js
@@ -50,8 +50,45 @@ export function Directive(node: Object) {
this.semicolon();
}
+// These regexes match an even number of \ followed by a quote
+const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
+const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
+
+export function DirectiveLiteral(node: Object) {
+ const raw = this.getPossibleRaw(node);
+ if (raw != null) {
+ this.token(raw);
+ return;
+ }
+
+ const { value } = node;
+
+ // NOTE: In directives we can't change escapings,
+ // because they change the behavior.
+ // e.g. "us\x65 string" (\x65 is e) is not a "use strict" directive.
+
+ if (!unescapedDoubleQuoteRE.test(value)) {
+ this.token(`"${value}"`);
+ } else if (!unescapedSingleQuoteRE.test(value)) {
+ this.token(`'${value}'`);
+ } else {
+ throw new Error(
+ "Malformed AST: it is not possible to print a directive containing" +
+ " both unescaped single and double quotes.",
+ );
+ }
+}
+
export function InterpreterDirective(node: Object) {
this.token(`#!${node.value}\n`);
}
-export { StringLiteral as DirectiveLiteral } from "./types";
+export function Placeholder(node: Object) {
+ this.token("%%");
+ this.print(node.name);
+ this.token("%%");
+
+ if (node.expectedNode === "Statement") {
+ this.semicolon();
+ }
+}
diff --git a/packages/babel-generator/src/generators/classes.js b/packages/babel-generator/src/generators/classes.js
index 22780dc3f03b..e8c62339a6d2 100644
--- a/packages/babel-generator/src/generators/classes.js
+++ b/packages/babel-generator/src/generators/classes.js
@@ -140,6 +140,12 @@ export function ClassMethod(node: Object) {
this.print(node.body, node);
}
+export function ClassPrivateMethod(node: Object) {
+ this._classMethodHead(node);
+ this.space();
+ this.print(node.body, node);
+}
+
export function _classMethodHead(node) {
this.printJoin(node.decorators, node);
diff --git a/packages/babel-generator/src/generators/flow.js b/packages/babel-generator/src/generators/flow.js
index d46118debd48..225428b00801 100644
--- a/packages/babel-generator/src/generators/flow.js
+++ b/packages/babel-generator/src/generators/flow.js
@@ -409,7 +409,7 @@ export function ObjectTypeAnnotation(node: Object) {
indent: true,
statement: true,
iterator: () => {
- if (props.length !== 1) {
+ if (props.length !== 1 || node.inexact) {
this.token(",");
this.space();
}
@@ -419,6 +419,15 @@ export function ObjectTypeAnnotation(node: Object) {
this.space();
}
+ if (node.inexact) {
+ this.indent();
+ this.token("...");
+ if (props.length) {
+ this.newline();
+ }
+ this.dedent();
+ }
+
if (node.exact) {
this.token("|}");
} else {
diff --git a/packages/babel-generator/src/generators/methods.js b/packages/babel-generator/src/generators/methods.js
index 5dc17e065a20..1019aba04c7c 100644
--- a/packages/babel-generator/src/generators/methods.js
+++ b/packages/babel-generator/src/generators/methods.js
@@ -111,7 +111,25 @@ export function ArrowFunctionExpression(node: Object) {
t.isIdentifier(firstParam) &&
!hasTypes(node, firstParam)
) {
- this.print(firstParam, node);
+ if (
+ this.format.retainLines &&
+ node.loc &&
+ node.body.loc &&
+ node.loc.start.line < node.body.loc.start.line
+ ) {
+ this.token("(");
+ if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {
+ this.indent();
+ this.print(firstParam, node);
+ this.dedent();
+ this._catchUp("start", node.body.loc);
+ } else {
+ this.print(firstParam, node);
+ }
+ this.token(")");
+ } else {
+ this.print(firstParam, node);
+ }
} else {
this._params(node);
}
diff --git a/packages/babel-generator/src/generators/types.js b/packages/babel-generator/src/generators/types.js
index 4a5ed312a661..fdd090dd4113 100644
--- a/packages/babel-generator/src/generators/types.js
+++ b/packages/babel-generator/src/generators/types.js
@@ -7,6 +7,10 @@ export function Identifier(node: Object) {
});
}
+export function ArgumentPlaceholder() {
+ this.token("?");
+}
+
export function RestElement(node: Object) {
this.token("...");
this.print(node.argument, node);
@@ -151,3 +155,15 @@ export function BigIntLiteral(node: Object) {
}
this.token(node.value);
}
+
+export function PipelineTopicExpression(node: Object) {
+ this.print(node.expression, node);
+}
+
+export function PipelineBareFunction(node: Object) {
+ this.print(node.callee, node);
+}
+
+export function PipelinePrimaryTopicReference() {
+ this.token("#");
+}
diff --git a/packages/babel-generator/src/generators/typescript.js b/packages/babel-generator/src/generators/typescript.js
index c2e5f9d42cd3..c5d737892f2d 100644
--- a/packages/babel-generator/src/generators/typescript.js
+++ b/packages/babel-generator/src/generators/typescript.js
@@ -127,6 +127,9 @@ export function TSIndexSignature(node) {
export function TSAnyKeyword() {
this.word("any");
}
+export function TSUnknownKeyword() {
+ this.word("unknown");
+}
export function TSNumberKeyword() {
this.word("number");
}
@@ -228,7 +231,7 @@ export function tsPrintBraced(members, node) {
}
export function TSArrayType(node) {
- this.print(node.elementType);
+ this.print(node.elementType, node);
this.token("[]");
}
@@ -238,6 +241,16 @@ export function TSTupleType(node) {
this.token("]");
}
+export function TSOptionalType(node) {
+ this.print(node.typeAnnotation, node);
+ this.token("?");
+}
+
+export function TSRestType(node) {
+ this.token("...");
+ this.print(node.typeAnnotation, node);
+}
+
export function TSUnionType(node) {
this.tsPrintUnionOrIntersectionType(node, "|");
}
@@ -463,6 +476,21 @@ export function TSModuleBlock(node) {
this.tsPrintBraced(node.body, node);
}
+export function TSImportType(node) {
+ const { argument, qualifier, typeParameters } = node;
+ this.word("import");
+ this.token("(");
+ this.print(argument, node);
+ this.token(")");
+ if (qualifier) {
+ this.token(".");
+ this.print(qualifier, node);
+ }
+ if (typeParameters) {
+ this.print(typeParameters, node);
+ }
+}
+
export function TSImportEqualsDeclaration(node) {
const { isExport, id, moduleReference } = node;
if (isExport) {
diff --git a/packages/babel-generator/src/node/parentheses.js b/packages/babel-generator/src/node/parentheses.js
index e78391c2bd58..8c38fa627239 100644
--- a/packages/babel-generator/src/node/parentheses.js
+++ b/packages/babel-generator/src/node/parentheses.js
@@ -35,7 +35,16 @@ export function NullableTypeAnnotation(node: Object, parent: Object): boolean {
return t.isArrayTypeAnnotation(parent);
}
-export { NullableTypeAnnotation as FunctionTypeAnnotation };
+export function FunctionTypeAnnotation(node: Object, parent: Object): boolean {
+ return (
+ // (() => A) | (() => B)
+ t.isUnionTypeAnnotation(parent) ||
+ // (() => A) & (() => B)
+ t.isIntersectionTypeAnnotation(parent) ||
+ // (() => A)[]
+ t.isArrayTypeAnnotation(parent)
+ );
+}
export function UpdateExpression(node: Object, parent: Object): boolean {
return (
@@ -127,6 +136,18 @@ export function TSTypeAssertion() {
return true;
}
+export function TSUnionType(node: Object, parent: Object): boolean {
+ return (
+ t.isTSArrayType(parent) ||
+ t.isTSOptionalType(parent) ||
+ t.isTSIntersectionType(parent) ||
+ t.isTSUnionType(parent) ||
+ t.isTSRestType(parent)
+ );
+}
+
+export { TSUnionType as TSIntersectionType };
+
export function BinaryExpression(node: Object, parent: Object): boolean {
// let i = (1 in []);
// for ((1 in []);;);
@@ -166,6 +187,7 @@ export function YieldExpression(node: Object, parent: Object): boolean {
t.isCallExpression(parent) ||
t.isMemberExpression(parent) ||
t.isNewExpression(parent) ||
+ (t.isAwaitExpression(parent) && t.isYieldExpression(node)) ||
(t.isConditionalExpression(parent) && node === parent.test) ||
isClassExtendsClause(node, parent)
);
@@ -209,6 +231,7 @@ export function ConditionalExpression(node: Object, parent: Object): boolean {
t.isBinary(parent) ||
t.isConditionalExpression(parent, { test: node }) ||
t.isAwaitExpression(parent) ||
+ t.isOptionalMemberExpression(parent) ||
t.isTaggedTemplateExpression(parent) ||
t.isTSTypeAssertion(parent) ||
t.isTSAsExpression(parent)
@@ -219,6 +242,13 @@ export function ConditionalExpression(node: Object, parent: Object): boolean {
return UnaryLike(node, parent);
}
+export function OptionalMemberExpression(
+ node: Object,
+ parent: Object,
+): boolean {
+ return t.isCallExpression(parent) || t.isMemberExpression(parent);
+}
+
export function AssignmentExpression(node: Object): boolean {
if (t.isObjectPattern(node.left)) {
return true;
diff --git a/packages/babel-generator/src/printer.js b/packages/babel-generator/src/printer.js
index 1b740ce0c48b..fb4715d491c5 100644
--- a/packages/babel-generator/src/printer.js
+++ b/packages/babel-generator/src/printer.js
@@ -363,14 +363,14 @@ export default class Printer {
}
if (needsParens) this.token("(");
- this._printLeadingComments(node, parent);
+ this._printLeadingComments(node);
const loc = t.isProgram(node) || t.isFile(node) ? null : node.loc;
this.withSource("start", loc, () => {
- this[node.type](node, parent);
+ printMethod.call(this, node, parent);
});
- this._printTrailingComments(node, parent);
+ this._printTrailingComments(node);
if (needsParens) this.token(")");
@@ -472,12 +472,12 @@ export default class Printer {
this.print(node, parent);
}
- _printTrailingComments(node, parent) {
- this._printComments(this._getComments(false, node, parent));
+ _printTrailingComments(node) {
+ this._printComments(this._getComments(false, node));
}
- _printLeadingComments(node, parent) {
- this._printComments(this._getComments(true, node, parent));
+ _printLeadingComments(node) {
+ this._printComments(this._getComments(true, node));
}
printInnerComments(node, indent = true) {
diff --git a/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/input.js b/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/input.js
new file mode 100644
index 000000000000..753a9cfbb2b5
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/input.js
@@ -0,0 +1,12 @@
+// One
+(1);
+
+/* Two */
+(2);
+
+(
+ // Three
+ 3
+);
+
+(/* Four */ 4);
diff --git a/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/options.json b/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/options.json
new file mode 100644
index 000000000000..7c49b91ec9b2
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/options.json
@@ -0,0 +1,3 @@
+{
+ "parserOpts": {"createParenthesizedExpressions": true}
+}
diff --git a/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/output.js b/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/output.js
new file mode 100644
index 000000000000..b78500e8017f
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/output.js
@@ -0,0 +1,10 @@
+// One
+(1);
+/* Two */
+
+(2);
+( // Three
+3);
+(
+/* Four */
+4);
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/compact/expression-statement/options.json b/packages/babel-generator/test/fixtures/compact/expression-statement/options.json
deleted file mode 100644
index 8a2a1d3bfa91..000000000000
--- a/packages/babel-generator/test/fixtures/compact/expression-statement/options.json
+++ /dev/null
@@ -1 +0,0 @@
-{ "plugins": ["objectRestSpread"] }
diff --git a/packages/babel-generator/test/fixtures/edgecase/async-generator/options.json b/packages/babel-generator/test/fixtures/edgecase/async-generator/options.json
index 1ec463510a34..600c3f8fc13c 100644
--- a/packages/babel-generator/test/fixtures/edgecase/async-generator/options.json
+++ b/packages/babel-generator/test/fixtures/edgecase/async-generator/options.json
@@ -1 +1 @@
-{ "plugins": ["asyncGenerators", "classProperties"] }
+{ "plugins": ["classProperties"] }
diff --git a/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/input.js b/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/input.js
index 3d4fdd63e337..11f766a1c91d 100644
--- a/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/input.js
+++ b/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/input.js
@@ -4,7 +4,7 @@ function foo(l) {
);
}
-function foo() {
+function foo2() {
return (
1 && 2
) || 3;
diff --git a/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/output.js b/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/output.js
index eda704040f14..494b4cf7d5f8 100644
--- a/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/output.js
+++ b/packages/babel-generator/test/fixtures/edgecase/return-with-retainlines-option/output.js
@@ -4,7 +4,7 @@ function foo(l) {
}
-function foo() {
+function foo2() {
return (
1 && 2 ||
3);
diff --git a/packages/babel-generator/test/fixtures/edgecase/single-arg-async-arrow-with-retainlines/input.js b/packages/babel-generator/test/fixtures/edgecase/single-arg-async-arrow-with-retainlines/input.js
new file mode 100644
index 000000000000..b5a205cc36d6
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/edgecase/single-arg-async-arrow-with-retainlines/input.js
@@ -0,0 +1,11 @@
+var fn = async (
+ arg
+) => {}
+
+async (x) =>
+{}
+
+async x => {}
+
+async (x
+) => {};
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/edgecase/single-arg-async-arrow-with-retainlines/options.json b/packages/babel-generator/test/fixtures/edgecase/single-arg-async-arrow-with-retainlines/options.json
new file mode 100644
index 000000000000..97925bbcb61b
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/edgecase/single-arg-async-arrow-with-retainlines/options.json
@@ -0,0 +1,3 @@
+{
+ "retainLines": true
+}
diff --git a/packages/babel-generator/test/fixtures/edgecase/single-arg-async-arrow-with-retainlines/output.js b/packages/babel-generator/test/fixtures/edgecase/single-arg-async-arrow-with-retainlines/output.js
new file mode 100644
index 000000000000..6bb2ce5093e8
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/edgecase/single-arg-async-arrow-with-retainlines/output.js
@@ -0,0 +1,11 @@
+var fn = async (
+ arg
+) => {};
+
+async (x) =>
+{};
+
+async x => {};
+
+async (x) =>
+{};
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/edgecase/unary-op/options.json b/packages/babel-generator/test/fixtures/edgecase/unary-op/options.json
new file mode 100644
index 000000000000..a2e80d9ec294
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/edgecase/unary-op/options.json
@@ -0,0 +1,3 @@
+{
+ "strictMode": false
+}
diff --git a/packages/babel-generator/test/fixtures/escapes/jsonEscape/input.js b/packages/babel-generator/test/fixtures/escapes/jsonEscape/input.js
index 2305ada28e08..b999a74fa0c0 100644
--- a/packages/babel-generator/test/fixtures/escapes/jsonEscape/input.js
+++ b/packages/babel-generator/test/fixtures/escapes/jsonEscape/input.js
@@ -1 +1,2 @@
+0; // Not a directive
"©";
diff --git a/packages/babel-generator/test/fixtures/escapes/jsonEscape/output.js b/packages/babel-generator/test/fixtures/escapes/jsonEscape/output.js
index 354db9cc775e..4da42cb39725 100644
--- a/packages/babel-generator/test/fixtures/escapes/jsonEscape/output.js
+++ b/packages/babel-generator/test/fixtures/escapes/jsonEscape/output.js
@@ -1 +1,2 @@
+0;// Not a directive
"\u00A9";
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/declare-exports/input.js b/packages/babel-generator/test/fixtures/flow/declare-exports/input.js
index ea4a8c7cd463..97544d82b930 100644
--- a/packages/babel-generator/test/fixtures/flow/declare-exports/input.js
+++ b/packages/babel-generator/test/fixtures/flow/declare-exports/input.js
@@ -17,6 +17,7 @@ declare export * from 'asd';
declare export { a, b };
declare export {};
declare export { c, d } from 'bar';
+var a, b;
declare module B {
declare export type B = {};
@@ -24,9 +25,9 @@ declare module B {
}
declare module "foo" { declare export type * from "bar"; }
-declare export opaque type Foo;
+declare export opaque type Foo1;
declare export opaque type Bar;
declare export opaque type Baz: Foo;
-declare export opaque type Foo: Bar;
-declare export opaque type Foo: Bar;
-declare export opaque type Foo: Bar;
+declare export opaque type Foo3: Bar;
+declare export opaque type Foo4: Bar;
+declare export opaque type Foo5: Bar;
diff --git a/packages/babel-generator/test/fixtures/flow/declare-exports/output.js b/packages/babel-generator/test/fixtures/flow/declare-exports/output.js
index da22c014154d..59f3a4c56856 100644
--- a/packages/babel-generator/test/fixtures/flow/declare-exports/output.js
+++ b/packages/babel-generator/test/fixtures/flow/declare-exports/output.js
@@ -26,6 +26,7 @@ declare export * from 'asd';
declare export { a, b };
declare export {};
declare export { c, d } from 'bar';
+var a, b;
declare module B {
declare export type B = {};
declare export interface Moon {}
@@ -33,9 +34,9 @@ declare module B {
declare module "foo" {
declare export type * from "bar";
}
-declare export opaque type Foo;
+declare export opaque type Foo1;
declare export opaque type Bar;
declare export opaque type Baz: Foo;
-declare export opaque type Foo: Bar;
-declare export opaque type Foo: Bar;
-declare export opaque type Foo: Bar;
\ No newline at end of file
+declare export opaque type Foo3: Bar;
+declare export opaque type Foo4: Bar;
+declare export opaque type Foo5: Bar;
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/def-site-variance/input.js b/packages/babel-generator/test/fixtures/flow/def-site-variance/input.js
index 5cda68f8e9c5..9f00e80993d1 100644
--- a/packages/babel-generator/test/fixtures/flow/def-site-variance/input.js
+++ b/packages/babel-generator/test/fixtures/flow/def-site-variance/input.js
@@ -1,10 +1,10 @@
class C1<+T, -U> {}
function f<+T, -U>() {}
type T<+T, -U> = {};
-type T = { +p: T };
-type T = { -p: T };
-type T = { +[k:K]: V };
-type T = { -[k:K]: V };
+type T2 = { +p: T };
+type T3 = { -p: T };
+type T4 = { +[k:K]: V };
+type T5 = { -[k:K]: V };
interface I { +p: T }
interface I { -p: T }
interface I { +[k:K]: V }
diff --git a/packages/babel-generator/test/fixtures/flow/def-site-variance/output.js b/packages/babel-generator/test/fixtures/flow/def-site-variance/output.js
index e411f4646133..5c2b69d1a6dd 100644
--- a/packages/babel-generator/test/fixtures/flow/def-site-variance/output.js
+++ b/packages/babel-generator/test/fixtures/flow/def-site-variance/output.js
@@ -3,16 +3,16 @@ class C1<+T, -U> {}
function f<+T, -U>() {}
type T<+T, -U> = {};
-type T = {
+type T2 = {
+p: T
};
-type T = {
+type T3 = {
-p: T
};
-type T = {
+type T4 = {
+[k: K]: V
};
-type T = {
+type T5 = {
-[k: K]: V
};
interface I {
diff --git a/packages/babel-generator/test/fixtures/flow/implements/input.js b/packages/babel-generator/test/fixtures/flow/implements/input.js
index 32acd7162b81..0dd3e5458978 100644
--- a/packages/babel-generator/test/fixtures/flow/implements/input.js
+++ b/packages/babel-generator/test/fixtures/flow/implements/input.js
@@ -1,5 +1,5 @@
-class A implements B {}
-class A implements B, C {}
-declare class A implements B {}
-declare class A mixins B implements C {}
-declare class A implements B, C {}
+class A1 implements B {}
+class A2 implements B, C {}
+declare class A3 implements B {}
+declare class A4 mixins B implements C {}
+declare class A5 implements B, C {}
diff --git a/packages/babel-generator/test/fixtures/flow/implements/output.js b/packages/babel-generator/test/fixtures/flow/implements/output.js
index 6f2f01668147..b1bd305e650a 100644
--- a/packages/babel-generator/test/fixtures/flow/implements/output.js
+++ b/packages/babel-generator/test/fixtures/flow/implements/output.js
@@ -1,7 +1,7 @@
-class A implements B {}
+class A1 implements B {}
-class A implements B, C {}
+class A2 implements B, C {}
-declare class A implements B {}
-declare class A mixins B implements C {}
-declare class A implements B, C {}
\ No newline at end of file
+declare class A3 implements B {}
+declare class A4 mixins B implements C {}
+declare class A5 implements B, C {}
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/interface-types/input.js b/packages/babel-generator/test/fixtures/flow/interface-types/input.js
index e475f614c9e3..77d12fad914b 100644
--- a/packages/babel-generator/test/fixtures/flow/interface-types/input.js
+++ b/packages/babel-generator/test/fixtures/flow/interface-types/input.js
@@ -1,3 +1,4 @@
type A = interface { p: string };
type B = interface extends X { p: string };
type C = interface extends X, Y { p: string };
+type D = interface extends X.Y { p: string };
diff --git a/packages/babel-generator/test/fixtures/flow/interface-types/output.js b/packages/babel-generator/test/fixtures/flow/interface-types/output.js
index 6fa9a97f7a1f..5f648bf74774 100644
--- a/packages/babel-generator/test/fixtures/flow/interface-types/output.js
+++ b/packages/babel-generator/test/fixtures/flow/interface-types/output.js
@@ -6,4 +6,7 @@ type B = interface extends X {
};
type C = interface extends X, Y {
p: string
-};
\ No newline at end of file
+};
+type D = interface extends X.Y {
+ p: string
+};
diff --git a/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/input.js b/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/input.js
index 85decdae352b..ea741621024b 100644
--- a/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/input.js
+++ b/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/input.js
@@ -1,9 +1,9 @@
-interface A {}
-interface A extends B {}
-interface A extends B, C {}
-interface A { foo: () => number; }
+interface A1 {}
+interface A2 extends B {}
+interface A3 extends B, C {}
+interface A4 { foo: () => number; }
interface Dictionary { [index: string]: string; length: number; }
-class Foo implements Bar {}
-class Foo extends Bar implements Bat, Man {}
-class Foo extends class Bar implements Bat {} {}
-class Foo extends class Bar implements Bat {} implements Man {}
+class Foo1 implements Bar {}
+class Foo2 extends Bar implements Bat, Man {}
+class Foo3 extends class Bar implements Bat {} {}
+class Foo4 extends class Bar implements Bat {} implements Man {}
diff --git a/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/output.js b/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/output.js
index f6f4341fddb3..ef7fce8a5087 100644
--- a/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/output.js
+++ b/packages/babel-generator/test/fixtures/flow/interfaces-module-and-script/output.js
@@ -1,7 +1,7 @@
-interface A {}
-interface A extends B {}
-interface A extends B, C {}
-interface A {
+interface A1 {}
+interface A2 extends B {}
+interface A3 extends B, C {}
+interface A4 {
foo: () => number
}
interface Dictionary {
@@ -9,10 +9,10 @@ interface Dictionary {
[index: string]: string,
}
-class Foo implements Bar {}
+class Foo1 implements Bar {}
-class Foo extends Bar implements Bat, Man {}
+class Foo2 extends Bar implements Bat, Man {}
-class Foo extends class Bar implements Bat {} {}
+class Foo3 extends class Bar implements Bat {} {}
-class Foo extends class Bar implements Bat {} implements Man {}
\ No newline at end of file
+class Foo4 extends class Bar implements Bat {} implements Man {}
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/internal-slot/input.js b/packages/babel-generator/test/fixtures/flow/internal-slot/input.js
index 7888fc6cb43e..b00d3bd76f22 100644
--- a/packages/babel-generator/test/fixtures/flow/internal-slot/input.js
+++ b/packages/babel-generator/test/fixtures/flow/internal-slot/input.js
@@ -1,7 +1,7 @@
declare class C { static [[foo]]: T }
declare class C { [[foo]]: T }
-interface T { [[foo]]: X }
-interface T { [[foo]](): X }
-type T = { [[foo]]: X }
-type T = { [[foo]](): X }
-type T = { [[foo]]?: X }
+interface I { [[foo]]: X }
+interface I { [[foo]](): X }
+type T1 = { [[foo]]: X }
+type T2 = { [[foo]](): X }
+type T3 = { [[foo]]?: X }
diff --git a/packages/babel-generator/test/fixtures/flow/internal-slot/output.js b/packages/babel-generator/test/fixtures/flow/internal-slot/output.js
index a8c375a2c456..2a48fb9f186a 100644
--- a/packages/babel-generator/test/fixtures/flow/internal-slot/output.js
+++ b/packages/babel-generator/test/fixtures/flow/internal-slot/output.js
@@ -4,18 +4,18 @@ declare class C {
declare class C {
[[foo]]: T
}
-interface T {
+interface I {
[[foo]]: X
}
-interface T {
+interface I {
[[foo]]() => X
}
-type T = {
+type T1 = {
[[foo]]: X
};
-type T = {
+type T2 = {
[[foo]]() => X
};
-type T = {
+type T3 = {
[[foo]]?: X
-};
+};
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/object-literal-types-compact/input.js b/packages/babel-generator/test/fixtures/flow/object-literal-types-compact/input.js
new file mode 100644
index 000000000000..08324814210d
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/flow/object-literal-types-compact/input.js
@@ -0,0 +1,4 @@
+type T1 = { ... };
+type T2 = { a: { b: { c: {...}, ... }, ... } }
+type T3 = { foo: number, ... };
+type T4 = { foo: number, bar: string, ... };
diff --git a/packages/babel-generator/test/fixtures/flow/object-literal-types-compact/options.json b/packages/babel-generator/test/fixtures/flow/object-literal-types-compact/options.json
new file mode 100644
index 000000000000..eb4e948bfaa5
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/flow/object-literal-types-compact/options.json
@@ -0,0 +1,3 @@
+{
+ "compact": true
+}
diff --git a/packages/babel-generator/test/fixtures/flow/object-literal-types-compact/output.js b/packages/babel-generator/test/fixtures/flow/object-literal-types-compact/output.js
new file mode 100644
index 000000000000..a0027248e9a5
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/flow/object-literal-types-compact/output.js
@@ -0,0 +1 @@
+type T1={...};type T2={a:{b:{c:{...},...},...}};type T3={foo:number,...};type T4={foo:number,bar:string,...};
diff --git a/packages/babel-generator/test/fixtures/flow/object-literal-types/input.js b/packages/babel-generator/test/fixtures/flow/object-literal-types/input.js
index 6d747ee65e10..9733370c5ff8 100644
--- a/packages/babel-generator/test/fixtures/flow/object-literal-types/input.js
+++ b/packages/babel-generator/test/fixtures/flow/object-literal-types/input.js
@@ -1,11 +1,15 @@
type U = {};
type V = {};
-type T = { ...U, };
-type T = { ...U, ...V };
-type T = { p: V, ...U };
-type T = { ...U, p: V, };
-type T = { ...{}|{ p: V, }};
-type T = { foo(): number }
-type T = { foo: () => number }
-type T = { [string]: U };
-type T = { [param: string]: U };
+type T1 = { ...U, };
+type T2 = { ...U, ...V };
+type T3 = { p: V, ...U };
+type T4 = { ...U, p: V, };
+type T5 = { ...{}|{ p: V, }};
+type T6 = { foo(): number }
+type T7 = { foo: () => number }
+type T8 = { [string]: U };
+type T9 = { [param: string]: U };
+type T10 = { ... };
+type T11 = { a: { b: { c: {...}, ... }, ... } }
+type T12 = { foo: number, ... };
+type T13 = { foo: number, bar: string, ... };
diff --git a/packages/babel-generator/test/fixtures/flow/object-literal-types/output.js b/packages/babel-generator/test/fixtures/flow/object-literal-types/output.js
index 952f62e3022e..2a3769b1abd5 100644
--- a/packages/babel-generator/test/fixtures/flow/object-literal-types/output.js
+++ b/packages/babel-generator/test/fixtures/flow/object-literal-types/output.js
@@ -1,30 +1,49 @@
type U = {};
type V = {};
-type T = { ...U
+type T1 = { ...U
};
-type T = { ...U,
+type T2 = { ...U,
...V,
};
-type T = {
+type T3 = {
p: V,
...U,
};
-type T = { ...U,
+type T4 = { ...U,
p: V,
};
-type T = { ...{} | {
+type T5 = { ...{} | {
p: V
}
};
-type T = {
+type T6 = {
foo(): number
};
-type T = {
+type T7 = {
foo: () => number
};
-type T = {
+type T8 = {
[string]: U
};
-type T = {
+type T9 = {
[param: string]: U
-};
\ No newline at end of file
+};
+type T10 = {...};
+type T11 = {
+ a: {
+ b: {
+ c: {...},
+ ...
+ },
+ ...
+ }
+};
+type T12 = {
+ foo: number,
+ ...
+};
+type T13 = {
+ foo: number,
+ bar: string,
+ ...
+};
diff --git a/packages/babel-generator/test/fixtures/flow/opaque-type-alias/input.js b/packages/babel-generator/test/fixtures/flow/opaque-type-alias/input.js
index 1988fcaeed71..3e77fce2b1ca 100644
--- a/packages/babel-generator/test/fixtures/flow/opaque-type-alias/input.js
+++ b/packages/babel-generator/test/fixtures/flow/opaque-type-alias/input.js
@@ -1,7 +1,7 @@
opaque type ID = string;
opaque type Foo = Bar;
opaque type Maybe = _Maybe;
-export opaque type Foo = number;
+export opaque type Foo2 = number;
opaque type union =
| {type: "A"}
diff --git a/packages/babel-generator/test/fixtures/flow/opaque-type-alias/output.js b/packages/babel-generator/test/fixtures/flow/opaque-type-alias/output.js
index d5868b9298d7..293f54010947 100644
--- a/packages/babel-generator/test/fixtures/flow/opaque-type-alias/output.js
+++ b/packages/babel-generator/test/fixtures/flow/opaque-type-alias/output.js
@@ -1,10 +1,10 @@
opaque type ID = string;
opaque type Foo = Bar;
opaque type Maybe = _Maybe;
-export opaque type Foo = number;
+export opaque type Foo2 = number;
opaque type union = {
type: "A"
} | {
type: "B"
};
-opaque type overloads = (x: string) => number & (x: number) => string;
\ No newline at end of file
+opaque type overloads = ((x: string) => number) & ((x: number) => string);
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/parantheses/input.js b/packages/babel-generator/test/fixtures/flow/parantheses/input.js
new file mode 100644
index 000000000000..f7e2c3973871
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/flow/parantheses/input.js
@@ -0,0 +1,3 @@
+type A = ((T) => $Foo) & ((T) => $Foo);
+type B = ((T) => $Foo) | ((T) => $Foo);
+type C = ((T) => $Foo)[];
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/parantheses/output.js b/packages/babel-generator/test/fixtures/flow/parantheses/output.js
new file mode 100644
index 000000000000..f7e2c3973871
--- /dev/null
+++ b/packages/babel-generator/test/fixtures/flow/parantheses/output.js
@@ -0,0 +1,3 @@
+type A = ((T) => $Foo) & ((T) => $Foo);
+type B = ((T) => $Foo) | ((T) => $Foo);
+type C = ((T) => $Foo)[];
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/predicates/input.js b/packages/babel-generator/test/fixtures/flow/predicates/input.js
index bbbbe2c8f2a6..8e614a82f184 100644
--- a/packages/babel-generator/test/fixtures/flow/predicates/input.js
+++ b/packages/babel-generator/test/fixtures/flow/predicates/input.js
@@ -12,6 +12,6 @@ function is_string(x): boolean %checks {
var f = (x: mixed): %checks => typeof x === "string";
-const foo = (x: mixed): boolean %checks => typeof x === "string";
+const foo2 = (x: mixed): boolean %checks => typeof x === "string";
(x): %checks => x !== null;
diff --git a/packages/babel-generator/test/fixtures/flow/predicates/output.js b/packages/babel-generator/test/fixtures/flow/predicates/output.js
index 23ddac63478f..bc1ac228aaa1 100644
--- a/packages/babel-generator/test/fixtures/flow/predicates/output.js
+++ b/packages/babel-generator/test/fixtures/flow/predicates/output.js
@@ -12,6 +12,6 @@ function is_string(x): boolean %checks {
var f = (x: mixed): %checks => typeof x === "string";
-const foo = (x: mixed): boolean %checks => typeof x === "string";
+const foo2 = (x: mixed): boolean %checks => typeof x === "string";
x: %checks => x !== null;
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/string-literal-types/input.js b/packages/babel-generator/test/fixtures/flow/string-literal-types/input.js
index 6acd7f134271..a80478634827 100644
--- a/packages/babel-generator/test/fixtures/flow/string-literal-types/input.js
+++ b/packages/babel-generator/test/fixtures/flow/string-literal-types/input.js
@@ -1,2 +1,2 @@
-function createElement(tagName: "div"): HTMLDivElement {}
-function createElement(tagName: 'div'): HTMLDivElement {}
+function createElement1(tagName: "div"): HTMLDivElement {}
+function createElement2(tagName: 'div'): HTMLDivElement {}
diff --git a/packages/babel-generator/test/fixtures/flow/string-literal-types/output.js b/packages/babel-generator/test/fixtures/flow/string-literal-types/output.js
index 97251990f3ea..523469a5c34f 100644
--- a/packages/babel-generator/test/fixtures/flow/string-literal-types/output.js
+++ b/packages/babel-generator/test/fixtures/flow/string-literal-types/output.js
@@ -1,3 +1,3 @@
-function createElement(tagName: "div"): HTMLDivElement {}
+function createElement1(tagName: "div"): HTMLDivElement {}
-function createElement(tagName: 'div'): HTMLDivElement {}
\ No newline at end of file
+function createElement2(tagName: 'div'): HTMLDivElement {}
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/type-alias/input.js b/packages/babel-generator/test/fixtures/flow/type-alias/input.js
index ed16c5d28d5a..c1d567e6dfdd 100644
--- a/packages/babel-generator/test/fixtures/flow/type-alias/input.js
+++ b/packages/babel-generator/test/fixtures/flow/type-alias/input.js
@@ -1,7 +1,7 @@
type FBID = number;
type Foo = Bar;
type Maybe = _Maybe;
-export type Foo = number;
+export type Foo2 = number;
type union =
| {type: "A"}
@@ -14,3 +14,5 @@ type overloads =
;
type func = string => string;
+
+type D = X.Y;
diff --git a/packages/babel-generator/test/fixtures/flow/type-alias/output.js b/packages/babel-generator/test/fixtures/flow/type-alias/output.js
index dc12829d21c7..51933a7a774e 100644
--- a/packages/babel-generator/test/fixtures/flow/type-alias/output.js
+++ b/packages/babel-generator/test/fixtures/flow/type-alias/output.js
@@ -1,11 +1,12 @@
type FBID = number;
type Foo = Bar;
type Maybe = _Maybe;
-export type Foo = number;
+export type Foo2 = number;
type union = {
type: "A"
} | {
type: "B"
};
-type overloads = (x: string) => number & (x: number) => string;
+type overloads = ((x: string) => number) & ((x: number) => string);
type func = (string) => string;
+type D = X.Y;
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/type-annotations/input.js b/packages/babel-generator/test/fixtures/flow/type-annotations/input.js
index d94dd1ce665c..e7335c30b72a 100644
--- a/packages/babel-generator/test/fixtures/flow/type-annotations/input.js
+++ b/packages/babel-generator/test/fixtures/flow/type-annotations/input.js
@@ -1,130 +1,130 @@
-function foo(numVal: any) {}
-function foo(numVal: number) {}
-function foo(numVal: number, strVal: string) {}
-function foo(numVal: number, untypedVal) {}
-function foo(untypedVal, numVal: number) {}
-function foo(nullableNum: ?number) {}
-function foo(callback: () => void) {}
-function foo(callback: () => number) {}
-function foo(callback: (_: bool) => number) {}
-function foo(callback: (_1: bool, _2: string) => number) {}
-function foo(callback: (_1: bool, ...foo: Array) => number) {}
-function foo(): number{}
-function foo():() => void {}
-function foo():(_:bool) => number{}
-function foo():(_?:bool) => number{}
-function foo(): {} {}
-function foo() {}
-function foo() {}
-function foo() {}
-a = function() {};
-a = { set fooProp(value: number) {} };
-a = { set fooProp(value: number): void {} };
-a = { get fooProp():number{} };
-a = { id(x: T): T {} };
-a = { *id(x: T): T {} };
-a = { async id(x: T): T {} };
-a = { 123(x: T): T {} };
-class Foo {
+function foo1(numVal: any) {}
+function foo2(numVal: number) {}
+function foo3(numVal: number, strVal: string) {}
+function foo4(numVal: number, untypedVal) {}
+function foo5(untypedVal, numVal: number) {}
+function foo6(nullableNum: ?number) {}
+function foo7(callback: () => void) {}
+function foo8(callback: () => number) {}
+function foo9(callback: (_: bool) => number) {}
+function foo10(callback: (_1: bool, _2: string) => number) {}
+function foo11(callback: (_1: bool, ...foo: Array) => number) {}
+function foo12(): number{}
+function foo13():() => void {}
+function foo14():(_:bool) => number{}
+function foo15():(_?:bool) => number{}
+function foo16(): {} {}
+function foo17() {}
+function foo18() {}
+function foo19() {}
+a1 = function() {};
+a2 = { set fooProp(value: number) {} };
+a3 = { set fooProp(value: number): void {} };
+a4 = { get fooProp():number{} };
+a5 = { id(x: T): T {} };
+a6 = { *id(x: T): T {} };
+a7 = { async id(x: T): T {} };
+a8 = { 123(x: T): T {} };
+class Foo1 {
set fooProp(value: number) {}
}
-class Foo {
+class Foo2 {
set fooProp(value: number): void {}
}
-class Foo {
+class Foo3 {
get fooProp(): number {}
}
-var numVal: number;
-var numVal: empty;
-var numVal: mixed;
-var numVal: number = otherNumVal;
-var a: { numVal: number };
-var a: { numVal: number; };
-var a: { numVal: number; [indexer: string]: number };
-var a: ?{ numVal: number };
-var a: { numVal: number; strVal: string }
-var a: { subObj: {strVal: string} }
-var a: { subObj: ?{strVal: string} }
-var a: { param1: number; param2: string }
-var a: { param1: number; param2?: string }
-var a: { [a: number]: string; [b: number]: string; };
-var a: { add(x: number, ...y: Array): void };
-var a: { subtract: (x: number, ...y: Array) => void };
-var a: { id(x: T): T; };
-var a:Array = [1, 2, 3]
-a = class Foo {}
-a = class Foo extends Bar {}
-class Foo {}
-class Foo extends Bar {}
-class Foo extends mixin(Bar) {}
-class Foo {
+var numVal1: number;
+var numVal2: empty;
+var numVal3: mixed;
+var numVal4: number = otherNumVal;
+var a1: { numVal: number };
+var a2: { numVal: number; };
+var a3: { numVal: number; [indexer: string]: number };
+var a4: ?{ numVal: number };
+var a5: { numVal: number; strVal: string }
+var a6: { subObj: {strVal: string} }
+var a7: { subObj: ?{strVal: string} }
+var a8: { param1: number; param2: string }
+var a9: { param1: number; param2?: string }
+var a10: { [a: number]: string; [b: number]: string; };
+var a11: { add(x: number, ...y: Array): void };
+var a12: { subtract: (x: number, ...y: Array) => void };
+var a13: { id(x: T): T; };
+var a14:Array = [1, 2, 3]
+a13 = class Foo {}
+a14 = class Foo extends Bar {}
+class Foo4 {}
+class Foo5 extends Bar {}
+class Foo6 extends mixin(Bar) {}
+class Foo7 {
bar():number { return 42; }
}
-class Foo {
+class Foo8 {
"bar"() {}
}
-function foo(requiredParam, optParam?) {}
-class Foo {
+function foo20(requiredParam, optParam?) {}
+class Foo9 {
prop1: string;
prop2: number;
}
-class Foo {
+class Foo10 {
static prop1: string;
prop2: number;
}
-class Foo {
+class Foo11 {
#prop1: string;
prop2: number;
}
-var x: number | string = 4;
+var x1: number | string = 4;
class Array { concat(items:number | string) {}; }
-var x: () => number | () => string = fn;
-var x: typeof Y = Y;
-var x: typeof Y | number = Y;
-var {x}: {x: string; } = { x: "hello" };
-var {x}: {x: string } = { x: "hello" };
-var [x]: Array = [ "hello" ];
-function foo({x}: { x: string; }) {}
-function foo([x]: Array) {}
-function foo(...rest: Array) {}
+var x2: () => number | () => string = fn;
+var x3: typeof Y = Y;
+var x4: typeof Y | number = Y;
+var {x5}: {x5: string; } = { x5: "hello" };
+var {x6}: {x6: string } = { x6: "hello" };
+var [x7]: Array = [ "hello" ];
+function foo21({x}: { x: string; }) {}
+function foo22([x]: Array) {}
+function foo23(...rest: Array) {}
(function (...rest: Array) {});
((...rest: Array) => rest);
-var a: Map >
-var a: Map>
-var a: number[]
-var a: ?string[]
-var a: Promise[]
-var a:(...rest:Array) => number
-var identity: (x: T) => T
-var identity: (x: T, ...y:T[]) => T
-import type foo from "bar";
-import type { foo, bar } from "baz";
-import type { foo as bar } from "baz";
+var a15: Map >
+var a16: Map>
+var a17: number[]
+var a18: ?string[]
+var a19: Promise[]
+var a20:(...rest:Array) => number
+var identity1: (x: T) => T
+var identity2: (x: T, ...y:T[]) => T
+import type foo24 from "bar";
+import type { foo25, bar1 } from "baz";
+import type { foo as bar2 } from "baz";
import type from "foo";
-import type, { foo } from "bar";
+import type2, { foo26 } from "bar";
import typeof * as namespace from "bar";
-import { type Foo } from "bar";
-import { typeof Foo } from "bar";
-import { type Foo as Bar } from "bar";
-import { typeof Foo as Bar } from "bar";
-export type { foo };
+import { type Foo12 } from "bar";
+import { typeof Foo13 } from "bar";
+import { type Foo as Bar1 } from "bar";
+import { typeof Foo as Bar2 } from "bar";
+export type { foo1 };
export type { bar } from "bar";
export interface baz { p: number }
export interface qux { p: T }
-var a: ?Array;
-var a: {| numVal: number |};
-var a: {| numVal: number; |};
-var a: {| numVal: number; [indexer: string]: number |};
-var a: ?{| numVal: number |};
-var a: {| numVal: number; strVal: string |}
-var a: {| subObj: {strVal: string} |}
-var a: {| subObj: ?{strVal: string} |}
-var a: {| param1: number; param2: string |}
-var a: {| param1: number; param2?: string |}
-var a: {| [a: number]: string; [b: number]: string; |};
-var a: {| add(x: number, ...y: Array): void |};
-var a: {| subtract: (x: number, ...y: Array) => void |};
-var a: {| id(x: T): T; |};
-function foo(numVal: number = 2) {}
-function foo(numVal?: number = 2) {}
+var a21: ?Array;
+var a22: {| numVal: number |};
+var a23: {| numVal: number; |};
+var a24: {| numVal: number; [indexer: string]: number |};
+var a25: ?{| numVal: number |};
+var a26: {| numVal: number; strVal: string |}
+var a27: {| subObj: {strVal: string} |}
+var a28: {| subObj: ?{strVal: string} |}
+var a29: {| param1: number; param2: string |}
+var a30: {| param1: number; param2?: string |}
+var a31: {| [a: number]: string; [b: number]: string; |};
+var a32: {| add(x: number, ...y: Array): void |};
+var a33: {| subtract: (x: number, ...y: Array) => void |};
+var a34: {| id(x: T): T; |};
+function foo27(numVal: number = 2) {}
+function foo28(numVal?: number = 2) {}
export type * from "foo";
diff --git a/packages/babel-generator/test/fixtures/flow/type-annotations/output.js b/packages/babel-generator/test/fixtures/flow/type-annotations/output.js
index 433354505279..6465359f336d 100644
--- a/packages/babel-generator/test/fixtures/flow/type-annotations/output.js
+++ b/packages/babel-generator/test/fixtures/flow/type-annotations/output.js
@@ -1,237 +1,237 @@
-function foo(numVal: any) {}
+function foo1(numVal: any) {}
-function foo(numVal: number) {}
+function foo2(numVal: number) {}
-function foo(numVal: number, strVal: string) {}
+function foo3(numVal: number, strVal: string) {}
-function foo(numVal: number, untypedVal) {}
+function foo4(numVal: number, untypedVal) {}
-function foo(untypedVal, numVal: number) {}
+function foo5(untypedVal, numVal: number) {}
-function foo(nullableNum: ?number) {}
+function foo6(nullableNum: ?number) {}
-function foo(callback: () => void) {}
+function foo7(callback: () => void) {}
-function foo(callback: () => number) {}
+function foo8(callback: () => number) {}
-function foo(callback: (_: boolean) => number) {}
+function foo9(callback: (_: boolean) => number) {}
-function foo(callback: (_1: boolean, _2: string) => number) {}
+function foo10(callback: (_1: boolean, _2: string) => number) {}
-function foo(callback: (_1: boolean, ...foo: Array) => number) {}
+function foo11(callback: (_1: boolean, ...foo: Array) => number) {}
-function foo(): number {}
+function foo12(): number {}
-function foo(): () => void {}
+function foo13(): () => void {}
-function foo(): (_: boolean) => number {}
+function foo14(): (_: boolean) => number {}
-function foo(): (_?: boolean) => number {}
+function foo15(): (_?: boolean) => number {}
-function foo(): {} {}
+function foo16(): {} {}
-function foo() {}
+function foo17() {}
-function foo() {}
+function foo18() {}
-function foo() {}
+function foo19() {}
-a = function () {};
+a1 = function () {};
-a = {
+a2 = {
set fooProp(value: number) {}
};
-a = {
+a3 = {
set fooProp(value: number): void {}
};
-a = {
+a4 = {
get fooProp(): number {}
};
-a = {
+a5 = {
id(x: T): T {}
};
-a = {
+a6 = {
*id(x: T): T {}
};
-a = {
+a7 = {
async id(x: T): T {}
};
-a = {
+a8 = {
123(x: T): T {}
};
-class Foo {
+class Foo1 {
set fooProp(value: number) {}
}
-class Foo {
+class Foo2 {
set fooProp(value: number): void {}
}
-class Foo {
+class Foo3 {
get fooProp(): number {}
}
-var numVal: number;
-var numVal: empty;
-var numVal: mixed;
-var numVal: number = otherNumVal;
-var a: {
+var numVal1: number;
+var numVal2: empty;
+var numVal3: mixed;
+var numVal4: number = otherNumVal;
+var a1: {
numVal: number
};
-var a: {
+var a2: {
numVal: number
};
-var a: {
+var a3: {
numVal: number,
[indexer: string]: number,
};
-var a: ?{
+var a4: ?{
numVal: number
};
-var a: {
+var a5: {
numVal: number,
strVal: string,
};
-var a: {
+var a6: {
subObj: {
strVal: string
}
};
-var a: {
+var a7: {
subObj: ?{
strVal: string
}
};
-var a: {
+var a8: {
param1: number,
param2: string,
};
-var a: {
+var a9: {
param1: number,
param2?: string,
};
-var a: {
+var a10: {
[a: number]: string,
[b: number]: string,
};
-var a: {
+var a11: {
add(x: number, ...y: Array): void
};
-var a: {
+var a12: {
subtract: (x: number, ...y: Array) => void
};
-var a: {
+var a13: {
id(x: T): T
};
-var a: Array = [1, 2, 3];
-a = class Foo {};
-a = class Foo extends Bar {};
+var a14: Array = [1, 2, 3];
+a13 = class Foo {};
+a14 = class Foo extends Bar {};
-class Foo {}
+class Foo4 {}
-class Foo extends Bar {}
+class Foo5 extends Bar {}
-class Foo extends mixin(Bar) {}
+class Foo6 extends mixin(Bar) {}
-class Foo {
+class Foo7 {
bar(): number {
return 42;
}
}
-class Foo {
+class Foo8 {
"bar"() {}
}
-function foo(requiredParam, optParam?) {}
+function foo20(requiredParam, optParam?) {}
-class Foo {
+class Foo9 {
prop1: string;
prop2: number;
}
-class Foo {
+class Foo10 {
static prop1: string;
prop2: number;
}
-class Foo {
+class Foo11 {
#prop1: string;
prop2: number;
}
-var x: number | string = 4;
+var x1: number | string = 4;
class Array {
concat(items: number | string) {}
}
-var x: () => number | () => string = fn;
-var x: typeof Y = Y;
-var x: typeof Y | number = Y;
+var x2: () => number | (() => string) = fn;
+var x3: typeof Y = Y;
+var x4: typeof Y | number = Y;
var {
- x
+ x5
}: {
- x: string
+ x5: string
} = {
- x: "hello"
+ x5: "hello"
};
var {
- x
+ x6
}: {
- x: string
+ x6: string
} = {
- x: "hello"
+ x6: "hello"
};
-var [x]: Array = ["hello"];
+var [x7]: Array = ["hello"];
-function foo({
+function foo21({
x
}: {
x: string
}) {}
-function foo([x]: Array) {}
+function foo22([x]: Array) {}
-function foo(...rest: Array) {}
+function foo23(...rest: Array) {}
(function (...rest: Array) {});
(...rest: Array) => rest;
-var a: Map>;
-var a: Map>;
-var a: number[];
-var a: ?string[];
-var a: Promise[];
-var a: (...rest: Array) => number;
-var identity: (x: T) => T;
-var identity: (x: T, ...y: T[]) => T;
-import type foo from "bar";
-import type { foo, bar } from "baz";
-import type { foo as bar } from "baz";
+var a15: Map>;
+var a16: Map>;
+var a17: number[];
+var a18: ?string[];
+var a19: Promise[];
+var a20: (...rest: Array) => number;
+var identity1: (x: T) => T;
+var identity2: (x: T, ...y: T[]) => T;
+import type foo24 from "bar";
+import type { foo25, bar1 } from "baz";
+import type { foo as bar2 } from "baz";
import type from "foo";
-import type, { foo } from "bar";
+import type2, { foo26 } from "bar";
import typeof * as namespace from "bar";
-import { type Foo } from "bar";
-import { typeof Foo } from "bar";
-import { type Foo as Bar } from "bar";
-import { typeof Foo as Bar } from "bar";
-export type { foo };
+import { type Foo12 } from "bar";
+import { typeof Foo13 } from "bar";
+import { type Foo as Bar1 } from "bar";
+import { typeof Foo as Bar2 } from "bar";
+export type { foo1 };
export type { bar } from "bar";
export interface baz {
p: number
@@ -239,58 +239,58 @@ export interface baz {
export interface qux {
p: T
}
-var a: ?Array;
-var a: {|
+var a21: ?Array;
+var a22: {|
numVal: number
|};
-var a: {|
+var a23: {|
numVal: number
|};
-var a: {|
+var a24: {|
numVal: number,
[indexer: string]: number,
|};
-var a: ?{|
+var a25: ?{|
numVal: number
|};
-var a: {|
+var a26: {|
numVal: number,
strVal: string,
|};
-var a: {|
+var a27: {|
subObj: {
strVal: string
}
|};
-var a: {|
+var a28: {|
subObj: ?{
strVal: string
}
|};
-var a: {|
+var a29: {|
param1: number,
param2: string,
|};
-var a: {|
+var a30: {|
param1: number,
param2?: string,
|};
-var a: {|
+var a31: {|
[a: number]: string,
[b: number]: string,
|};
-var a: {|
+var a32: {|
add(x: number, ...y: Array): void
|};
-var a: {|
+var a33: {|
subtract: (x: number, ...y: Array) => void
|};
-var a: {|
+var a34: {|
id(x: T): T
|};
-function foo(numVal: number = 2) {}
+function foo27(numVal: number = 2) {}
-function foo(numVal?: number = 2) {}
+function foo28(numVal?: number = 2) {}
export type * from "foo";
\ No newline at end of file
diff --git a/packages/babel-generator/test/fixtures/flow/type-parameters/input.js b/packages/babel-generator/test/fixtures/flow/type-parameters/input.js
index a995d06499f4..5d0b94ca1569 100644
--- a/packages/babel-generator/test/fixtures/flow/type-parameters/input.js
+++ b/packages/babel-generator/test/fixtures/flow/type-parameters/input.js
@@ -1,21 +1,21 @@
-type A = T;
-type A = T;
-type A = T;
-type A = T;
-type A = T;
-class A {}
-class A {}
-class A {}
-class A {}
-(class A {});
-(class A {});
-(class A {});
-(class A {});
-declare class A {}
-declare class A {}
-declare class A {}
-declare class A {}
-interface A {}
-interface A {}
-interface A {}
-interface A {}
+type A1 = T;
+type A2 = T;
+type A3 = T;
+type A4 = T;
+type A5 = T;
+class A6 {}
+class A7