-
Notifications
You must be signed in to change notification settings - Fork 115
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
Redux - Devtools are broken in release 2.0.1 #28
Comments
Thanks @winklerp for reporting the issue, seems like both this one and #24 are related. I am thinking that I should revert my change to create moduleEnhancer, and just add parameter to configureStore which accepts enhancers that I can compose. @geminiyellow will that satisfy your scenario? |
Hi @navneet-g, I made a quick fix in my repo and added the dev tools composer in moduleEnhancer. This works for me. I think if somebody uses redux-dynamic-modules adding the dev tools compose twice shouldn't be much of an issue, because you have to adjust your setup (configure store, ...) anyway. Maybe we could pass in the composer to moduleEnhancer as a parameter (with default = regular composer)? What didn't work was to compose moduleEnhancer in redux createstore with the dev tools composer. In that case my module reducers weren't called anymore. Actually I like the change with moduleEnhancer because we now can use the standard redux createstore method. What seems harder to solve with moduleEnhancer in my opinion is the issue in #24 when passing combined rootreducers to redux createstore. In that case the chained reducers get messed up and undefined keys without reducers are in the store. |
Can we assert against passing reducers if you have used moduleEnhancer? It's not ideal, but it seems like that should work. I think we should try to make the enhancer concept work unless it really cannot |
Passing root reducers is not really necessary when using moduleEnhancers because you can pass the reducers with initial modules. That's how I did and it works fine. Maybe just a little note somewhere in the docs. I agree - the module enhancer concept is good and we should make it work. I like it because we can use the standard redux createStore method. |
@abettadapur @winklerp I also like moduleEnhancer concept that is why I made the breaking changes :), but it is giving us a lot more trouble then it is helping. I tried few things to make it work with redux dev tools and fixing the issue in #24 but not having any success. I am open to a Pull Request if you have any suggestions. |
I just added these lines in moduleEnhancer.ts and redux devtools work fine:
We could also pass in composer as optional parameter to moduleEnhancer. Default value = Redux composer. I would appreciate not remove module enhancer. I also see not big deal with issue #24 because as I wrote before passing rootreducers with the initial modules works. |
Thanks @winklerp ... I already tried that, if we allow consumers to use redux store, I want to function it out of the box. The above will cause three non standard practices
It is going to be hard to explain and might cause bugs. I prefer removing moduleEnhancer and just exposing createStore, as now the interface is pretty clean and easy to understand. It will be easier for us to test redux-dynamic-modules. @abettadapur what you suggest. |
@navneet-g I kind of agree now, maybe we should just go back to createStore from the ModuleStore, and allow for enhancers to be passed in correctly. Points 1 and 3 are kind of an issue |
woo, breaking change again, |
@navneet-g @geminiyellow |
@winklerp yep, i knew i can put root reducers into a root module,
not just put integral module in some place. |
@winklerp and @geminiyellow thanks for your patience, help and feedback while we get it sorted. In terms of @geminiyellow question about using it in old project, I hope there are not too many places where you have redux entrance and it is easier to use. We have not pushed the update to npm yet. If you have any alternate implementation please share a PR and we can discuss. |
hi @navneetg-msft , i like the PS: 1 point in @navneet-g 's comment,
i dont think that is the package should do, we just need to put the notify in docs. and here: how to change the middleware enhancer order if i want to put it in the first of all. |
about this, |
The new ModuleEnhancer is composing the enhancers without redux devtools by using the plain compose method of redux and so the store is not recognized in the tools.
Fix in ModuleEnhancer.ts:
let composeEnhancers = compose;
if (process.env.NODE_ENV === "development") {
composeEnhancers = window["REDUX_DEVTOOLS_EXTENSION_COMPOSE"] || compose;
}
The text was updated successfully, but these errors were encountered: