Skip to content

Update infrastructure to use microbundle and karmatic#9

Merged
developit merged 7 commits intodevelopit:masterfrom
andrewiggins:infra-upgrades
May 18, 2020
Merged

Update infrastructure to use microbundle and karmatic#9
developit merged 7 commits intodevelopit:masterfrom
andrewiggins:infra-upgrades

Conversation

@andrewiggins
Copy link
Contributor

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
Copy link
Contributor Author

andrewiggins commented Sep 23, 2018

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
Copy link
Contributor Author

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

const identity = i => i;

export class TransitionGroup extends Component {
static defaultProps = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buble doesn't support the property initializer syntax (bublejs/buble#123) nor the static keyword so I had to rewrite this code

children: getChildMapping(this.props.children || [])
};

this.performLeave = this.performLeave.bind(this);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Buble doesn't support property initializers, I had to bind the methods here :/

@andrewiggins
Copy link
Contributor Author

andrewiggins commented Oct 1, 2018

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
Copy link
Contributor Author

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

@developit developit mentioned this pull request May 18, 2020
@developit developit merged commit 83c4d47 into developit:master May 18, 2020
@andrewiggins andrewiggins deleted the infra-upgrades branch May 18, 2020 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants