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 migration for TSModuleDeclaration AST change #3021

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nicolo-ribaudo
Copy link
Member

Copy link

netlify bot commented Dec 4, 2024

Deploy Preview for babel-next ready!

Name Link
🔨 Latest commit f6f8e21
🔍 Latest deploy log https://app.netlify.com/sites/babel-next/deploys/6750459bd273b50008b019d5
😎 Deploy Preview https://deploy-preview-3021--babel-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 4, 2024

Deploy Preview for babel ready!

Name Link
🔨 Latest commit f6f8e21
🔍 Latest deploy log https://app.netlify.com/sites/babel/deploys/6750459b9fc7230008374cf9
😎 Deploy Preview https://deploy-preview-3021--babel.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@liuxingbaoyu liuxingbaoyu left a 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.
Copy link
Member

Choose a reason for hiding this comment

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

Is the . here accidental?

Copy link
Contributor

@JLHwung JLHwung left a 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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([])
- )
)
```
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants