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

convert @babel/helper-module-transforms to typescript #12928

Merged

Conversation

zxbodya
Copy link
Contributor

@zxbodya zxbodya commented Feb 27, 2021

Q                       A
License MIT

@babel/helper-module-transforms part of #11578

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 27, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 22f8ab4:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@babel-bot
Copy link
Collaborator

babel-bot commented Feb 27, 2021

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/44809/

@nicolo-ribaudo nicolo-ribaudo added the Flow -> TS Tracking repository migration from Flow to TS label Feb 27, 2021
@zxbodya zxbodya force-pushed the ts-migration/babel-helper-module-transforms branch from 7b668b4 to a34bb9d Compare March 2, 2021 02:27
@zxbodya zxbodya force-pushed the ts-migration/babel-helper-module-transforms branch from a34bb9d to bdb2c24 Compare March 15, 2021 17:51
@@ -280,7 +284,9 @@ function getModuleMetadata(
data.reexports.set(exportName, importName);

if (exportName === "__esModule") {
throw exportName.buildCodeFrameError('Illegal export "__esModule".');
throw spec
.get("exported")
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch from type checking!

@@ -68,7 +93,7 @@ export default function rewriteLiveReferences(
return identNode;
}

let namespace = t.identifier(meta.name);
let namespace: t.Expression = t.identifier(meta.name);
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: why we need to annotation namespace is an expression here?

Copy link
Contributor Author

@zxbodya zxbodya Mar 18, 2021

Choose a reason for hiding this comment

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

if not adding annotation type is inferred as t.Idendifier, but it might be is reassigned later to t.CallExpression which will cause an error

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.

LGTM with some comments.

@nicolo-ribaudo nicolo-ribaudo force-pushed the ts-migration/babel-helper-module-transforms branch from bdb2c24 to fd4ce34 Compare March 27, 2021 00:12
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

Thanks!

@nicolo-ribaudo nicolo-ribaudo merged commit 6ac07a1 into babel:main Mar 27, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the ts-migration/babel-helper-module-transforms branch March 27, 2021 00:40
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jun 26, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Flow -> TS Tracking repository migration from Flow to TS outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants