Live data from Hacker News

Redux – Not Dead Yet (2018)

blog.isquaredsoftware.com

21–30 of 133 posts

Re: Redux – Not Dead Yet (2018)

#21
post #3

I've recently tried using Redux for a side-project. While it solves the problem (organizing state), I feel there is too much boilerplate for my small project. Are there any popular alternatives which don't use reducers? EDIT: thanks for all the responses, I'll check them out :)

The Reducks pattern https://github.com/erikras/ducks-modular-redux fixes the boilterplate problem by keeping your action types, action creators, and reducers in the same file.

Re: Redux – Not Dead Yet (2018)

#22
post #20

One underrated thing that I miss from using Redux is the "action trace". You can literally sit down with the stakeholders [1] and explain the exact things that caused a screen to render . And these things are not cryptic function calls with stack-traces, but simple and chronologically ordered sets of human readable "actions" (I like to think of them as events) like UserFetched -> PlanFetched ( ) -> FrozenUser. One ca…

It's worth noting that the Redux DevTools Extension _can_ capture and display a literal stack trace for every dispatched action, if you've enabled that while setting up your store. This allows you to see what part of your app triggered each state update:

https://github.com/zalmoxisus/redux-devtools-extension/blob/...

Re: Redux – Not Dead Yet (2018)

#24
post #3

I've recently tried using Redux for a side-project. While it solves the problem (organizing state), I feel there is too much boilerplate for my small project. Are there any popular alternatives which don't use reducers? EDIT: thanks for all the responses, I'll check them out :)

I had a similar problem when I started using Redux for a side project. If it's a simple enough app (as mine was) try https://www.npmjs.com/package/unstated. I am not a React expert but this was super simple and easy to get up and running with.

[No affiliation with the project]

Re: Redux – Not Dead Yet (2018)

#25
post #20

One underrated thing that I miss from using Redux is the "action trace". You can literally sit down with the stakeholders [1] and explain the exact things that caused a screen to render . And these things are not cryptic function calls with stack-traces, but simple and chronologically ordered sets of human readable "actions" (I like to think of them as events) like UserFetched -> PlanFetched ( ) -> FrozenUser. One ca…

Overrated. In what kind of application do you need this? In the vast majority of React apps you do not need this.

Re: Redux – Not Dead Yet (2018)

#26
post #3

I've recently tried using Redux for a side-project. While it solves the problem (organizing state), I feel there is too much boilerplate for my small project. Are there any popular alternatives which don't use reducers? EDIT: thanks for all the responses, I'll check them out :)

Redux Toolkit https://github.com/reduxjs/redux-toolkit solved the problem of having too much boilerplate for me. Slices also make it organizing state a breeze.

Re: Redux – Not Dead Yet (2018)

#27

Redux is great, and I'm glad to see all this cleared up, to some extent. Especially the bit about the new context API somehow eliminating the need for Redux. I know some people don't like redux and that's fine - don't use it. But it's still super-useful to many, many people.

We all don’t get to waltz into a new job and say ‘Hey remove all this verbose Redux code and app structure, it’s slowing down velocity. Plus this crud app is too simple to add this annoying layer of boilerplate’.

Re: Redux – Not Dead Yet (2018)

#28
post #2

Oh hey, that's my post. I first wrote it back in 2018, and just updated it yesterday with some additional links and comparisons. (Actually was considering retitling it after getting some feedback last night, but given that the link just got submitted here, I'll leave it as-is for now.) A few quick notes: - If you haven't looked at Redux in a while, please try out our official Redux Toolkit package [0], which is now o…

Do you, or anyone else in the team or community, have a good resource you would recommend to people complaining about "too much boilerplate" in redux code? It is likely the most common complaint I see, that I understand to come from a place of people not understanding it this a tool best used for scaling and/or already big projects. Whenever I have worked with Redux in a large project, that "boilerplate" is minimal a…

I think that complaint usually comes from people who try to put everything related to state in Redux, and not just the parts of it that need to be.

Also the 'reducks' pattern of splitting the Redux state into separate files, each containing a reducer and the related actions and selectors helps keep things simple to understand (although I guess it is a bit more overhead, actually).

Re: Redux – Not Dead Yet (2018)

#30
post #20

One underrated thing that I miss from using Redux is the "action trace". You can literally sit down with the stakeholders [1] and explain the exact things that caused a screen to render . And these things are not cryptic function calls with stack-traces, but simple and chronologically ordered sets of human readable "actions" (I like to think of them as events) like UserFetched -> PlanFetched ( ) -> FrozenUser. One ca…

https://cerebraljs.com/
Post reply on HN