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: Upgrade to babel 7, drop Node 4 support. #158

Merged
merged 1 commit into from
Jun 27, 2018

Conversation

coreyfarrell
Copy link
Member

BREAKING CHANGE: Drop node 4 support, upgrade to babel 7.

This is makes use of what is currently istanbul-lib-instrument@next and test-exclude@next. Note I was not able to find documentation about this.file.inputMap.sourcemap - this was found by dumping and inspecting this.file, looking for the object matching this.file.opts.inputSourceMap from babel@6.

@coveralls
Copy link

coveralls commented Jun 6, 2018

Coverage Status

Coverage increased (+0.09%) to 97.059% when pulling 0293dd7 on coreyfarrell:babel7 into 321740f on istanbuljs:master.

Copy link
Member

@JaKXz JaKXz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall :) but as mentioned, my review is not necessarily complete.

package.json Outdated
"find-up": "^2.1.0",
"istanbul-lib-instrument": "^1.10.1",
"test-exclude": "^4.2.1"
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.51",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably introduce a package-lock.json since that seems to be our preference :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this.

- "6"
- "8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been using the following config recently to not have to worry about keeping this list up to date... however, we do technically support one LTS version back (v6, in this case). It would be nice if there was an alias for that but I don't know of one.

- "lts/*"
- "stable"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think testing of the oldest version we support is worth it, node.js major release cycle is long enough that adding new versions when needed isn't a big deal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm with @coreyfarrell on this one, I like that it's more explicit.

Copy link
Member

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coreyfarrell regarding this.file.opts.inputSourceMap, do we have any tests in place related to this feature? I don't 100% remember when this logic was added, it might be worth:

  1. going through the commit history and finding out when we added this sourceMap handling.
  2. making sure we have an appropriate test in place, since the logic is changing slightly.

I'm excited to land this rework you've done ... I think we'll want to release it to a next branch, and then reach out to someone at Jest (CC: @aaronabramov) to make sure that the upgrade is smooth ... I'm a little gun shy about releasing the 2.x Istanbul packages to latest, without having a plan for synchronizing the release with Jest.

- "6"
- "8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm with @coreyfarrell on this one, I like that it's more explicit.

package.json Outdated
"find-up": "^2.1.0",
"istanbul-lib-instrument": "^1.10.1",
"test-exclude": "^4.2.1"
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.51",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@loganfsmyth, from the babel project, points out that we should revert using @babel/plugin-syntax-object-rest-spread; I think this major release is a good time to do so:

#141 (review)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@bcoe
Copy link
Member

bcoe commented Jun 26, 2018

CC: @aaronabramov we're close to switching Istanbul over to using Babel 7; I'd like to coordinate with Jest and make sure this doesn't blow anything up, before we switch over to the latest tag.

@aaronabramov
Copy link

yeah! i can test it with jest. can you publish an alpha version so i could run it on a few codebases and see if everything works?

BREAKING CHANGE: Drop node 4 support, upgrade to babel 7.

In addition this removes @babel/plugin-syntax-object-rest-spread from
this plugin.  Users who require this language feature will have to
include it manually.
@coreyfarrell
Copy link
Member Author

regarding this.file.opts.inputSourceMap, do we have any tests in place related to this feature?

@bcoe Yes we have babel-plugin-istanbul / source maps / should use inline source map which fails under babel 7 without the change from this.file.opts.inputSourceMap to this.file.inputMap.sourcemap.

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.

5 participants