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

[DevTools] polish hooks: complex values preview #17073

Closed
a-x- opened this issue Oct 12, 2019 · 7 comments · Fixed by #17579
Closed

[DevTools] polish hooks: complex values preview #17073

a-x- opened this issue Oct 12, 2019 · 7 comments · Fixed by #17579

Comments

@a-x-
Copy link

a-x- commented Oct 12, 2019

We create many useDebugValue helpers, loggers and so one now, so we can feel less pain.

What matter (Updated)

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

I wrote related twit recently with one of my DebugValue helpers. screenshot out here:
Screenshot 2019-09-29 at 14 01 53
my named hooks currently require a label option unless react babel cannot transform name of variable automatically

@bvaughn
Copy link
Contributor

bvaughn commented Oct 12, 2019

Big bucketed issues like this can be helpful in some cases, for project maintainers to track a larger initiative, but I'm not a fan of them for feature requests- particularly when some of the features are controversial (like "named hooks", which already has its own huge issue and so really doesn't need to be mentioned again here).

I'm closing this. If you'd like to re-open an issue for the complex value preview, please feel free. I thought one had already been opened but I wasn't able to find it.

The request of copying the name doesn't really seem like a common use case to me. (Why would you need to select+copy text like "State" or "Reducer"?) But you could open that as its own issue as well.

@bvaughn bvaughn closed this as completed Oct 12, 2019
@a-x-
Copy link
Author

a-x- commented Oct 13, 2019

Okay=) I updated description

@a-x- a-x- changed the title [DevTools] polish hooks [DevTools] polish hooks: complex values preview Oct 13, 2019
@a-x-
Copy link
Author

a-x- commented Oct 13, 2019

Excuse me, I don’t know before, that named hooks are controversial. Can you point me to the message, that explains the problem?

@bvaughn
Copy link
Contributor

bvaughn commented Oct 14, 2019

Sure, if you search React GitHub issues for "named hooks" you'll find issue #16474 which explains in depth why it's kind of a complicated issue.

@a-x-
Copy link
Author

a-x- commented Oct 21, 2019

Thank you
And can you re-open the issue as I updated the description?

@bvaughn
Copy link
Contributor

bvaughn commented Dec 10, 2019

I have made some progress on this this afternoon. Needs more testing (and probably some new unit tests as well) but here's a preview:
dt-better-previews

@bvaughn
Copy link
Contributor

bvaughn commented Dec 11, 2019

Tweaked things a bit more and I think it's pretty close to mirroring what Chrome console does not. Feels a lot better when exploring nested values.

dt-better-previews

Should be ready to submit a PR soon. Need to update tests.

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

Successfully merging a pull request may close this issue.

2 participants