mithril-objectify
v3.1.2
Published
Babel plugin to optimize Mithril m() calls into simple JS objects
Downloads
17
Maintainers
Readme
mithril-objectify
A babel plugin to transform mithril hyperscript function invocations like m(".fooga")
into static JS objects like:
{ tag: "div", attrs: { "className" : "fooga" }, children: [ ] }
for speeeeeed.
Please file an issue if you come across any cases that this doesn't handle, I'd love to improve the number of structures I can rewrite!
:warning: :zap: :warning: Maintenance Mode :warning: :zap: :warning:
This version is for [email protected]
only and is unlikely to receive future updates.
To optimize [email protected]
code use mopt
.
Installation
Install with npm
npm i mithril-objectify
Usage
.babelrc
// .babelrc
{
"plugins": [ "mithril-objectify" ]
}
CLI
$ babel --plugins mithril-objectify script.js
API
require("babel-core").transform("<code>", {
plugins: [ "mithril-objectify" ]
});