I guess it'll be more project work for those who get brought in to bail these projects out.
I guess it'll be more project work for those who get brought in to bail these projects out.
Admittedly it's a bit of a beef of mine, but most React apps are very MVC. I even blogged about it a while ago: https://blog.talkjs.com/how-react-brought-model-view-control...
I can totally see the use case for React for web apps which provide a lot of user interaction on the frontend. But for all other web apps it doesn't seem to make sense as you also have to handle quite a few disadvantages (e.g. SEO unfriendly, user can't copy URL and send to a friend)
Am I missing something?
You can even use data from your Flask based backend directly, to create the static pages.
Most things that people build
don't need anything like this.
True. It would be great to show examples of websites that benefit from the complexity of an extra library to handle client side state. I would think less then 1% do.For example, lets look at how HN handles state syncing. Function "toggle" in this file handles collapsing/expanding threads:
https://news.ycombinator.com/hn.js
function toggle (ev, id) {
var on = !afind($(id), collapsed());
(on ? addClass : remClass)($(id), 'coll');
recoll();
if ($('logout')) {
new Image().src = 'collapse?id=' + id + (on ? '' : '&un=true');
}
ev.stopPropagation();
return false;
}
How would the react+redux approach look like? Is it really worth it?I see React as a tool for building web applications, not websites. Using it for something like hacker news is not needed nor worth it, except for learning purposes or for the sake of using your favorite tech (which has its pros and cons).
Edit: I use React a lot, and really like it. It's just not the perfect tool for everything, and by no means a necessary one (at least when you don't have much complexity); even if it is a good one in many cases.
In the case of HN, seeing the current js [1] I find it pretty obvious that no "big tool" like React is necessary. It doesn't mean using React for a HN clone is a bad thing, one just don't have to.
[1]: https://news.ycombinator.com/item?id=17915560&goto=news
How do you define those terms?
This is totally personal and subjective, but I'd say that a website is defined by its content, while a web application is defined by its interaction with the user. That is, a website can plausibly consist of a static content repository that's dealt out to all visitors, while a web application depends on interaction and requires programmatic user input and data processing.
For example, a news site would be a "website", but a spreadsheet or a collaborative calendar would be web "applications". The news site shows essentially the same information to all visitors, while the calendar processes individual data.
Practically, most websites with quickly changing content will also rely on a sophisticated programmatic (and/or database) backend, but at least in principle they're only defined by their output. The web application on the other hand is essentially a program that runs remotely, and it depends fundamentally on a processing and a data storage backend.
Wordpress's backend is a web application. That web application exists to drive the website that is its frontend. Not really a controversial standpoint, I don't think, except amongst the hyper-literal who but-for about comment features (hence the use of "focus" above).
Don’t be a dick.
I could use Vue, but I'm already using and continuing to use React, and I'm good enough at (what isn't actually) my job (because I'm no frontend developer, this is just what I do on the side) to minimize its impact on end users.
I also use React for fully static sites via Gatsby, though I don't love it, and to quickly build HTML mail templates. Granted, the bigger value here for me is JSX rather than React, but for my use cases they're functionally the same thing, and I do think you can get a lot out of using it. Especially if elsewhere in the stack you're already undertaking more complexity with it.