I'm trying to upgrade my project from preact-cycle@0.4.1 to 0.5.0 but as of right now my Webpack 1.13 is throwing an error when trying to do:
import { h, render } from 'preact-cycle';
I've diffed the generated dist/preact-cycle.js file between versions (0.4.1 vs 0.5.0) and have found the issue being with the use of the extends function which in 0.4.1 was done via:
function createCycle(renderer) {
function render() {
return clearTimeout(debounce), debounce = null, renderer(babelHelpers["extends"]({
mutate: mutate,
mutation: mutation
}, data));
}
...
but in 0.5.0 the generated code looks like this:
function createCycle(renderer) {
function render() {
return clearTimeout(debounce), debounce = null, renderer(extends({
mutate: mutate,
mutation: mutation
}, data));
}
...
Note that in 0.5.0 the extends is used as a function directly whereas 0.4.1 is calling it from within the babelHelpers object.
The issue with the more recent version seems to be that the definition of the
var extends = (function() { ...
is below the code being executed and when webpack is parsing the file during the import phase it seems to freak out when it hits this function call.
I've been trying to work out how this has happened/changed but I can't explain it since neither package.json nor .babelrc in the preact-cycle project seems to have changed since the bump to 0.5.0.
Any ideas?
I'm trying to upgrade my project from
preact-cycle@0.4.1to0.5.0but as of right now my Webpack 1.13 is throwing an error when trying to do:I've diffed the generated
dist/preact-cycle.jsfile between versions (0.4.1vs0.5.0) and have found the issue being with the use of theextendsfunction which in0.4.1was done via:but in
0.5.0the generated code looks like this:Note that in
0.5.0theextendsis used as a function directly whereas0.4.1is calling it from within thebabelHelpersobject.The issue with the more recent version seems to be that the definition of the
is below the code being executed and when webpack is parsing the file during the
importphase it seems to freak out when it hits this function call.I've been trying to work out how this has happened/changed but I can't explain it since neither
package.jsonnor.babelrcin thepreact-cycleproject seems to have changed since the bump to0.5.0.Any ideas?