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

Meta: create a tool to upgrade users to Babel 7 #44

Closed
hzoo opened this issue Nov 7, 2017 · 4 comments
Closed

Meta: create a tool to upgrade users to Babel 7 #44

hzoo opened this issue Nov 7, 2017 · 4 comments

Comments

@hzoo
Copy link
Member

@hzoo hzoo commented Nov 7, 2017

It would be something that would work for 90% of most users (not using babel-core directly or any crazy options), would love for the community to come together to help out with this, especially as everyone is trying to update to v7 (at least can comment on the kinds of issues you have faced to see if they can be automated).

Because most of this is json, we need a tool that handles json files.

List of packages: https://gist.github.com/hzoo/3b78b8225ffddc34483785018664390e (not all have an equivalent because they can be new for v7)

Scoped packages

  • Rename packages in package.json
    • Things like "babel-core": "6.26.0" -> "@babel/core": "7.0.0-beta.31" (support changing to the beta version or whatever is in the latest dist tag on npm)
  • Fix config in .babelrc
    • { "presets": ["env"] } -> { "presets": ["@babel/env"] }

Renames

  • #6575 Removed all -es20xx- prefixes from packages

babel-plugin-transform-es2015-classes -> babel-plugin-transform-classes
transform-es3-member-expression-literals -> transform-member-expression-literals

  • #6573 Merged transform-async-to-module-method into transform-async-to-generator as an option

change package json, modify babelrc.

  • #6570 Proposals are renamed

babel-plugin-transform-class-properties -> babel-plugin-proposal-class-properties

Peer Dep on @babel/core

This means if there wasn't a @babel/core at the top level, it should be added in package.json

.babelrc.js

Not sure if we have to do this, not reason to change if it's not necessary.

I think if they are using the "env" key a lot we could change it. The reason why we can change the config in the first place is because it's json and not js

@babel/node

I think we should probably add @babel/node back as a dependency in cli anyway

Add @babel/node as a dependency if they are using it in scripts.

@Andarist
Copy link
Member

@Andarist Andarist commented Nov 7, 2017

Fix config in .babelrc

I know many people using a clever trick of doing {"presets": ["./.babelrc.js"]} in .babelrc. It would be nice to upgrade automatically those requested presets with relative paths.

@rajasekarm
Copy link
Member

@rajasekarm rajasekarm commented Nov 10, 2017

@hzoo
Copy link
Member Author

@hzoo hzoo commented Feb 19, 2018

Ok closing since this is somewhat working already and we can add issues there instead. https://twitter.com/left_pad/status/965587130977275905

@hzoo hzoo closed this Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.