Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to Babel #4

Open
avesus opened this issue Aug 13, 2015 · 3 comments
Open

Migration to Babel #4

avesus opened this issue Aug 13, 2015 · 3 comments
Labels

Comments

@avesus
Copy link

avesus commented Aug 13, 2015

Mithril would allow to use Babel in recent version and MSX will be deprecated: insin/msx#13

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

@sectore
Copy link
Owner

sectore commented Aug 14, 2015

@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?

@avesus
Copy link
Author

avesus commented Aug 18, 2015

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
Copy link
Author

avesus commented Aug 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants