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

Parse type imports in TSImportEqualsDeclaration #12962

Merged
merged 3 commits into from Mar 14, 2021
Merged

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Mar 3, 2021

Q                       A
Fixed Issues? Fixes #12957
Patch: Bug Fix? Y
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This PR implements parsing support on type imports in TSImportEqualsDeclaration

import type A = require("A");
export import type B = require("B");

Similar to what we did for ImportDeclaration, an enum property importKind: "value" | "type" will be added to TsImportEqualsDeclaration.

Note that when importKind is "type", the TSModuleReference on the RHS can not be an Identifier or a TSQualfiedName, which becomes an import alias for TypeScript, e.g. both

import type A = B.C;

and

export import type B = C;

will throw "An import alias can not use 'import type'".

@codesandbox
Copy link

@codesandbox codesandbox bot commented Mar 3, 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 fd32324:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration
@babel-bot
Copy link
Collaborator

@babel-bot babel-bot commented Mar 3, 2021

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

@SimenB
Copy link
Contributor

@SimenB SimenB commented Mar 14, 2021

Any news on this one? 👀

Seems relatively straightforward, but there's been a couple of bug fix releases without it, so I might be missing something

@nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Mar 14, 2021

Uh sorry, maybe @sosukesuzuki or @hzoo do you have time to quickly check if the changes seem ok? 🙏

@hzoo
hzoo approved these changes Mar 14, 2021
Copy link
Member

@hzoo hzoo left a comment

ok gave a look, looks good!

@nicolo-ribaudo nicolo-ribaudo merged commit 0988c47 into babel:main Mar 14, 2021
19 of 21 checks passed
19 of 21 checks passed
@github-actions
Prepare Cache
Details
@github-actions
Test on Node.js Latest
Details
@github-actions
Build Babel Artifacts
Details
@github-actions
Test Babel 8 breaking changes
Details
@github-actions
Lint
Details
@github-actions
Test on Node.js (14)
Details
@github-actions
Test on Node.js (12)
Details
@github-actions
Test on Node.js (10)
Details
@github-actions
Test on Node.js (8)
Details
@github-actions
Test on Node.js (6)
Details
@github-actions
Test on Windows
Details
@github-actions
Third-party Parser Tests
Details
@github-actions
Test @babel/runtime integrations
Details
@circleci-checks
e2e-breaking-pr Workflow: e2e-breaking-pr
Details
@circleci-checks
test262-pr Workflow: test262-pr
Details
@gitpod-io
Gitpod Open an online workspace in Gitpod
Details
@babel-bot
babel/repl REPL preview is available
Details
@circleci-checks
build-standalone Workflow: build-standalone
Details
@codesandbox
ci/codesandbox Building packages succeeded.
Details
@codecov
codecov/project 91.71% (target 90.00%)
Details
@circleci-checks
e2e Workflow: e2e
Details
@nicolo-ribaudo nicolo-ribaudo deleted the JLHwung:fix-12957 branch Mar 14, 2021
@nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Mar 14, 2021

I can release a patch tomorrow.

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

Successfully merging this pull request may close these issues.

5 participants