-
Notifications
You must be signed in to change notification settings - Fork 131
Support dynamic import #100
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
Conversation
test/es6.js
Outdated
@@ -320,6 +320,36 @@ describe('import', function() { | |||
}); | |||
}); | |||
|
|||
describe.skip('dynamic import', function() { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
…ng on espree having dynamic import support
@michaelficarra, does this LGTY? |
@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. |
Aligned the PR now 🤗 |
estree/estree#198 was merged now 😌 @michaelficarra, can we move forward? |
@michaelficarra, sorry to spam you so much everywhere, but could we have a new npm release with this included? |
@papandreou Published |
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