-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add @babel/types as a dependency of @babel/parser
#16688
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 @babel/types as a dependency of @babel/parser
#16688
Conversation
Co-authored-by: Spencer Elliott <[email protected]> Co-authored-by: Mateusz Burzyński <[email protected]> Co-authored-by: merceyz <[email protected]>
853d023 to
d154c71
Compare
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57510 |
JLHwung
left a comment
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.
If we can get rid of the parser's node clone method in Babel 8, we can consider using the babel types node builder to create AST nodes directly, which will make @babel/types a runtime dependency. This approach should be better than our current approach where a blanket node is assigned with random new properties depending on different AST types.
|
I like that currently @babel/parser is a single ESM file with no deps, so it can trivially loaded in browsers, but yes we should think about it. |
Fixes #1, Fixes #2Closes #15042, closes #11118, closes #9924
I still dislike the idea of adding a dependency that is only needed for type-checking and not at runtime, but:
@babel/parseralready in v7, but it's broken because of the missing depSo here we are.