DEV Community

Discussion on: Redux is half of a pattern (2/2)

Collapse
 
peibolsang profile image
Pablo Bermejo

A little bit off-topic, but, what do you guys think about how other frameworks manage state? Such as Stimulus

Stimulus also differs on the question of state. Most frameworks have ways of maintaining state within JavaScript objects, and then render HTML based on that state. Stimulus is the exact opposite. State is stored in the HTML, so that controllers can be discarded between page changes, but still reinitialize as they were when the cached HTML appears again

If I understand it right, Stimulus is typically best suited for SSR frameworks (i.e. Ruby on Rails). So, if state is attached to HTML and HTML is rendered at the server ... does that mean that state is managed at the server? If that is true, there is something that feels wrong about it, but I am not sure what.

What do you guys think?

Collapse
 
luiz0x29a profile image
Real AI • Edited

There's nothing wrong with using the request-response model that the web was actually made for.
The only wrong thing is that it is going against the trend of SPA everything, if everyone is jumping off the cliff, does that mean you also have too ?
But I'm not a web developer, I develop all kinds of software, and some of them happen to run on the web.
One thing I wish web developers would learn is that its okay to do something that's fit for your context, its okay to use traditional things that work, you don't have to always follow the crowds to shiny newer green pastures.
Its also okay to do things differently, the only judge of the chosen solution should be the results, and that's pretty much context dependent and very hard to replicate in other situations, you have to follow your instincts, ignore the masses.
Software is so hard (it is not easy), and everything in the ends is the result of your communication with the involved people, its more about people, the people that matter to the project, and not the crowd (the other web developers), they are going for hype, they don't actually matter that much.
If static pages solve the problem, then they solve the problem, you don't actually need a SPA or something, for example. But if you need them, that's fine too, but the problem and the situation define that.
I'm in this profession to solve problem and produce value, not to please crowds, follow trends, and get exposure, follow the hype, bite the bullet or something, this is not the fashion industry.