codemix/babel-plugin-closure-elimination

Does not work with Babel >= 5.5.0

julien-f opened this issue · 7 comments

Source, es6.js:

function foo () {
  function bar () {}
}

Babel configuration:

{
  "plugins": ["closure-elimination"]
}

Error:

      throw err;
            ^
TypeError: es6.js: undefined is not a function
    at PathHoister.run (node_modules/babel-plugin-closure-elimination/lib/index.js:135:48)
    at NodePath.enter (node_modules/babel-plugin-closure-elimination/lib/index.js:185:17)
    at NodePath.call (node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:122:26)
    at NodePath.visit (node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:146:8)
    at TraversalContext.visitMultiple (node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:85:16)
    at TraversalContext.visit (node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:115:19)
    at Function.traverse.node (node_modules/babel/node_modules/babel-core/lib/babel/traversal/index.js:67:17)
    at NodePath.visit (node_modules/babel/node_modules/babel-core/lib/babel/traversal/path/context.js:163:26)
    at TraversalContext.visitSingle (node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:105:12)
    at TraversalContext.visit (node_modules/babel/node_modules/babel-core/lib/babel/traversal/context.js:117:19)

@julien-f thanks yes the Babel API changed a lot in the last week or two and broke all our plugins, will fix them asap

pygy commented

That sounds like a semver violation on Babel's end... Were you using undocumented/private functions?

@pygy basically the whole of the plugin API is/was undocumented so yeah. Haven't had chance to fix these up yet but I'll get to them as soon as I can.

It does appear that parts of it are starting to stabilize now.

Any news on this project?

@novacrazy basically I have no time to work on this at the moment, happy to accept PRs though

this was fixed by @JexCheng in #2