You can't use object spread in NetCreate, eg const clone = { ...original, id: 1} or something like that. This PR modifies the babel config used by brunch to enable it.
Testing
After pulling the branch, try replacing any Object.assign code with the equivalent spread syntax. E.g. change
const bar = Object.assign({}, foo, {name:'foo2')
to
const foo = { ...foo, name:'foo2' }
See if NetCreate handles this correctly
TECHNICAL BACKGROUND
In current NetCreate 2.0, we are maintaining the 2017-era brunch build system, which is unaware of features that occurred afterwards. The difficulties are summarized in the aborted #80 "Module Architecture Stage 2".
We are dependent on the pre-7.0 version of Babel because Brunch 2.10 uses the old Babel as a dependency. It appears to be around version 6.7, though we can go right up to 6.26.3 (the last pre-7.0 Babel). This means we use the old babel repo for our reference, as syntax changed significantly in 7.
The Problem
You can't use object spread in NetCreate, eg
const clone = { ...original, id: 1}
or something like that. This PR modifies the babel config used by brunch to enable it.Testing
After pulling the branch, try replacing any
Object.assign
code with the equivalent spread syntax. E.g. changeconst bar = Object.assign({}, foo, {name:'foo2')
toconst foo = { ...foo, name:'foo2' }
See if NetCreate handles this correctly
TECHNICAL BACKGROUND
In current NetCreate 2.0, we are maintaining the 2017-era
brunch
build system, which is unaware of features that occurred afterwards. The difficulties are summarized in the aborted #80 "Module Architecture Stage 2".We are dependent on the pre-7.0 version of Babel because Brunch 2.10 uses the old Babel as a dependency. It appears to be around version 6.7, though we can go right up to 6.26.3 (the last pre-7.0 Babel). This means we use the old babel repo for our reference, as syntax changed significantly in 7.
THE FIX
Install the old version of babel object spread, not the newer one.
Then update the
brunch-config.js
file by adding this line to theplugins/babel
field.