Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You didn't provide a link. I assume you were going to link the blog post announcing their switch to Mithril — that didn't contain any rationale behind it.

I did find this however, which goes into details about why Ember was not a good choice for them: http://discuss.flarum.org/139-introducing-flarum-s-fast-new-...

Seems to be a well based choice. Doesn't seem to have anything to do with performance though.

While Mithril is probably a lot more extensible and easeier to work with since there's a smaller API surface, seeing "templates" like this makes me sad:

  view() {
    return m('div.text-editor', {config: this.element}, [
      m('textarea.form-control.flexible-height', {
        config: this.configTextarea.bind(this),
        oninput: m.withAttr('value', this.oninput.bind(this)),
        placeholder: this.props.placeholder || '',
        disabled: !!this.props.disabled,
        value: this.value()
      }),
      m('ul.text-editor-controls', listItems(this.controlItems().  toArray()))  
    ]);
  }


Has anyone made a JSX transformer that plays nice with Mithril? Seems like it would make using that api you provided a snippet of less painful


You can use Babel's JSX transformer for HTML elements by sticking this in a .babelrc file:

    {
      "jsxPragma": "m"
    }
You'll also be able to use it for Mithril components when the next version of Mithril is released. Relevant issue: https://github.com/lhorie/mithril.js/issues/632



That "template" is really not okay.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: