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

Add support for flow inline interfaces #4543

Merged
merged 1 commit into from
May 25, 2018
Merged

Conversation

existentialism
Copy link
Collaborator

@existentialism existentialism commented May 25, 2018

Flow commit: facebook/flow@4f93f3a

Babel commit: babel/babel#7973

Will follow up w/ flow team on making InterfaceType -> InterfaceTypeAnnotation, since it seems a bit inconsistent.

@@ -2485,6 +2485,26 @@ function printPathNoParens(path, options, print, args) {
path.call(print, "id"),
path.call(print, "typeParameters")
]);

case "InterfaceType":
case "InterfaceTypeAnnotation": {
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to combine this with the TS one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was hesitant initially, since they can't have an id or typeParameters, but I went ahead and merged it with the logic for printing flow's DeclareInterface and InterfaceDeclaration.

@existentialism existentialism merged commit e42db35 into master May 25, 2018
@existentialism existentialism deleted the flow-inline-interface branch May 25, 2018 14:17
existentialism added a commit that referenced this pull request May 25, 2018
We landed a change that added a new `InterpreterDirective` AST node type for hashbangs, and no longer add it as a comment/leadingComment.

Ref: babel/babel#7928

I mimicked what we do in `@babel/generator` here, since I found it better than trying to add comments to the ast in `parser-include-shebang.js`). Definitely open to a better/cleaner option though!

Note: I'll follow this up with enabling tests for #4543 and #4540 once they land too.
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Aug 23, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants