Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Babel 7 compatibility (Fixes #193) #194

Merged
merged 3 commits into from
Oct 20, 2017
Merged

Conversation

jscinoz
Copy link
Contributor

@jscinoz jscinoz commented Oct 20, 2017

Fixes #193

Fixes compatibility with Babel 7, by using babel-helper-module-import's addDefault (instead of file.addImport, which is deprecated in Babel 7), and traversing the AST ourselves to find module imports, as Babel no longer does this for us.

Tests pass, and compatibility appears to be maintained with Babel 6.26.0, but I have not tested this extensively.

Babel no longer does this internally as of babel/babel#6343. This commit implements the same
traversal as part of this plugin, using the same code that was removed from Babel with some
trivial modifications.
file.addImport is deprecated by Babel and attempting to use it will throw.
@jsf-clabot
Copy link

jsf-clabot commented Oct 20, 2017

CLA assistant check
All committers have signed the CLA.

@jscinoz jscinoz changed the title Babel v7.0.0-beta3 compatibility (Fixes #193) Babel 7 compatibility (Fixes #193) Oct 20, 2017
@jdalton jdalton added the bug label Oct 20, 2017
@jdalton
Copy link
Member

jdalton commented Oct 20, 2017

Wow, thank you @jscinoz!

@jdalton jdalton merged commit 7218f5b into lodash:master Oct 20, 2017
@tomchentw
Copy link

That was quick! Any chances we can get an npm release with a beta tag?

@jdalton
Copy link
Member

jdalton commented Oct 20, 2017

@tomchentw It will most likely happen over the weekend soonish.

@spencerbeggs
Copy link

@jdalton Any chance you can cut a release for this? Tested locally it resolved the issue.

@jdalton jdalton mentioned this pull request Nov 5, 2017
@jdalton
Copy link
Member

jdalton commented Nov 12, 2017

v3.3.0 has been published 🎉

@abhinavsingi
Copy link

which broke like this
Error: Cannot find module 'babel-helper-module-imports'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

6 participants