4 ms·
I've been doing a broad survey of these JavaScript frameworks for a month or so now. I've looked primarily at Ember, Angular, React, and Knockout. One thing is
by baddox 13y ago
I've been doing a broad survey of these JavaScript frameworks for a month or so now. I've looked primarily at Ember, Angular, React, and Knockout. One thing is for sure: React has the community that feels the most "enlightened." I've watched several videos and read several posts similar to this one that express this sentiment of "when I finally understood it, it just clicked, and now I realize it's the best thing in the world." That excitement is certainly infectious, although I find myself wanting to hear "the other side of the story" from someone who dislikes React.
- RivieraKid 13y ago> "when I finally understood it, it just clicked, and now I realize it's the best thing in the world." There's very little to understand, it's really really simple. With React, I don't really see the point of Ember or Angular, they're basically zombie projects now. I wonder how their devs feel about React. React is an evolutionary leap enabled by their shadow DOM technology. Being able to rerender the whole page in a millisecond is a game changer.
- nailer 13y agoractive.js (which I've been using on a couple of projects) also uses a shadow DOM and learning it is shorter than this sentence.
- camus2 13y ago> With React, I don't really see the point of Ember or Angular React only deals with the view. In AngularJS, third party objects have a seamless integration with the view. Imagine you want to paginate datas. You'd write a Paginator component in React. In Angular you'd have a Paginator service holding pagination logic. Then you can have multiple representations of paginators,that would be logic less. It's better because it makes it easier to test the pagination logic in isolation,and you can then hide some complexity out of the view. i did it with a simple notification queue in a project i'm working on : .service('Notification', function($timeout, NOTIFICATION_TIME) { /** * manage notifications */ var onNotificationTimeEnd ; this.type = { 'SUCCESS': 'text-success', 'ERROR': 'text-error', 'INFO': 'text-info' }; this.timeout = null; this.current = null; this.notifications=[]; /** * queue app notifications * @param {Object} notif */ this.notify = function(notif) { if(notif){ this.notifications.push(notif); } if(!this.current){ this.current = this.notifications.pop(); } if(!this.timeout){ this.timeout=$timeout(onNotificationTimeEnd.bind(this), NOTIFICATION_TIME); } }; onNotificationTimeEnd = function(){ this.current=null; this.timeout=null; if(this.notifications.length>0){ this.notify(); } }; }); So each time a new notification pops , the view is updated just by adding {{Notification.current}} somewhere in my template I think React solve parts of the problem while Angular tries to solve the whole problem. I think there is definetly a middle ground between AngularJS and React virtual DOM that can be found. Let's remember that Misko defines AngularJS as "a better browser",not a framework.
- swah 13y agoAre most folks using ReactJS on production running NodeJS to render the first view on the server, or just server the JS and generate everything client side? (I'm not a particular fan of JS on the server-side yet..)
- reverius42 13y agoI've used React on Node on the server side to pre-render the initial HTML. It works great and integrated pretty seamlessly.
- ef4 13y agoYour comparison makes no sense. React isn't really competing with something like Ember -- the more direct comparison would be React vs HTMLBars (the low level view layer library being used in next generation Ember). Even if I choose react for my view layer, I'm still going to need infrastructure for managing application state. View layer concerns are probably less than 30% of what I get out of Ember. The rest is bidirectional routing between URLs and models, meaningful controller hierarchies, etc. React is simple because it ignores all that. But any significant app will still need to deal with those things.
- Retozi 13y agoI disagree. You need far less infrastructure for managing application state and if you're willing to settle for the DOM hierarchy communication, you need close to zero, because the communication is endogenous. You can go very very far with only React and a Router without having a mess. There is a default communication layout that is very potent, which makes React simpler than the other frameworks. Even if this were not true, the discussion has nothing to do with MVC...
- brianchu 13y agoThat has less to do with React specifically, and more to do with how languages/tools/libraries generally gain adoption. React is at a point where there's still an emerging "early-adopter" community. Angular was like that a year ago (I distinctly recall the tone on HN to be similar to your impression of the current sentiment around React). Now Angular is starting to reach the mainstream (loosely defined), which means that now there is a trend of people pointing out flaws in Angular. Give it a year or so.
- aidos 13y agoI wonder how true that will be given the simplicity of React. Ember and Angular and so big that it takes that long to find the things you don't like. Having said that, I like angular and react in very different ways.
- cgag 13y agoI don't know, I think the excitement around angular was because it made things easy, while the excitement around react is based on its simplicity of its model. It's a deeper thing than just being a shiny new thing imo.
- baddox 13y agoMy personal impression of Angular and its community is that it makes things organized and maintainable, not necessarily easy in the greedy sense of "I want to get this little app made as quick as humanly possible."
- dogestudios 13y agoI wish I could see where you're coming from, but it doesn't seem simpler to me as compared to angular, just different. I need to read through the code for React like I did for Angular.
- cnp 13y agoI think you're absolutely right. People aren't used to dealing with the functional paradigm that React has introduced and it's interesting, and in many cases the benefits are immediately apparent and in others are only apparent over time (meaning, with direct use). With Angular, however, there was very little philosophical "newness" but a lot of immediate "wow" and the momentum from that was enough to carry it quite far (and rightfully so). What's happening with React is different though, and happens only once in a very long while: engineering complexities that seem to have spun wildly out of control become radically simplified by something sitting right under your nose. It's exciting. Congrats to all of those who have contributed to React.
- swah 13y agoI guess when your test platform is Facebook, you learn things faster.
- gooserock 13y agoI'd be interested to hear what you think of ChaplinJS - it's very small, but it does this kind of compartmentalized event thing really well. You can listen for events using @delegate in each view and subview, which is just a map to $.on using that view's DOM container.
- Retozi 13y agoThe app the blog is based on is actually implemented in chaplinJS in production. It is a big improvement over Backbone, but it doesn't have the conceptual clarity of React. I actually moved to React because I was not satisfied with the chaplin solution.
- davedx 13y agoI've worked with it for several months now. The real enlightenment I've had from React was by reading about Om with React, and how Clojurescript can maintain a clean separation of mutable and immutable state. React itself solves some problems extremely well, but the props/state/hierarchy complexity can create its own issues.