fix(devtools-utils): unmount the devtools core when a Preact or React panel unmounts #533
OpenJoviDeCroock(GitHub profile, opens in a new tab)wants to merge 1 commit into
main fromrefs/pull/533/headopened View on GitHubSign in to join this conversation.
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: TanStack/devtools/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
85770b15-18a6-464f-a0e4-c075f3de70e9📥 Commits
Reviewing files that changed from the base of the PR and between afa01fec1751308eb5f60e737e408f2fc34e669a and 3a9325ee847b0208d077c86d4e8dc40fa078d040.
📒 Files selected for processing (5)
.changeset/panel-unmount-cleanup.mdknip.jsonpackages/devtools-utils/src/preact/panel.test.tsxpackages/devtools-utils/src/preact/panel.tsxpackages/devtools-utils/src/react/panel.tsxIncluded review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Walkthrough#
React and Preact panels now use the captured mount element during cleanup. New Preact tests check panel creation, mounting, and unmounting. The changes also update Knip configuration and add a patch changeset.
Changes#
Panel Unmount Cleanup
packages/devtools-utils/src/{preact,react}/panel.tsx,packages/devtools-utils/src/preact/panel.test.tsx,knip.json,.changeset/panel-unmount-cleanup.mdunmount()and clears the devtools instance. Preact tests check panel creation, mount arguments, and unmount after removal. Knip ignorespreactfor this workspace, and the changeset records a patch release.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
3a932React and Preact panels now retain their mount elements for cleanup. The reviewed changes show no actionable merge risk.
Security Architecture Review#
Security architecture risk: 🔵 Low · up to
3a932The normal unmount path is improved, but a failed core mount can now cause panel cleanup to throw. The identified effect is limited to panel lifecycle and recovery; no security boundary change was established.
Retained concerns
Security review details
Security Blast Radius
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share