-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
refactor(devtools): add types to Explorer #2949
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tanstack/react-query/ET9df1xXf2KzYDgncuotnrWa3P7q |
Add types to Explorer component with as minimal functional changes as possible while still getting type safety 2742
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e39f971:
|
Codecov Report
@@ Coverage Diff @@
## master #2949 +/- ##
==========================================
- Coverage 96.40% 96.40% -0.01%
==========================================
Files 45 45
Lines 2227 2278 +51
Branches 637 641 +4
==========================================
+ Hits 2147 2196 +49
- Misses 77 79 +2
Partials 3 3
Continue to review full report at Codecov.
|
can you try adding some more tests please |
Can do |
@TkDodo are you be happy for me to do some additional clean up in this file too? |
sure :) |
@Liam-Tait this looks like a nice addition, but the PR is still in |
@TkDodo I think this still needed some more tests. I haven't added enough to maintain or increase coverage, however most of these changes are adding types to existing code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the test coverage. You've added types AND added a test. not sure how the coverage can go down but that doesn't matter :)
@TkDodo Addressed issues, ready for a re-review |
seems like there are some type errors now:
|
@TkDodo Fixed |
* refactor(devtools): add types to Explorer Add types to Explorer component with as minimal functional changes as possible while still getting type safety 2742 * remove unused set param from explorer toggle * Wrap Explorer toggle with useCallback * Rename Explorer toggle to toggleExpanded * Remove unused path * Move subEntryPages definition next to usage * Set type to be a string instead of string union * Remove unused depth prop * Move chunkArrays to own tested function * set handleEntry as required * Add LabelButton for accesibility * fix test * Remove shadowing * Set subEntries as empty array by default * Add type for property * Convert handleEntry function to react component with entry props * Use unknown for value * Set RenderProps to required where possible * Add required attributes to Explorer tests
🎉 This PR is included in version 3.34.17 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 4.0.0-alpha.22 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@Liam-Tait I'm now seeing some react key related warnings when running the react-query devtools tests:
can you maybe have a look at those please? |
@Liam-Tait we sadly have 2 more (minor) issues reported that are likely introduced with this PR:
3.4.16: was this an intended change?
For example, take a look at this sandbox
--> the If you take the sandbox back to Could you take a look at these two things please? Should we open separate issues? Thank you! |
ah, issue 1 is caused by wrapping the clickable element in a |
@TkDodo I'll have a look at these this weekend |
Add types to Explorer component with as minimal functional changes as
possible while still getting type safety
#2742