S
S
sergealmazov2017-03-31 14:03:24
JavaScript
sergealmazov, 2017-03-31 14:03:24

Is there an alternative to React?

Case:
There is a complex component. Table with custom elements. We take React, we take Redux. Now it's so fashionable.
And we get a set of abstractions
Action
ActionCreator
Reducer
CombineReducer
Store
We need to use connect to make React and Redux friends. Do not forget about the nesting of components, and you also need it.
As a result, we come to the conclusion that one component consists of 10 layers of abstractions, and in order to make a simple Handler, say, to send data to the server or on a click, we need to go through 10-12 functions ...
For simple components, React will do, but really a huge layer of developers has gone crazy and thinks that all these abstractions are normal?!
The complexity is growing, the cost of changes is growing. And now you are editing the Handler of the parent, and 5 layers of abstractions + bindings in the form of Provider, Connect and other scary words separate you from the child element.
Are there really no other frameworks for JS, for example, with a Message-like system where there are objects and each sends messages to each other on state changes?
And there is no need to walk in circles through ActionCreator -> Action -> ActionDispatcher -> CombineReducer -> Reducer -> State -> and from the topmost level get to the child of another 5-6 layers.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Vladimir Kashutin, 2017-03-31
@sergealmazov

https://ru.vuejs.org/v2/guide/
Here is a comparison with react https://ru.vuejs.org/v2/guide/comparison.html

V
Vlad Feninets, 2017-03-31
@fnnzzz

I was pleased with the wording "Now it's so fashionable." - no one forces you to use Ridax right away.
Dan Abramov (author of Redux) wrote about this - https://medium.com/@dan_abramov/you-might-not-need...
If you have a simple enough application, you can use state, props and callbacks and everything will be ok .
You need Redux if your application grows and it becomes more difficult to manage the data flow:
- let's say you need to call a callback and process it in a child that is at the same level but through N-children, in a readax you call dispatcher and don't worry about how to pass this callback there.
- or if you have data that is used in different components, reduplicate it? (no wei), it is more convenient to pull them out of one huge object in this case.
- plus the ridax solves the problem of state race well (otherwise you won't be able to know for sure what is happening on the page and in what order).
- well, plus middleware,
so such a number of abstractions is quite justified, unless of course you have a need for them.
And if you just need to click on the button to redraw something on the page, then take Vue and rejoice.
No need to choose technologies just because they are "hype" now.

E
Eugene, 2017-03-31
@AppFA

Perhaps you have chosen a slightly complex architecture, since you are having such problems. I have been using React for about half a year + -, it works very conveniently. After some time, when editing, no problems arise, great reusability, again with the right approach.
Regarding the question, maybe you should look towards mobx, where there is also a reactive approach. The code there needs to be written an order of magnitude less due to the large abstraction, but again, this entails difficulty in understanding what is happening. In redux, everything is based on pure functions, no magic, all components / reducers / actions are easily covered by tests.

K
kodwi, 2017-03-31
@kodwi

Angular 2 / Vue.js

O
ozknemoy, 2017-04-01
@ozknemoy

looked, touched, did not like. after the modularity of angular1, for me it is jakveri anarchy. how to maintain a huge application is not clear. For small sites I think it will do. brag about its small size. but for those 2 days that I plunged into it, I connected a few more libs. usually when there is nothing to brag about, they start to invent something. like in the west the sky is bluer and the ads are more colorful. The alternative is Angular 1 (let's leave the tales about its old age and slowness to homonocoders who will make any language work badly), but not a deuce, with a deuce you fight with the platform and not the product. plus you can add vue2. I liked it much more than Angular 2, the guys stole a lot from the first Angular, plus there you can easily connect jquery libs and pre-render with a server node

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question