Skip to content
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

Add redux-devtools #27

Closed
wants to merge 5 commits into from
Closed

Conversation

barrystaes
Copy link
Contributor

Adds redux-devtools 3.01 and redux-devtools-log-monitor 1.0.2 in a window.
Seperate configureStore.dev.js to avoid bundling debug code in production builds.

As discussed in #21

@coryhouse
Copy link
Owner

Hi Barry - I'm getting this: undefined is not an object (evaluating 'popup.location');

It's bombing on line 8 of showDevTools.

I really appreciate you creating the PR and I'm eager to try this. That said, I want to be upfront. After looking at the plumbing that's necessary for redux-devtools, I'm hesitant to incorporate this. I want to avoid confusing people by adding more complexity, and I'm not sure this will be used by the majority (though I do admit it demos really well).

Does that make sense? Am I nuts?

@nickytonline
Copy link
Collaborator

@coryhouse , do you have a popup blocker running in your browser? I think that may be the issue.

@coryhouse
Copy link
Owner

Ah, bingo. Safari was quietly suppressing it, but Chrome at least notified me. Working great in Chrome!

@barrystaes
Copy link
Contributor Author

@coryhouse actually i agree: its a lot of plumbing just to keep the debug code out of production. Apparently there is no other way to allow this code to be optimized out during build, at least that i found out about.

I leave the verdict on complexity to you. That said, i think the success of react-slingshot lies in being complete but not overly complex.

@barrystaes
Copy link
Contributor Author

Perhaps its indeed best to keep the complex in a separate fork. Its kind of what i'm planning to do with trebuchet.. where i also use a router, and am working on a CRUD and API example.

@coryhouse
Copy link
Owner

I'm going to go ahead and close this, but I'm adding a note to the FAQ that links to this thread for anyone interested in a branch that makes this happen. Thanks for your understanding and insight!

@coryhouse coryhouse closed this Jan 21, 2016
@barrystaes barrystaes deleted the feature-devtools branch January 26, 2016 10:14
@thadk
Copy link

thadk commented Mar 28, 2016

https://github.com/barrystaes/react-trebuchet/blob/79c55de28d8e0030a7aa8f83a45be806e43f58dc/src/store/configureStore.dev.js#L18

This commit's use of compose() is actually a better, original-repo-recommended way to support the devToolsExtension along with arbitrary middleware (https://github.com/zalmoxisus/redux-devtools-extension) than was added to mainline in #49

Here is the way that worked best (requires our redux 3.1^):

  const store = createStore(rootReducer, initialState, compose(
    applyMiddleware(thunk),
    window.devToolsExtension ? window.devToolsExtension() : f => f
  ));

@coryhouse
Copy link
Owner

@thadk Seriously bizarre timing - I was literally about to commit this, but my commit is structured slightly differently. Thoughts?

@thadk
Copy link

thadk commented Mar 28, 2016

Nice! Looks like mostly the const is different and I'm new enough to ES6 that I don't know for sure whether replaceReducer's modification should mean the store is definitely a let instead, but it seems to work either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants