fix(devtools-utils): unmount the devtools core when a Preact or React panel unmounts - #533
JoviDeCroock wants to merge 1 commit into
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 configurationConfiguration used: Repository: TanStack/devtools/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughReact 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. ChangesPanel Unmount Cleanup
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to React and Preact panels now retain their mount elements for cleanup. The reviewed changes show no actionable merge risk. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The 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 detailsSecurity Blast Radius
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation 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. Comment |
🎯 Changes
When a Preact or React panel unmounts, its ref is already detached by the time the effect cleanup runs (React 19, Preact 11), so the devtools core was never unmounted. The effect now keeps the element it mounted into in a variable and uses that in the cleanup. Adds a test for the Preact panel.
✅ Checklist
pnpm test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit