mithrilify icon indicating copy to clipboard operation
mithrilify copied to clipboard

Migration to Babel

Open avesus opened this issue 10 years ago • 3 comments

Mithril would allow to use Babel in recent version and MSX will be deprecated: https://github.com/insin/msx/issues/13

Will Mithrilify migrate to Babel in a next version or it will be a legacy package?

avesus avatar Aug 13 '15 17:08 avesus

@avesus: Thanks for this information. I didn't know about this changes and have to look into it.

Any help or contribution are welcome! Anyone?

sectore avatar Aug 14 '15 06:08 sectore

Mithril version next (0.2.1) supports Babelify with components.

Actually, right now you could do 2 things:

  1. add /** @jsx m */ pragma as the first line of a JSX file.
  2. specify at least an argument for DOM element (second argument of m()). Mithril plays very bad when second argument is null. For true React-like behavior, elements have to contain the key attribute - it ideally conforms as a placeholder instead of null.

Surprisingly, Mithirl supports children elements passed with arguments instead of Array.

I think, Mithrilify could easily adapt the behavior adding the /** @jsx m */ pragma to beginning of each file. But passing an attribute instead of null is up to developer. Leo could fix that or Mithrilify could adapt Babelify settings.

Or Babelify with full support in Mithril (supporting secondary parameter as null instead of Object) will totally deprecate Mithrilify. Sorry.

avesus avatar Aug 18 '15 22:08 avesus

https://github.com/insin/msx/issues/13 https://github.com/lhorie/mithril.js/pull/772

avesus avatar Aug 28 '15 20:08 avesus