Skip to content

jscodeshift-powered mithril@0.2.x to mithril@1.x transformations

License

Notifications You must be signed in to change notification settings

porsager/mithril-codemods

 
 

Repository files navigation

mithril-codemods

Use jscodeshift to help automate the transition from mithril@0.2.x to mithril@1.x based on the sections of the Migration Guide

Usage

> npm i -g mithril-codemods
> mithril-codemods --help

Transform mithril@0.2.x code into mithril@1.x using jscodeshift

Usage
$ mithril-codemods [<file|glob> ...]

Options
--run,    -r    Run transforms

Transforms

  • m.component() 👉🏻 m() 📓
  • controller 👉🏻 oninit 📓
  • m.route.mode 👉🏻 m.route.prefix() 📓
  • m.route()/m.route("route") 👉🏻 m.route.get()/m.route.set("route") 📓
  • config: m.route 👉🏻 oncreate: m.route.link 📓
  • m.route.param() 👉🏻 vnode.attrs 📓
  • Raw vnodes in m.mount()/m.route() 👉🏻 Component wrapped vnodes 📓
  • Component options 👉🏻 vnode.attrs 📓
  • ⚠️ m.redraw.strategy("none") 👉🏻 e.redraw = false 📓
  • ⚠️ m() unwrapped components 👉🏻 wrapped components️ 📓
  • ⚠️ config 👉🏻 oninit/onupdate 📓
  • ⚠️ m.request().then() 👉🏻 m.request().run() 📓
  • m.sync 👉🏻 m.prop.merge 📓

Key

  • ⚠️ Potentially unsafe transform
  • 📓 Mithril rewrite migration docs

About

jscodeshift-powered mithril@0.2.x to mithril@1.x transformations

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%