News for hackers. Stuff that matters.
Re:Faster AngularJS Rendering with ReactJS by lhorie on Monday April 21, 2014 @10:29AM (#7621192)
Meh. I'm fed up of spending hours trying to squeeze performance out of Angular's directives system without breaking existing code, when there are so many undocumented caveats, pitfalls, and subtle semantic differences between this or that solution.

The issue of too many bindings he mentioned is a real one, and the complexity of this solution in general shows what sort of hoops you end up having to go through to get the basic stuff working (i.e. a for loop).

This is part of the reason why I wrote Mithril ( http://lhorie.github.io/mithril ) and the main factor for why I am planning on replacing Angular altogether for our mission critical app at work.

Re:Faster AngularJS Rendering with ReactJS by TY on Monday April 21, 2014 @10:56AM (#7621323)
Mithril looks very interesting - added to my research list. I've skimmed through the docs and couldn't see the list of supported browsers - can you please advise?

Also, have you considered adding an entry to ToDoMVC project [1] for ease of comparison to other frameworks? I know it's not an exciting endeavour but it does make comparison much easier.

Thank you for creating it and your time in advance.

[1] https://github.com/tastejs/todomvc

Re:Faster AngularJS Rendering with ReactJS by lhorie on Monday April 21, 2014 @01:52PM (#7622493)
You should be able to support all the way back to IE6 and Blackberry, although you need to include a few polyfills ( http://lhorie.github.io/mithril/tools.html )

Re: TodoMVC - there was someone working on an implementation here: https://github.com/jpmonette/todomvc-mithril

I think it's not fully implemented yet, but you should be able to see the general look and feel of the code.

Re:Faster AngularJS Rendering with ReactJS by carsongross on Monday April 21, 2014 @10:44AM (#7621260)
If you are willing to consider a different direction entirely, I'm working on a little library for simple, declarative AJAX:

http://intercoolerjs.org/

We do away with the client side model and complexity entirely and use partial HTML updates to get a better UX.

It isn't right for everything, but it is orders of magnitude simpler than Angular and it allows you to reuse many of the perf tuning tools we've developed over the last decade of web development.

Re:Faster AngularJS Rendering with ReactJS by dustingetz on Monday April 21, 2014 @11:25AM (#7621506)
Some feedback: I clicked through to Mithril, saw "Virtual DOM diffing" and thought, oh cool, immutable DOM is awesome (I use React). My next question was, why would anyone choose this over React? I clicked around a little bit but couldn't figure that out from the site.
Re:Faster AngularJS Rendering with ReactJS by lhorie on Monday April 21, 2014 @01:11PM (#7622189)
I put a performance comparison for React on the homepage yesterday (the link takes you to the actual test page so you can run it yourself). It simply measures running js time for initial rendering, which is the ugly, unavoidable cost of frameworks that authors don't like to talk about. The numbers are mostly averages, but should give a reasonable idea of what is faster than what.

I also do go more in depth here ( http://lhorie.github.io/mithril/comparison.html ). TL;DR: The main differences is that Mithril is a lightweight MVC, whereas React is a powerhouse at doing only the "V" part.

There's actually a project that uses React to enable HTML-y Mithril templates here ( https://github.com/insin/msx ), so the two can certainly coexist.

Mithril's light weight is mostly a result of picking a very small set of tools that are simple but useful on their own, but that also happen to come together nicely and that can play ball w/ Javascript's FP capabilities and the JS ecosystem as a whole.

Mithril is also a bit of a experiment in making a framework that gets out of your way - more hacking and less figuring out what is the syntax to do X. If that's your cup of tea, I'd recommend checking out the blog that I just started last week ( http://lhorie.github.io/mithril-blog/ ), where I talk about reusable programming techniques.

Re:Faster AngularJS Rendering with ReactJS by rraval on Monday April 21, 2014 @12:15PM (#7621805)
The "Performance" section of the linked page claims that Mithril takes 9.44ms where React takes 79.65ms for their rendering benchmark [1] [2]. If true, it could be a good enough reason to pick over React.

[1] http://lhorie.github.io/mithril/comparisons/mithril.renderin... [2] http://lhorie.github.io/mithril/comparisons/react.rendering....

Re:Faster AngularJS Rendering with ReactJS by littleiffel on Monday April 21, 2014 @04:40PM (#7623663)
Mithril looks very nice. I will look into that and see what happens in there. I understand your frustrations with AngularJs, I went through them as well, but still think that AngularJs is a great framework as BackboneJs and EmberJs and it has its strength and weaknesses.
Re:Faster AngularJS Rendering with ReactJS by quest88 on Monday April 21, 2014 @10:51AM (#7621293)
Instead of contributing something to Angular's GH repo that would help your problems, or even creating a branch that's an angular-optimized branch, you create a whole new project. Why?