Re:McFly – Flux Architecture Made Easy
by armandososa on Wednesday November 05, 2014 @11:45AM
(#8562684)
The to-do app is just an example, an over-simplistic one, but if you ever try to write any large-ish app using the jQuery approach you'll get your answer.
[ Parent
| on HN ]
Re:McFly – Flux Architecture Made Easy
by bronson on Wednesday November 05, 2014 @11:47AM
(#8562699)
Especially if you write it on a team with other people.
Re:McFly – Flux Architecture Made Easy
by colinramsay on Wednesday November 05, 2014 @11:49AM
(#8562706)
I agree with you, but to be fair it is possible to build a large jQuery-only application and be successful. You'd just end up re-inventing a lot of things that a framework could have given you, or writing a lot more code. You'd also have to impose strict guidelines for your developers, since there'd be no "established" way of doing certain things (the first time round).
Re:McFly – Flux Architecture Made Easy
by mateuszf on Wednesday November 05, 2014 @11:53AM
(#8562724)
That's why React is brilliant, since it's really simple and scales well.
Re:McFly – Flux Architecture Made Easy
by colinramsay on Wednesday November 05, 2014 @12:06PM
(#8562804)
In association with Flux I assume you mean?
Re:McFly – Flux Architecture Made Easy
by moystard on Wednesday November 05, 2014 @12:46PM
(#8563053)
React can be used without a Flux-like architecture. It can also be integrated in a MV* application, see Backbone React Component[1] for example that uses Backbone Model for rendering React components.
Re:McFly – Flux Architecture Made Easy
by colinramsay on Thursday November 06, 2014 @05:08AM
(#8566427)
Yes, I do realise that. It's just that React on its own is only a small part of what people would normally use to build an app. People will therefore use React + <something> and I would expect a lot of people are using Flux as that something.
Re:McFly – Flux Architecture Made Easy
by findjashua on Wednesday November 05, 2014 @06:05PM
(#8564802)
the biggest problem with plain React (without Flux) is that the parent components have to pass event handlers to the child components, which gets really messy if you have multiple (>3, say) levels of nesting. It's much cleaner to have the child component trigger an event, and the data for the parent component to be updated accordingly.
This is something Ractive.js provides out of the box (child components fire events, that parent can be listening for), and what Flux (and its implementations) provide.
Couldn't we say any view layer "scales well" when integrated other architectures?
No. Some view layers require you to specify a lot more of the state transition code and may be more heavily integrated with the rest of your architecture (like the way you do data binding, etc). Because React transparently updates state by simply re-rendering components, you can keep it very cleanly decoupled from the rest of your architecture. There are other frameworks that accomplish similar tasks, but I've found that none come quite so close to having zero lines of state transition code as React. (In React, most of my state transition code involves visual animations.)
Re:McFly – Flux Architecture Made Easy
by armandososa on Wednesday November 05, 2014 @12:33PM
(#8562976)
Yes, you could write a large jQuery-only application. But it won't be as "simple" as the fiddle provided above.