developit / preact-transition-group

transition-group ui component for preact
https://npm.im/preact-transition-group
52 stars 9 forks source link

Update infrastructure to use microbundle and karmatic #9

Closed andrewiggins closed 4 years ago

andrewiggins commented 6 years ago

In preparation for some other work I'd like to do in this repo, I'm upgrading the dev environment to the latest and greatest from @developit. This repo now uses microbundle for bundling, karmatic for testing, and @developit's eslint rules for linting.

Bonus: Moving to microbundle shaved approximately 432 bytes 🎉

andrewiggins commented 6 years ago

Hmm it seems that nodent-compiler doesn't support object rest spread even though it specifies ecmaVersion 9 as recommended in the now deprecated acorn5-object-spread plugin for acorn. :/

The following code snippet repros the error I see in our build:

> const NodentCompiler = require('nodent-compiler');
undefined
> const compiler = new NodentCompiler();
undefined
> compiler.compile('function f({ a, b, ...extra }) { console.log(a, b, extra); }', 'test')
TypeError: Cannot read property 'type' of undefined
    at Object.Property (D:\github\andrewiggins\preact-transition-group\node_modules\nodent-compiler\output.js:691:55)
    at Object.out (D:\github\andrewiggins\preact-transition-group\node_modules\nodent-compiler\output.js:125:11)
    at ObjectPattern (D:\github\andrewiggins\preact-transition-group\node_modules\nodent-compiler\output.js:703:22)
    at Object.out (D:\github\andrewiggins\preact-transition-group\node_modules\nodent-compiler\output.js:125:11)
    at Object.formatParameters (D:\github\andrewiggins\preact-transition-group\node_modules\nodent-compiler\output.js:146:14)
    at Object.Function (D:\github\andrewiggins\preact-transition-group\node_modules\nodent-compiler\output.js:404:14)
    at Object.FunctionDeclaration (D:\github\andrewiggins\preact-transition-group\node_modules\nodent-compiler\output.js:408:14)
    at Object.out (D:\github\andrewiggins\preact-transition-group\node_modules\nodent-compiler\output.js:125:11)
    at Object.Program (D:\github\andrewiggins\preact-transition-group\node_modules\nodent-compiler\output.js:182:18)
    at Object.out (D:\github\andrewiggins\preact-transition-group\node_modules\nodent-compiler\output.js:125:11)
andrewiggins commented 6 years ago

I've opened MatAtBread/nodent-compiler#7 to address the build break.

andrewiggins commented 6 years ago

MatAtBread/nodent-compiler#7 is now closed and published as nodent-compiler v3.2.11. The build now passes!

Note: you may need to delete your node-modules folder and re-install the packages in order to get the new nodent-compiler version.

andrewiggins commented 6 years ago

@developit, can you take a look when you get a chance?