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 import-assertions #12139

Merged

Conversation

@xtuc
Copy link
Member

@xtuc xtuc commented Oct 3, 2020

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

@codesandbox
Copy link

@codesandbox codesandbox bot commented Oct 3, 2020

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 39838f0:

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

@babel-bot babel-bot commented Oct 4, 2020

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

@@ -180,11 +180,15 @@ export function ImportDeclaration(node: Object) {

this.print(node.source, node);

if (node.attributes?.length) {
if (node.assertions?.length) {

This comment has been minimized.

@JLHwung

JLHwung Oct 7, 2020
Contributor

nit: It seems that import foo from "foo.json" assert {} are now generated as import foo from "foo.json". Although it is semantically equivalent. I slightly prefer to reserve asserts {} if node.assertions is not nullish.

This comment has been minimized.

@JLHwung

JLHwung Oct 12, 2020
Contributor

I realized that current AST design does not differentiate between import foo from "foo.json" assert {} and import foo from "foo.json". Both of them have assertions set to [].

@JLHwung JLHwung changed the title Rename module-attributes to import-assertions Parse import-assertions Oct 8, 2020
@JLHwung JLHwung force-pushed the sven/rename-module-attributes-to-import-assertions branch 2 times, most recently from f998d24 to ed15a13 Oct 8, 2020
@JLHwung JLHwung force-pushed the sven/rename-module-attributes-to-import-assertions branch from 3cec529 to 343a6be Oct 12, 2020
@JLHwung JLHwung force-pushed the sven/rename-module-attributes-to-import-assertions branch from d6dae66 to 39838f0 Oct 14, 2020
@nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Oct 14, 2020

The failing test is also failing in main.

@nicolo-ribaudo nicolo-ribaudo merged commit af8e0fa into main Oct 14, 2020
21 of 24 checks passed
21 of 24 checks passed
Prepare Cache
Details
Prepare Cache
Details
Test on Node.js Latest
Details
Test on Node.js Latest
Details
Build Babel Artifacts
Details
Build Babel Artifacts
Details
Test on Node.js (13)
Details
Test on Node.js (13)
Details
Test on Node.js (12)
Details
Test on Node.js (12)
Details
Test on Node.js (10)
Details
Test on Node.js (10)
Details
Test on Node.js (8)
Details
Test on Node.js (8)
Details
Test on Node.js (6)
Details
Test on Node.js (6)
Details
Travis CI - Branch Build Failed
Details
Travis CI - Pull Request Build Failed
Details
test262-pr Workflow: test262-pr
Details
babel/repl REPL preview is available
Details
build-standalone Workflow: build-standalone
Details
ci/codesandbox Building packages succeeded.
Details
codecov/project 92.06% (target 90.00%)
Details
e2e Workflow: e2e
Details
@nicolo-ribaudo nicolo-ribaudo deleted the sven/rename-module-attributes-to-import-assertions branch Oct 14, 2020
@fisker fisker mentioned this pull request Oct 15, 2020
3 of 3 tasks complete
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.

None yet

4 participants
You can’t perform that action at this time.