question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Discussion] Gatsby Devtools

See original GitHub issue

Summary

There is a redux devtools section in the docs and some old issues. But i believe the docs are outdated and also those are for working within the Gatsby repo itself, not with a Gatsby site, because gatsby sites do not have access to remotedev. (please correct me if this is wrong - i tried to simply install remotedev in my app (as well as globally) and it didnt work)

Anyway, this seems like a strange limitation. Why shouldn’t Gatsby apps have the same tooling? this doesnt have to be limited to hooking into redux devtools, although we do get those for “free”.

Idea list

  • CLI to launch remotedev to see redux updates in browser
  • see socket.io messages
  • “–verbose” mode to log out all the lifecycles called by each plugin in sequence (honestly not sure if this is covered by redux but we can probably do some custom reporting)
  • ???

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

10reactions
tomVltcommented, Sep 19, 2018

Not sure it achieves your Idea List but if someone wants to see redux updates in browse, there is simple pattern. You will have data visualisation such as reducers structure, action dispatch, stop and replay updated in real time… It works well in my own V2 boilerplate :

First Step

Second Step

Last Step

  • In your createStore config pass a compose callback with the devtools config as last argument you can see my own config as an example. Yours might be different depending on your needs.
import { createStore, compose, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import rootReducer from './reducers';

const initStore = () => {
  const windowGlobal = typeof window !== 'undefined' && window

  const devtools =
  process.env.NODE_ENV === 'development' && windowGlobal.devToolsExtension
    ? window.__REDUX_DEVTOOLS_EXTENSION__ &&
      window.__REDUX_DEVTOOLS_EXTENSION__()
    : f => f;

  const store = createStore(
    rootReducer,
    compose(
      applyMiddleware(thunk),
      devtools,
    )
  );

  return store;
};

export default initStore;

2reactions
tomVltcommented, Sep 27, 2018

Not now due to V2 migration and that’s pretty understandable…

But I’m pretty sure Gatsby community will come up in a couple of month to develop “an out of the box” solution. They’ve already commit a V2 starter with Dan Abramov’s Devtool version and emotion ssr together !

Meanwhile Redux-devtools-extension, as I explained above, achieves pretty much everything your are looking for, it’s just an alternative to redux-remotedev which is way more stable and maintained by the way (7000+ stars, 47 contributors on github).

Since I exposed a V2 implementation you should definitely give it a try 😃 Cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Behind the Scenes: What makes Gatsby Great
Gatsby is great from a multitude of perspectives. Our community is great. The developer experience is great. The performance of the ...
Read more >
Cannot debug gatsby website in chrome dev tools
When I run gatsby develop and try to add a breakpoint in chrome dev tools, the break can only be added at the...
Read more >
How to debug a child process in Node and Gatsby.js with ...
I ran the process in the debug mode, opened the Chrome dev tools with a debugger paused in the first line and pressed...
Read more >
swyx
Since I work on Infra devtools, I made notes on this week's. @a16zLIVE. infra discussion with ... Martin and Peter held a followup...
Read more >
What's New In Gatsby 2022?
Further Reading # · “Gatsby 5 Umbrella Discussion,” Gatsby · “(Re-) Introducing Gatsby, A Reactive Site Generator,” Kyle Mathews · “Scripts and the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found