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

WIP: Add Flow syntax parsing #384

Closed
wants to merge 11 commits into from
Closed

WIP: Add Flow syntax parsing #384

wants to merge 11 commits into from

Conversation

rtsao
Copy link
Contributor

@rtsao rtsao commented Sep 12, 2020

Work-in-progress implementation of Flow syntax support #79

p.lexer.ExpectContextualKeyword("from")
p.parsePath()
p.lexer.ExpectOrInsertSemicolon()
return ast.Stmt{Loc: loc, Data: &ast.STypeScript{}}
Copy link
Contributor Author

@rtsao rtsao Sep 12, 2020

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?

Copy link
Owner

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.

@evanw
Copy link
Owner

evanw commented May 26, 2021

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.

@evanw evanw closed this May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants