Replies: 1 comment
-
@Akatroj we have no plans to build persistence into RTK. To be frank, we already have our hands full just trying to maintain RTK as it is. Our primary goal for this year is to ship improvements to RTK Query, and we've got over 120 open issues right now that are asking for RTKQ features, improvements, or bug fixes. Just trying to work through those will take us the entire year. We don't have the time or bandwidth to take on building an entire new persistence feature set for RTK, or forking and taking over an existing persistence library. Note that the docs section you pointed to isn't a "recommendation" per se - it's a set of instructions for "here's how to configure this widely-used lib to work with RTK, if you are choosing to use that lib". I agree it's a fairly common thing that Redux devs want to do, but there are existing ecosystem libs for it. There's a newer alternative lib at https://github.com/zewish/redux-remember that you might want to look at as well. |
Beta Was this translation helpful? Give feedback.
-
Currently, your recommended solution to persisting redux store data is to use redux-persist: https://redux-toolkit.js.org/rtk-query/usage/persistence-and-rehydration#redux-persist. This library however, has been unmaintained for 3 years, with multiple unresolved issues and unmerged PRs. There is no contact with the owner of the repo and there has been discussion on forking the project (rt2zz/redux-persist#1463). There are issues reported that redux-persist does not work correctly with RTK v2 and redux 5, or with newest 0.73 version of react native. While I haven't confirmed these personally and they may just be problems with configuration on the reporters' side, as time goes on, real issues will arise if the library is not properly maintained.
I think Redux Toolkit should come with an option for persisting the data store. After all, this is supposed to be the all-in-one package for using redux, and persisting the store is a crucial feature when building react-native or electron apps. This could be a new library or a fork of redux-persist, but I think something needs to be done here. I also think that you should not suggest using an unmaintained library in your docs without any warning. These docs are the go-to for any new react developers and they will have no idea what are they getting themselves into, with using a library that has lacking documentation, poor Typescript typings and no-one to answer their questions.
Pls consider 🙏
Beta Was this translation helpful? Give feedback.
All reactions