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] Display RegExp values in props/state #17023

Closed
wants to merge 1 commit into from

Conversation

Zirak
Copy link
Contributor

@Zirak Zirak commented Oct 5, 2019

Previously, when props/state contained a regexp, it was shown as an
empty object. This commit adds regexps as values in need of special
rehydration (like Symbols or TypedArrays), and display them as a user
might expect.

These values may be editable, but as regexps are not valid JSON it might
depart from the usual editing functionality, which may not be worth the
hassle just to support regexps.

Before:
image

After:
image

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@sizebot
Copy link

sizebot commented Oct 5, 2019

No significant bundle size changes to report.

Generated by 🚫 dangerJS against cfbfa89

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Previously, when props/state contained a regexp, it was shown as an
empty object. This commit adds regexps as values in need of special
rehydration (like Symbols or TypedArrays), and display them as a user
might expect.
@Zirak Zirak force-pushed the devtools-inspect-regexp branch from 009f403 to cfbfa89 Compare October 5, 2019 11:35
@bvaughn
Copy link
Contributor

bvaughn commented Dec 22, 2019

Hey sorry for not seeing this sooner. I like this feature, but the underlying code has changed a lot since your PR. I'm going to try to resolve it locally. Stay tuned.

@bvaughn
Copy link
Contributor

bvaughn commented Dec 22, 2019

I'm going to incorporate your branch, fix the conflicts, and add some more tests. Closing this PR in favor of #17690. (Your commit will stay in the history though!)

@bvaughn bvaughn closed this Dec 22, 2019
@Zirak
Copy link
Contributor Author

Zirak commented Dec 23, 2019

Awesome, thanks!

@bvaughn
Copy link
Contributor

bvaughn commented Jan 3, 2020

FYI this change just went out as part of v4.4!

@Zirak
Copy link
Contributor Author

Zirak commented Jan 4, 2020

woo, thanks for the follow-up, especially on a small PR like this!

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

Successfully merging this pull request may close these issues.

4 participants