-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Evaluate other Redux abstraction layers for inspiration #527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Computed properties or properties with dependent varied sounds cool. I guess in theory you should just use a selector, but in some cases you do want to manually set the value. I've found myself using "setter functions" that work quite well with Immer, but that requires discipline and makes it hard to visualise / understand the links between various properties. |
Good comment at https://www.reddit.com/r/reactjs/comments/m0hk63/do_you_use_vanilla_react/gqbst2w/ :
|
@markerikson Are there any specific areas around current RTK that you think would be worthwhile to look at how other abstraction layers handle it? Disclaimer: |
Not really sure, and that's kinda the point of the issue :) I'm interested in knowing what other libs do that RTK doesn't, and maybe some implementation analysis on how they do those different things so that we can determine if it's a thing that we might want to try and if it's feasible to do. |
Bytedance seems to have an entire JS ecosystem at https://github.com/web-infra-dev/modern.js and https://modernjs.dev/en/index.html, including:
Some very interesting features and logic wrapping around the Redux core, including an entire plugin system, and "models" with computed properties:
|
There's a bunch of Redux abstraction layers out there. Most of them take Redux in directions I'm not comfortable endorsing officially, but some of them might have some useful ideas we can swipe.
Note that we did something similar back in #17 when we analyzed libs like
redux-actions
andautodux
to help come up with APIs likecreateSlice
, so that sort of analysis would be the kind of thing I'm looking for here.redux-bundler
Henrik Joreteg made a neat little lib called https://github.com/HenrikJoreteg/redux-bundler . It wraps the Redux store to allow defining reusable "bundles", and adds a bunch of various shortcuts. There might be some interesting concepts or bits of behavior we might be able to take inspiration from.
My biggest concern with it is that it relies very heavily on implicit naming and behavior, and it takes the Redux API in some directions I don't particularly want to endorse.
@alexkrolick suggests that something like the
createAsyncResourceBundle
might be useful - see https://reduxbundler.com/api-reference/included-bundles#createasyncresourcebundle-optionsobject and https://github.com/HenrikJoreteg/redux-bundler/blob/master/src/extras/create-async-resource-bundle.js .Kea
https://kea.js.org/ is an abstraction layer that has chunks of reusable "logic", which can contain reducers, actions, and sagas. Those can be mounted and unmounted dynamically at runtime.
Easy-Peasy
https://easy-peasy.now.sh/ focuses on "zero config" and has things like computed properties.
Rematch
https://rematchjs.org/ has "no config", built-in side effects, and a plugins API.
VueX
VueX isn't Redux, of course, but it's inspired by Redux. The thing I find most interesting is the "modules" ability ( https://vuex.vuejs.org/guide/modules.html ), which allows plugging in additional chunks of code at runtime.
The text was updated successfully, but these errors were encountered: