npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

mithril-objectify

3.1.2 • Public • Published

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

install

npm i mithril-objectify

Downloadsweekly downloads

30

version

3.1.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability