I don't get the react hype anyways. Writing inline HTML in JavaScript seems so weird to me (JSX).
I don't get the react hype anyways. Writing inline HTML in JavaScript seems so weird to me (JSX).
On today's machines the much larger bottleneck is how fast and easily you can iterate on product at scale which is a problem that React is a fantastic solution for.
Ever used a phone that wasn't < 6 months old to browse the modern web?
> at scale
React is a front-end framework. The only "scale" that exists in its world is the fat DOM you generate and how fast it can mutate it. From that perspective, it sucks at scale (take a look at Preact and Inferno). Your iteration speed depends on good app architecture, not a specific framework. React Native does sound like a good perk, but likely isnt useful enough to make anything you cannot do anyway in HTML5.
can't this be said about any popular framework? "it scales because everyone knows it"
> app size
what specifically makes React scale better with app size than any other properly componentized architecture?
> "properly componentized"
With React, 100 engineers don't have to know how to "properly componentize" things because it's already baked into the framework. You can't really write React code without proper componentization.
The essence is simply this:
function MyView(model) {
return template;
}
...which can work with any view layer and the same 100 engineers. Especially if the model is an API with business logic around some immutable stream/state. The concept is simple enough to be described in one sentance :)> don't have to know how to "properly componentize" things
I think you're overstating how difficult this problem is or forgetting that React's API must still be learned from documentation and examples.
React has answers to all these questions and so much more. Answers that very smart people have spent years coming up with.
Sure you could reinvent the wheel and build all that into your custom component framework, but then you may as well just use React.
> What about state within a component? How do you encapsulate that state so that other components can't muck with it?
Solved.
> What about passing data to that component?
Solved.
> What about type checking that data passed in in debug mode?
Could be solved if i rewrote in TypeScript. But this has never been a problematic issue in 10k+ LOC apps.
> What about a formal API for components to talk to one another?
Yep.
> What about knowing the explicit amount of the view tree that needs to be re-rendered based on what data changed?
Obviously, that's what virtual dom is.
In addition to all of this and much more, materialized views are independently refreshable, can be composed between disjoint components. There are async lifecycle hooks, a router, mutation observers, ajax sugar.
All of it is 17k min, requires no special tooling or IDE to write, is isomorphic and is 2-3x faster than React.
I have no doubt that React brings a lot to the table, but I hesitate to treat it as the final word in frontend frameworks for all the above reasons.
(I hope the comment doesn't indicate that you think the interesting thing about React is JSX.)
Then, I can loop back to that text armed with a little context. Videos are often examples of how to develop with the technology outside of a bubble. (Using React? Consider setting up webpack!) That seems to be missing from manuals sometimes.
However, unless building a madly complex UI I've decided it's best avoided; mostly because now that I can build super complex UIs I probably will rather than simplify things that can work in a progressively enhanced way.