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

fix transform-flow-comments for import types #9901

Merged

Conversation

tanhauhau
Copy link
Member

Q                       A
Fixed Issues? Fixes #6142
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

@@ -16,10 +16,12 @@
"@babel/plugin-syntax-flow": "^7.2.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
"@babel/core": "^7.0.0-0",
"@babel/generator": "^7.0.0-0"
Copy link
Member

Choose a reason for hiding this comment

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

Requiring users to install a new package is a breaking change.
I believe you can import it from @babel/core.

Copy link
Member Author

Choose a reason for hiding this comment

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

interestingly @babel/core does not export generate function from @babel/generator, should I export it out from @babel/core?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I didn't know that.
If we added a generate export, we couldn't use it in this plugin anyway because it needs to be compatible with @babel/core@^7.0.0. We can add @babel/generator to the dependencies of this plugin.

Copy link
Member Author

Choose a reason for hiding this comment

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

erm. then is it okay to use @babel/generator as peerDependency? since it's @babel/core's dependency

Copy link
Member

Choose a reason for hiding this comment

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

No, because peer dependencies must be explicitly installed by the user, otherwise npm will log a warning

@nicolo-ribaudo nicolo-ribaudo added area: comments area: flow PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Apr 26, 2019
existentialism
existentialism previously approved these changes Apr 26, 2019
@existentialism existentialism dismissed their stale review April 26, 2019 14:35

🤦‍♂️

@tanhauhau tanhauhau force-pushed the tanlh/fix/flow-comment-import-type branch from 64870e6 to e4dd3b4 Compare May 7, 2019 14:21
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10766/

@tanhauhau
Copy link
Member Author

@existentialism is there something any improvements I can make for this PR to be merged?

Copy link
Member

@existentialism existentialism left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: comments area: flow outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flow comments plugin creates incorrect code
4 participants