perf(router-devtools-core): avoid idle polling and repeated styles - #8266
perf(router-devtools-core): avoid idle polling and repeated styles#8266LadyBluenotes wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughChangesDevtools performance behavior
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to Devtools now avoids cache polling while closed, refreshes when reopened, and reuses styles within a mount. The covered behavior preserves panel updates and style installation without an identified merge-blocking risk. Sequence Diagram(s)Cache polling lifecyclesequenceDiagram
participant Panel
participant Router
participant Cache
Panel->>Router: Read router cache
Router->>Cache: Access cache values
Panel->>Cache: Poll every 500ms while open
Panel->>Cache: Stop polling while closed
Shared style mountingsequenceDiagram
participant DevtoolsCore
participant StylesContext
participant useStyles
participant ShadowRoot
DevtoolsCore->>StylesContext: Provide mount owner
StylesContext->>useStyles: Expose owner
useStyles->>useStyles: Cache styles per owner
useStyles->>ShadowRoot: Install shared and dynamic styles
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 6 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
View your CI Pipeline Execution ↗ for commit 5c6ab05
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview8 package(s) bumped directly, 22 bumped as dependents. 🟩 Patch bumps
|
Bundle Size BenchmarksThis pull request does not affect bundle size in any measured scenario. |
🎯 Changes
The floating devtools panel scans the route cache every 500 ms even while closed, and route rows repeatedly construct the same static styles. Pause polling while closed, refresh immediately on reopening, and reuse shared styles within each devtools mount. Style generation stays in the lazy-loaded panel chunk; each mount has its own weak cache key so styles can be regenerated on remount.
The regression fixture reduces four closed-panel cache scans to zero over 2,000 ms of fake time. With three child routes and one cached match, shared-style construction falls from 16 calls to one for the floating panel and from 15 to one for the standalone panel. These are operation counts, not browser latency measurements.
Related to #6729.
✅ Checklist
🚀 Release Impact
Summary by CodeRabbit
Performance
Bug Fixes
Tests