News for hackers. Stuff that matters.
Re:How I learned to stop worrying and love React by ryannevius on Saturday May 16, 2015 @07:19AM (#9555725)
I went through something similar...and then I found Mithril (http://lhorie.github.io/mithril/).

I may be alone on this, but I've enjoyed working with Mithril much more than I ever did React. If you haven't given it a shot, I highly recommend you do.

Re:How I learned to stop worrying and love React by simplify on Saturday May 16, 2015 @02:35PM (#9557127)
A lot of people praise Mithril for its small file size and speed, but one of its greatest and perhaps most overlooked advantages is its small learning curve. You only really need to understand two things to get started: what a component is (a plain JS object with controller and view), and when a redraw happens (once on m.mount, and once after every event handler).

Why is a low learning curve important? Several reasons. If you're a developer, it's not a huge investment to learn (how difficult was it to learn backbone / angular / ember?). If you're a startup / company, you don't need to look for X developers, where X is a difficult-to-pick-up JavaScript framework. You also save money by having a shorter on-boarding period for those non-X developers.

I've worked in a hackathon group that picked Mithril up and created amazing results with it right away. I teach at a coding school, and by far Mithril has been the easiest JS framework for my students to learn and work with. For being so powerful, Mithril is quite easy to get started with – and that means a lot.

Re:How I learned to stop worrying and love React by m0th87 on Saturday May 16, 2015 @10:24AM (#9556183)
We went with Mithril over React too. Both are good, but React + all of the libs needed to match Mithril is a fairly large payload for mobile-optimized websites, whereas Mithril is tiny.

Mithril didn't quite have everything we needed, though, so we made a small wrapper that provides nicer templating, event delegation, etc.: https://github.com/dailymuse/mithril-coat

Re:How I learned to stop worrying and love React by hackerboos on Saturday May 16, 2015 @10:04AM (#9556115)
I like Mithril a lot, but the only thing that puts me off it over React and Angular is I don't really know how to tie in third-party libraries like d3 and dropzone.
Re:How I learned to stop worrying and love React by pygy_ on Saturday May 16, 2015 @10:51AM (#9556270)
http://mithril.js.org/integration.html shows how to integrate a Select2 field in a Mithril template (thus interoperaing with jQuery).

You can use the same approach for other libraries:

Add a function as `config` attribute to your virtual DOM element. That function gets the real DOM element as a parameter, and you can act on it with third party libraries.

Re:How I learned to stop worrying and love React by hoggle on Saturday May 16, 2015 @12:54PM (#9556773)
I'm very interested in more modular, simpler alternatives to react / flux. Essentially I'm looking for reactive "isomorphic" component based, virtual dom solutions like react - mainly to integrate with a node.js workflow.

I was wondering if anyone had tried both Mithril as well as Deku(https://github.com/segmentio/deku) who would like to share their experience?

Re:How I learned to stop worrying and love React by tobr on Saturday May 16, 2015 @08:34AM (#9555858)
What makes you like Mithril more? I've been looking at it for a while, and it seems very nice and lightweight.

All I really want is an easy way to get performant DOM manipulations. With React I have to build the whole view around the component system, which isn't so flexible. Am I right in thinking that Mithril allows you to put the view together any way you want, as long as the end result is an object it can diff into the DOM?

Re:How I learned to stop worrying and love React by nwenzel on Saturday May 16, 2015 @10:04AM (#9556116)
D3 can do DOM manipulation a. It's more well known for its charting (SVG) functionality. But I've used it to build tables and other data-based DOM structures.

It's not ideal for all use cases. But for updating the DOM based on changes to the data, I find it to be a useful option.

Square built and fast library on top of D3 called Crossfilter. Speed is pretty amazing when you see the data source. http://square.github.io/crossfilter/

Re:How I learned to stop worrying and love React by pygy_ on Saturday May 16, 2015 @10:54AM (#9556284)
> Am I right in thinking that Mithril allows you to put the view together any way you want, as long as the end result is an object it can diff into the DOM?

That's correct. Virtual DOM nodes are plain JS objects with `tag`, `attr` and `children` attributes (the last two being optional).

The `m()` helper gives you some sugar on top of that.

Idiomatic Mithril view code, however, is more about declaratively generating vDOM nodes based on a model and/or a view model than, say, jQuery-style DOM manipulations...

Re:How I learned to stop worrying and love React by l1ambda on Monday May 18, 2015 @11:36AM (#9565034)
Thanks for sharing. I went from Backbone to Angular to Mithril, so it's nice to hear about folks experience with React.
Re:How I learned to stop worrying and love React by nodiscpls on Saturday May 16, 2015 @08:48AM (#9555898)
Next up - how I stopped learning how to be a real developer and accepted what framework farcebook ejected today. Tomorrow - abdicating database decisions in favour of whatever I read about on HN today.