Edit typo
Meanwhile, for Angular, I keep constantly going back to the documentation, trying to remember all the small details about templating, binding, decorators, modules, dependency injection, etc...
I stand by my point, I am yet to find a use case where some form of react is not the best solution. Whether it is server side rendered, a single page app, or statically rendered.
The only criticism I hear about react boil down to people complaining about bad practices that are not linked to react, but merely conflated with it, like not caring about bundle size, messing architecture or other aspects that are orthogonal.
That's not true, you can use JSX with Vue, we do use that for one of our clients and it hasn't raised issues whatsoever
Render functions returning JSX is the key brilliant idea invented by react and the fact that vue adopted it just proves the point even more:
React or the ideas at the core of react are not the mistake of the last decade but the blessing of the last decade for web development (and more).
It will not, because Vue has a better integration with the data source (Vuex) and a better integration with the routing (Vue Router)
I mean, I agree that React is an awesome framework implemented upon great design ideas (pure functions and plain JS templates), but it has its shortcomings, that frankly make me still prefer Vue to React (mainly Redux and the router)
But whatever floats you boat really, the point is that the nice part of vue are inspired by react anyway. I wish the two community merged, to be honest, I see no point in dividing for such small differences.
You specifically argued against that, your arguments seem to be highly religious in nature.
I don't know how many years you've worked in the industry but if you think React will be the dominant way of building apps for the next ten years, I have some Adobe Flash developers who I'm sure would like to say a few words.
Seriously though, JSX and TypeScript are nothing new. Both were part of ActionScript 3, a big language backed by a powerful company (Adobe). 15 years later, nobody even remembers it existed. How am I still making a comfortable living coding today? By not getting too attached to any language or framework... they are all just tools in the end.
So let the young ones be, time will eventually teach them those lessons, sooner than they think.
I remember E4X and Flex but not a JSX like syntax.
My arguments are not religious but based on facts, I can share my PhD thesis from 2016 about user interface specification languages, that includes a comparison of more than 20 different approaches including react.
Flash was always a proprietary platform and only fools would have bet their whole career on it back then. The situation of the ideas behind react, and browsers as a platform are very different.
I’m not betting my career on it though (I’m a CTO in a company which Is not centered around web stuff) but I do believe that these ideas will leave an impact in the industry, and this belief is backed by specifically studying this topic for 4years, plus my 15years in the industry.
My job is to enforce some semblance of sanity between very smart and clever engineers without heavily impacting their ability to deliver. My job entails much cat-herding, setting norms, and maintaining expectations.
Every day I thank the gods we went with Angular. It has saved us countless times, every refactor is a joy, every upgrade is painless, every component is easily shared.
I don't have to constantly worry about XSS, I don't have to explain how I want things structured (because the build fails if they don't structure it right), and I don't have to worry that if someone leaves, no one will know how to pick up and modify their project.
Do developers hate it? Absolutely! They want to get work done fast and pump out cool, clever, smart work! They see Angular as a hinderance to the objective of "doing" because now they need to know about all these damn opinions that aren't their own. Angular isn't for them, it's for everyone else.
By contrast, React enables selfish coding, which while totally okay when you have a few people and clear lines of ownership, does not scale well without strictly defined responsibilities and amazing cultural levels of synchronous decision-making.
Nail meet hammer. Seriously though, what why you need a JS framework for static pages? What if your backend is in Go? What if you're doing heavy duty numerical analysis? What if your users want a Wordpress-like site? What if your team uses Rails or Drupal to quickly build sites?
You're saying React is better at everything?
https://en.wikipedia.org/wiki/Tears_in_rain_monologue#Tannh%...
Hopefully you're not disappointed :)
[1] https://en.wikipedia.org/wiki/The_Three_Stigmata_of_Palmer_E...
Of course, those are lightweight / 'native' (to react) alternatives to redux / state management; last time I used it there were some really neat (theoretical) advantages, such as a browser addon where you could do time traveling debugging (replay individual events) or push the state and all state changes into a support ticket for reproducibility. Purely theoretical though, and at the time using Redux added a lot of mental and labor overhead, especially when using it to manage forms. (personally, I think form data should never be part of a global state; it should be limited to a component that manages the data itself and does not leak it elsewhere. But, it depends on the situation, as always)
That react-three-fiber project is cool, but engineering is not about you can do, it's about finding the best solution for a given set of requirements, and 95% of web apps don't need that kind of functionality - it's just unnecessary over-engineering at a huge overhead cost.
React devs love to talk about one-way-data flow and Flux state management. They forget state doesn't come from the client, it comes from the server. Why not carry this one-way-data-flow model all the way back to the database, which is where your state actually originates?
I fully agree, and this is why I can’t understand why in 2020, some people still don’t understand that react/SPA and node backend for server side rendering are the best solution.
With react and server-side rendering you code your front end only once, of course. And the same codebase can be rendered on the server or on the client transparently. Same JS libraries can be used in the server, in the browser, in mobile apps with react native.
There is just the API on one side, and the frontend on the other side. Where the frontend is rendered does not matter.
Please check out our new official Redux Toolkit package. It includes utilities to simplify several common Redux use cases, including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once:
Also, note that we have a new "Style Guide" docs page which specifically recommends patterns that we feel will lead to simpler code, like the "ducks" structure for single-file Redux logic:
https://redux.js.org/style-guide/style-guide
Finally, we're currently working on a major rewrite of the Redux core docs, with the goals of updating them for today's target audience and teaching easier-to-use patterns:
https://github.com/reduxjs/redux/issues/3592
(and by "we" I basically mean "me", since I'm not getting a lot of help with this effort so far.)
I'll also point out that while Context is a great tool for making data available to a nested subtree of components, it has major limitations in terms of processing frequent updates. We tried to use it internally in React-Redux v6, and it just wasn't sufficiently fast enough, which is why we had to rewrite the internals again in v7 to use direct subscriptions instead. So, very useful, but not a replacement for Redux.
Thank you for your work on Redux - I think it's fantastic!
Lots of hate in this thread, but React/Redux are great, even if that somehow makes me an imposter or a hipster or whatever the tools I use somehow say about me.
I obviously didn't _create_ Redux, but I'll take a decent amount of credit for helping keep it relevant over the last few years (docs work, blog posts, answering questions, React-Redux updates, Redux Toolkit).
I'll say up front that it's definitely not as "necessary" as it was early on and that there's lots of other great alternatives out there, but yeah, I don't get the recurring waves of "I hate Redux" that seem to pop up on Twitter every few months.
FWIW, I talked about some Redux usage stats and where it fits in compared to other options in my "State of Redux" talk at Reactathon last year:
https://blog.isquaredsoftware.com/2019/03/presentation-state...
Looks like I should get to do an updated version of that talk later this year.
Having used both Angular (since 1.0) and React (only recently), it's obvious why React is more popular. Any decent engineer can be productive in React within a day since the concepts are so intuitive and simple. With Angular, if you don't really know how things work, you are going to struggle a lot for a while.
While i can't speak for the rendering performance, the design itself is definitely elegant and not built for "code monkeys" but real engineering productivity
I think that just by using Hooks and Contexts you can get a lot done in a predictable way without adding too much complexity. With typescript and a proper IDE you get also wonderful type-checking and refactoring capabilities.
I used AngularJs (1.x) a lot before and in comparison it was both more complex and full of unexpected behaviors.
I have less experience with Angular (2+), but I found it much more complex and in some parts over engineered.
This is the cost when app architecture gets delegated to your developers over a high quality central solution, the quality is as good as your developers.
Juniors new to React are unlikely to do so, IME (as a semi-new-to-React not-junior working on a team with new-to-React junior-ish devs -- by experience; there isn't a formal junior/not-junior distinction on our team.)
OTOH, if you do things you really shouldn't do in React, while they won't all be flagged, there's a very high probability it will result in at least related warnings pointing to it in the devtools console, so that's something.
I'm not saying I personally agree with the decision, but I could see how management might conclude to chose Angular with that rationale.
What do you even mean?
Redux was a simple and elegant implementation of the unidirectional data flow (aka the Flux pattern). It came out during the time when the state of the art was Angular 1.x (aka AngularJS)'s two-way data binding, requiring a lot of dirty checking. Redux might or might not (the story is moot) have been influenced by Elm, which has exactly the same concept of actions, state modifications in response to actions, and re-renders in response to state modifications; all as pure functions; and Elm developers are finding this approach enjoyable and predictable. But even Elm aside, the pattern that redux is using, i.e. communicating via messages (actions) and subscribing to state changes in connected components, is a variation on the age-old, battle-tested event sourcing and pub/sub. What's so bad about that?
Is it just the pairing of React / Redux you find unappealing?
Your feedback is disappointingly vague but you seem passionate about it so I assume there’s something deeper here.
All in all you shouldn’t worry too much about employability if you pick and stick with something popular. Check your local job-market and stop worrying about what’s hipster cool on HN. There hasn’t been a single Rust or Go job listing in my entire region of Denmark for an entire year, mean while there are currently around 150 PHP positions open right now.
You don't have to create actions or constants anymore, you just create your reducer functions and selectors, then use hooks to select and dispatch in your components.
Never got why people took up a completely different paradigm just because they couldn't figure out how to reduce their boilerplate...
React can be that other half...