mithril-objectify

Babel plugin to optimize Mithril m() calls into simple JS objects for speed

Showing:

Popularity

Downloads/wk

2

GitHub Stars

45

Maintenance

Last Commit

4yrs ago

Contributors

4

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

mithril-objectify NPM Version NPM License

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!

⚠️ ⚡ ⚠️ Maintenance Mode ⚠️ ⚡ ⚠️

This version is for mithril@0.2.x only and is unlikely to receive future updates.

To optimize mithril@1.x 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" ]
});

Rollup

rollup-plugin-babel

Browserify

babelify

WebPack

babel-loader

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial