Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(package): update to Babel 7 (beta) #96

Merged
merged 1 commit into from
Jan 19, 2018
Merged

Conversation

ybiquitous
Copy link
Owner

@ybiquitous ybiquitous commented Jan 13, 2018

Update process

# Uninstall old packages
yarn remove babel-{cli,preset-env,register,plugin-transform-object-rest-spread}

# Install new packages
yarn add --dev @babel/{cli,core,preset-env,register}

Notes

  • babel-plugin-istanbul doesn't depend on Babel packages, so no problem without changes 😄

  • Remove babel-plugin-transform-object-rest-spread because @babel/preset-env installs @babel/plugin-proposal-object-rest-spread 😄

  • Don't remove @babel/plugin-proposal-object-rest-spread from .babelrc, otherwise tests fail 😕

Command details
$ git diff
diff --git a/.babelrc b/.babelrc
index 4c2e056..8bbff1c 100644
--- a/.babelrc
+++ b/.babelrc
@@ -3,7 +3,6 @@
     ["@babel/preset-env", {"targets": {"node": "6"}}]
   ],
   "plugins": [
-    "@babel/plugin-proposal-object-rest-spread"
   ],
   "env": {
     "test": {

$ yarn test
yarn run v1.3.2
$ nyc --check-coverage mocha
/Users/koba/git/ybiq/node_modules/@babel/core/lib/transformation/normalize-file.js:136
    throw err;
    ^

SyntaxError: /Users/koba/git/ybiq/test/helpers/exec.js: Support for the experimental syntax 'objectRestSpread' isn't currently enabled (8:12):

   6 | export default function exec(...args) {
   7 |   const options = {
>  8 |     env: { ...process.env, LANG: 'C' },
     |            ^
   9 |   }
  10 |   return new Promise((resolve, reject) => {
  11 |     cp.execFile(tested, args, options, (error, stdout, stderr) => {

Add @babel/plugin-proposal-object-rest-spread (https://git.io/vb4Ss) to the 'plugins' section of your Babel config to enable transformation.
    at Parser.raise (/Users/koba/git/ybiq/node_modules/@babel/core/node_modules/babylon/lib/index.js:832:15)
    at Parser.expectPlugin (/Users/koba/git/ybiq/node_modules/@babel/core/node_modules/babylon/lib/index.js:2217:18)
    at Parser.parseObj (/Users/koba/git/ybiq/node_modules/@babel/core/node_modules/babylon/lib/index.js:3679:14)
    at Parser.parseExprAtom (/Users/koba/git/ybiq/node_modules/@babel/core/node_modules/babylon/lib/index.js:3310:21)
    at Parser.parseExprSubscripts (/Users/koba/git/ybiq/node_modules/@babel/core/node_modules/babylon/lib/index.js:2972:21)
    at Parser.parseMaybeUnary (/Users/koba/git/ybiq/node_modules/@babel/core/node_modules/babylon/lib/index.js:2950:21)
    at Parser.parseExprOps (/Users/koba/git/ybiq/node_modules/@babel/core/node_modules/babylon/lib/index.js:2855:21)
    at Parser.parseMaybeConditional (/Users/koba/git/ybiq/node_modules/@babel/core/node_modules/babylon/lib/index.js:2825:21)
    at Parser.parseMaybeAssign (/Users/koba/git/ybiq/node_modules/@babel/core/node_modules/babylon/lib/index.js:2781:21)
    at Parser.parseObjectProperty (/Users/koba/git/ybiq/node_modules/@babel/core/node_modules/babylon/lib/index.js:3817:101)
...

@ybiquitous ybiquitous merged commit 7a99aa1 into master Jan 19, 2018
@ybiquitous ybiquitous deleted the bump-to-babel-7 branch January 19, 2018 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant