Giter Club home page Giter Club logo

Comments (8)

barrystaes avatar barrystaes commented on July 16, 2024 1

I like to make this easy on you, so i just rebased it on your latest commit.

And a screenshot for good measure: image

from react-slingshot.

coryhouse avatar coryhouse commented on July 16, 2024

I'm considering it but haven't had a chance to try them myself yet. If someone submits a PR I'd likely merge it.

from react-slingshot.

barrystaes avatar barrystaes commented on July 16, 2024

I'm nowhere yet, but since you're interested: I followed their tutorial and made a (extremely minimalistic) start at https://github.com/barrystaes/react-slingshot/tree/feature-devtools

My next step would be "Exclude DevTools from Production Builds" but i'm not sure how to do that in react-slingshot without seperating the webpack.config.js and configureStore.js files into prod/dev versions. I'd be happy to hear your take on this.

from react-slingshot.

cuzzo avatar cuzzo commented on July 16, 2024

@barrystaes,

Off the top of my head, you could look at webpack.hotModuleReplacementPlugin(). Then in src/store/configureStore.js, if module.reduxDevtools (or however you specify it) is defined, you could import the Devtool container, and then compose the reducers with Devtools.instrument(). Otherwise, do nothing.

Similarly, in src/containers/App.js, you could check if module.reduxDevtools is set before adding it to the App.

Does that make sense?

from react-slingshot.

coryhouse avatar coryhouse commented on July 16, 2024

@barrystaes The webpack.config.js in this project is actually a factory for a webpack config. You pass it an environment and it returns a config. So no separate file is necessary.

Anyway, thanks Barry. I want to spend some time getting comfortable with the Redux devtools. Looks like you've got a great start.

from react-slingshot.

barrystaes avatar barrystaes commented on July 16, 2024

Ok thanks! With your suggestions i completed my feature-devtools branch. I kept the code minimal.

Choices i made; (all covered in their tutorial)

  • A popup window instead of redux-devtools-dock-monitor. Less code, and stays out of the way of your UI.
  • No persistState() added. Its usefull to reproduce bugs with ?debug_session=reproducing_weird_bug and is easily added.
  • A prod/dev version for configureStore.js so that the debug module/component code is not included in production builds. Same goes for the window code in src\index.js. A must honestly, not a choice.. but i'm still not happy with the duplication there, a dev version that wraps the prod version would be better. But i dont know how i could do that here without having to complicate that code even more.
  • Just use the default redux-devtools-log-monitor view. Some drop-in alternatives are redux-devtools-diff-monitor and redux-devtools-filterable-log-monitor.

Just clone and build, it works comfortably. :)

Things i could improve on? Do you want me to make a PR?

from react-slingshot.

coryhouse avatar coryhouse commented on July 16, 2024

Wow, this looks great! I'm eager to try it out! And yes, a PR would be great. 👍

from react-slingshot.

barrystaes avatar barrystaes commented on July 16, 2024

For posterity: PR #27 was not merged but i'll leave https://github.com/barrystaes/react-slingshot/tree/feature-devtools available for now.

from react-slingshot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.