Skip to content

fix transform-flow-comments for import types#9901

Merged
nicolo-ribaudo merged 2 commits into
babel:masterfrom
tanhauhau:tanlh/fix/flow-comment-import-type
Jul 13, 2019
Merged

fix transform-flow-comments for import types#9901
nicolo-ribaudo merged 2 commits into
babel:masterfrom
tanhauhau:tanlh/fix/flow-comment-import-type

Conversation

@tanhauhau

Copy link
Copy Markdown
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

"peerDependencies": {
"@babel/core": "^7.0.0-0"
"@babel/core": "^7.0.0-0",
"@babel/generator": "^7.0.0-0"

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

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

@tanhauhau

Copy link
Copy Markdown
Member Author

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

@existentialism existentialism left a comment

Copy link
Copy Markdown
Member

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