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

Support dynamic import #100

Merged
merged 5 commits into from Aug 12, 2019
Merged

Conversation

Munter
Copy link
Contributor

@Munter Munter commented Apr 7, 2019

Attempt to support https://tc39.github.io/proposal-dynamic-import/

I have a local setup where I run estraverse on the output of Acorn with the acorn-dynamic-import installed through estraverse with this patch applied. That works fine.

I added some commented out tests, which are not working at the moment. This is primarily because espree doesn't know how to parse dynamic imports yet. The tests are probably not correct either because I'm not fully aware of the expected behavior

Relates to #98

--- Update ---
I switched the tests to avoid the espree dependency, which enables them to pass

test/es6.js Outdated
@@ -320,6 +320,36 @@ describe('import', function() {
});
});

describe.skip('dynamic import', function() {
Copy link

@papandreou papandreou Apr 7, 2019

Choose a reason for hiding this comment

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

Couldn’t you get these tests to work by putting in object literals with the ast instead of blocking on espree?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hadn't tried that. I'll give it a go

@papandreou
Copy link

@michaelficarra, does this LGTY?

@michaelficarra
Copy link
Member

@papandreou No, this conflicts with the currently proposed tree structure for dynamic imports: https://github.com/estree/estree/pull/198/files. We must wait until that is merged to support dynamic imports, and change this PR to match the estree spec.

@papandreou
Copy link

We must wait until that is merged to support dynamic imports, and change this PR to match the estree spec

Aligned the PR now 🤗

@papandreou
Copy link

estree/estree#198 was merged now 😌

@michaelficarra, can we move forward?

@michaelficarra michaelficarra merged commit 7fc4475 into estools:master Aug 12, 2019
@papandreou
Copy link

@michaelficarra, sorry to spam you so much everywhere, but could we have a new npm release with this included?

@Munter Munter deleted the support-dynamic-import branch August 13, 2019 10:16
@michaelficarra
Copy link
Member

@papandreou Published 4.3.0.

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

Successfully merging this pull request may close these issues.

None yet

3 participants