-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 migration for TSModuleDeclaration AST change #3021
base: main
Are you sure you want to change the base?
Add migration for TSModuleDeclaration AST change #3021
Conversation
✅ Deploy Preview for babel-next ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for babel ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thanks!
|
||
Rather than representing `namespace X.Y {}` as two nested `TSModuleDeclaration` nodes with names `X` and `Y`, | ||
it is not represented as a single `TSModuleDeclaration` whose name is a `TSQualifiedName(X, Y)`. This change | ||
aligns the AST with `@typescript-eslint`. parser. |
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.
Is the .
here accidental?
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.
Thanks.
- Use `TSQualifiedName` for `namespace X.Y {}`'s name ([#16982](https://github.com/babel/babel/pull/16982)) | ||
|
||
Rather than representing `namespace X.Y {}` as two nested `TSModuleDeclaration` nodes with names `X` and `Y`, | ||
it is not represented as a single `TSModuleDeclaration` whose name is a `TSQualifiedName(X, Y)`. This change |
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.
it is not represented as a single `TSModuleDeclaration` whose name is a `TSQualifiedName(X, Y)`. This change | |
it is now represented as a single `TSModuleDeclaration` whose name is a `TSQualifiedName(X, Y)`. This change |
|
||
Rather than representing `namespace X.Y {}` as two nested `TSModuleDeclaration` nodes with names `X` and `Y`, | ||
it is not represented as a single `TSModuleDeclaration` whose name is a `TSQualifiedName(X, Y)`. This change | ||
aligns the AST with `@typescript-eslint`. parser. |
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.
aligns the AST with `@typescript-eslint`. parser. | |
aligns the AST with the `@typescript-eslint` parser. |
@@ -204,6 +237,24 @@ Check out the [v8-migration guide](v8-migration.md) for other user-level changes | |||
} | |||
``` | |||
|
|||
- The second argument (`body`) of `TSModuleDeclaration` cannot be a `TSModuleDeclaration` anymore ([#16982](https://github.com/babel/babel/pull/16982)) |
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.
- The second argument (`body`) of `TSModuleDeclaration` cannot be a `TSModuleDeclaration` anymore ([#16982](https://github.com/babel/babel/pull/16982)) | |
- The second argument (`body`) of `t.tsModuleDeclaration` cannot be a `TSModuleDeclaration` node anymore ([#16982](https://github.com/babel/babel/pull/16982)) |
t.tsModuleBlock([]) | ||
- ) | ||
) | ||
``` |
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 would expect there are two examples here since we have mentioned two migration approaches. This example seems to be of the second one. Could you add an example for the first approach?
Docs for babel/babel#16982