30 ms·
I still don't understand why developers want this over something more simplistic like this: http://jsfiddle.net/quje39qa/1/ http://jsfiddle.net/quje39qa/1/ - Am
by skorecky 12y ago
I still don't understand why developers want this over something more simplistic like this: http://jsfiddle.net/quje39qa/1/ http://jsfiddle.net/quje39qa/1/ - Am I alone in thiking JS frameworks are not the future?
- armandososa 12y agoThe 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.
- bronson 12y agoEspecially if you write it on a team with other people.
- colinramsay 12y agoI 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).
- mateuszf 12y agoThat's why React is brilliant, since it's really simple and scales well.
- colinramsay 12y agoIn association with Flux I assume you mean?
- moystard 12y agoReact 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. [1] https://github.com/magalhas/backbone-react-component https://github.com/magalhas/backbone-react-component
- watty 12y agoCouldn't we say any view layer "scales well" when integrated other architectures?
- Smudge 12y agoNo. 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.)
- findjashua 12y agothe 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.
- colinramsay 12y agoYes, 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.
- armandososa 12y agoYes, you could write a large jQuery-only application. But it won't be as "simple" as the fiddle provided above.
- lopatin 12y ago1. Stop using frameworks 2. Build project from scratch with well structured JS. 3. Build another project, but first extract the generalizable bits from the first project into a module that solves common problems. 4. Open source this module because it could be useful for other people writing single page apps. 5. Go back to step 1?
- cnp 12y agoAnd suddenly you've given yourself, and the community, a nice present called "A Library Framework" :)
- craigsmitham 12y agoThis example is missing a lot of features :-)
- thekenwheeler 12y agoYeah, I kept it as minimal as possible so that people could focus on the actual architecture. I'll be releasing an article in the near future that will show it in use in a more complex application.