-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
WIP: Add Flow syntax parsing #384
Conversation
internal/parser/parser.go
Outdated
p.lexer.ExpectContextualKeyword("from") | ||
p.parsePath() | ||
p.lexer.ExpectOrInsertSemicolon() | ||
return ast.Stmt{Loc: loc, Data: &ast.STypeScript{}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copied from the TypeScript-specific section of the import parser. Should there be a separate AST type for Flow types? Or should this just emit a blank statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think STypeScript
should be changed to something more generic such as SIgnoredType
. The only purpose is to tell the caller to drop the statement. These statements never make it out of the parser.
I'm closing this since #79 is now closed. The context is that the Flow team recently announced that they are going to diverge from the JavaScript language and no longer be just JavaScript with types: https://medium.com/flow-type/clarity-on-flows-direction-and-open-source-engagement-e721a4eb4d8b. So Flow support now seems better-suited for an esbuild plugin than being built into esbuild itself. |
Work-in-progress implementation of Flow syntax support #79