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.

[DevTools] show state history like redux devtools does for actions and more

See original GitHub issue

feature request

Nowadays we migrate much of our use-cases from complexes of high order redux actions+ HO selectors + HO reducers (I call it HOXes) to react hooks. Hooks allow us easier to incapsulate blocks of functionality rather it was possible with redux infrastructure, when we had to use our complex complexes to avoid much of copy-paste.

One drawback is lack of history of changes and more poor devtools at all. We creates many useDebugValue helpers, loggers and so one now.

expected behavior?

  • show history of hook state changes with dom and js stack traces, diffs and maybe even history traversing
  • allow more precisely editing of values in devtools. Currently I cannot choose number or string or bool or object when I edit prop or state value
  • allow copying the state name in devtools (remove css no-action pls)
  • add something like $r.state back
  • preview complex values brifely like chrome devtools does it for arrays, sets, maps, objects,

I wrote related twit recently with one my DebugValue helper

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? all are latest

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
bvaughncommented, Oct 9, 2019

I’ve responded before on why I don’t think React DevTools can add a Redux-like props/state history, but I’m having trouble finding the post.

Essentially it comes down to the fact that in JavaScript, a lot of state is mutable- so storing a copy of a previous value would not be possible without deeply copying (and even the, some mutable globals can’t be copied).

It would also add a lot of memory overhead and storing old closures would require retaining all of their references, preventing things from being garbage collected.

I’m going to close this issue because I don’t think it’s something we can (or should) take action on. Happy to continue discussing it here though if there are questions.

You may consider opening a new issue for this bullet:

  • preview complex values brifely like chrome devtools does it for arrays, sets, maps, objects,

I don’t think I will have any time to work on it, but if someone wanted to contribute a PR I can try to find time to review it.

0reactions
qmg-akaracommented, Jun 11, 2021

Thanks @bvaughn At least, would it be possible to have a history of the changed props? Something similar to WebStorm debug tool, the changed variables are highlighted when a breakpoint is hit for the second time. Something similar to the following table, first row is the component data at initial render and the second row is for the next re-render and so on. Primitive values can be copied I think, and if the prop is an object or function then Object, Class or Function name should be enough to display. Indeed, even just the prop names and Hook ids would be helpful for debugging purposes. That’d be helpful to see which props might cause re-renders.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redux DevTools: Tips and tricks for faster debugging
Extending the ability to show trace of action, Redux DevTool allows you to navigate to the exact point of the codebase. For large...
Read more >
Can I see the history of redux actions in my react app?
Just install redux-devtools chrome extension:redux-devtools. It shows actions, changes in state etc etc.
Read more >
Time Travel in React Redux apps using the Redux DevTools
The Redux DevTools records dispatched actions and the state of the Redux store at every point in time. This makes it possible to...
Read more >
How to use Redux DevTools - YouTube
Ready to set yourself up with Redux DevTools ? We walk you through the basics of how to do just that. By providing...
Read more >
How to use the redux dev tools to speed up development and ...
They can be used during the development and production state of any application. Just like you have the Chrome DevTools for directly ...
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