As a startup who's built all of its UI on AngularJS, does introducing React/Om into the stack make sense? We have a B2B product where the users deal with a lot of CRUD forms and dashboards. React looks interesting, but only if it gives significant advantages (time-to-market, maintainability, etc) vis-a-vis AngularJS in managing a large code-base. Any first hand reviews?
YES - I've built two enterprise app frontends (CRUD forms and dashboards) in react since react came out. Now that I know what I'm doing and have my tools built out, I am contracting and hitting ridiculously tight schedules that I would never have been able to hit without the level of abstraction react enables. It helps that a react codebase is massively smaller than a comparable OOP-style codebase (I've used Backbone…
Virtual DOM in Elm
101–110 of 117 posts
Re: Virtual DOM in Elm
#102Earlier quoted context omitted.
I've done some research too - check out this implementation of cursors, it enables drop-in O(1) shouldComponentUpdate (like Om) and is compatible with rAF batching (like Om). We explored Mori for a bit too and ended up deciding Mori wasn't worth it. (Our app was big enough that we experienced pretty brutal performance without shouldComponentUpdate. Now our bottleneck is methods like Array.prototype.map over large lis…
Very cool! I had researched this technique before, when I found cortex: https://github.com/mquan/cortex . Cortex does something very similar, except it doesn't actually do persistent data structures. Building cursors off of the addons.update stuff is a neat idea. (why `onChange` instead of `set` and `pendingValue` instead of just `value`?) I agree that you can take this really far. At this point I need to sit back an…
Re: Virtual DOM in Elm
#103Or is this the limit of an overly mutable language like js?
Re: Virtual DOM in Elm
#104Earlier quoted context omitted.
If this technique is much more performant (batching diffs of the DOM), why don't browsers perform this "back-buffering" natively?
They do perform this "back-buffering" natively. When you manipulate the DOM in a modern (post-2009 or so) browser, it's just changing a pointer and flipping a dirty bit. The problem is that it's very easy to force a full recalculate of the whole page layout. Whenever you call .offsetHeight or .offsetWidth or .getComputedStyle, you're doing it. The full list of properties is about 2 dozen strong: http://gent.ilcore.co…
Re: Virtual DOM in Elm
#105Earlier quoted context omitted.
They do perform this "back-buffering" natively. When you manipulate the DOM in a modern (post-2009 or so) browser, it's just changing a pointer and flipping a dirty bit. The problem is that it's very easy to force a full recalculate of the whole page layout. Whenever you call .offsetHeight or .offsetWidth or .getComputedStyle, you're doing it. The full list of properties is about 2 dozen strong: http://gent.ilcore.co…
This got me wondering how React handles this requirement. Can you use React if you need to know offsetWidth/Height to do complex layout?
Re: Virtual DOM in Elm
#106Earlier quoted context omitted.
This is really great work. Why do all of this instead of just using Om? I'm currently waffling between Om and straight react.js for a project of mine.
Project requires designers committing on your codebase -> use react with jsx Able to use cljs and don't care about designer friendly -> what are you waiting for!!!
Thank you!
Re: Virtual DOM in Elm
#107What could possibly be done in the React.js version to make its performance closer to Mercury/Elm? I notice some 'shouldComponentUpdate' methods are already overwritten. Or is this the limit of an overly mutable language like js?
Re: Virtual DOM in Elm
#108Earlier quoted context omitted.
Project requires designers committing on your codebase -> use react with jsx Able to use cljs and don't care about designer friendly -> what are you waiting for!!!
I know you've probably answered this question a million times... but could you briefly explain your enthusiasm for clojurescript and/or om? I've been using the react js library and have been wondering what makes clojurescript a step above javascript and om a step above react. Thank you!
Re: Virtual DOM in Elm
#109What could possibly be done in the React.js version to make its performance closer to Mercury/Elm? I notice some 'shouldComponentUpdate' methods are already overwritten. Or is this the limit of an overly mutable language like js?
The Om example does some kind of Event delegation using channels which is much faster.
Re: Virtual DOM in Elm
#110Earlier quoted context omitted.
YES - I've built two enterprise app frontends (CRUD forms and dashboards) in react since react came out. Now that I know what I'm doing and have my tools built out, I am contracting and hitting ridiculously tight schedules that I would never have been able to hit without the level of abstraction react enables. It helps that a react codebase is massively smaller than a comparable OOP-style codebase (I've used Backbone…
Are there any helpers/libraries you use when building CRUD forms? I haven't seen one for React yet - or TBH a well functioning one in any language I use - and it's a pain point I would like to solve.