leoasis / redux-immutable-state-invariant

Redux middleware that detects mutations between and outside redux dispatches. For development use only.
MIT License
937 stars 37 forks source link

Consider deprecating in favor of Redux Toolkit #44

Open markerikson opened 3 years ago

markerikson commented 3 years ago

First off, I want to offer sincere thanks to the maintainers of this library. It's been a huge help to many people, and we used it in Redux Toolkit up until v1.3.0. In that release, we ported several of our dependencies directly into the RTK codebase to cut down on number of external deps and improve maintainability ( https://github.com/reduxjs/redux-toolkit/releases/tag/v1.3.0 ). One of those was redux-immutable-state-invariant.

Since then, we've made several improvements to our version of the middleware, including warning if the middleware takes too long to run (32ms by default).

In our new https://github.com/reduxjs/redux-toolkit/releases/tag/v1.5.1 release, we've made huge improvements to the runtime thanks to assumptions like working with frozen state from Immer, as well as optimization of the keypath handling by switching from arrays to strings.

RTK includes our immutability middleware in configureStore by default, so most people should be getting it automatically these days. But, since we export the immutability middleware too, people could just add RTK as a dependency and import the middleware if they wanted to for some reason.

So, at this point our version of the middleware is significantly faster and has several other improvements. My suggestion would be to deprecate this package and point people to use RTK instead.

Thanks again for all your work here!

halaei commented 2 years ago

Hello @markerikson Can we have an independent sub-package just for the immutable middleware inside RTK? Also it will be very helpful if you merge #35 into RTK for supporting Map and Set.

markerikson commented 2 years ago

Sorry, no plans to publish the middleware as a separate package or to add Map/Set support - we specifically advise against using those in Redux state.

halaei commented 2 years ago

Thanks for the quick reply 🙂