Uh oh!
There was an error while loading. Please reload this page.
fix(react-router): avoid rewriting unchanged head assets - #8257
Conversation
Fixes#8250 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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 (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthrough
ChangesAsset rendering and navigation
Merge Risk:⚪ Minimal · up to This change stabilizes unchanged inline style and script content across navigation, preventing redundant browser writes and Trusted Types failures. The included regression coverage supports merge readiness. Sequence Diagram(s)sequenceDiagram
participant React19
participant Asset
participant DOM
participant Browser
React19->>Asset: rerender route assets
Asset->>React19: provide memoized HTML object
React19->>DOM: retain unchanged style or script content
Asset->>Browser: inspect existing scripts
Browser-->>Asset: return matching script elements
Asset->>DOM: reuse or inject script
🚥 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 3 functions across 4 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 |
🚀 Changeset Version Preview6 package(s) bumped directly, 18 bumped as dependents. 🟩 Patch bumps
|
View your CI Pipeline Execution ↗ for commit 2e38f88
☁️ Nx Cloud last updated this comment at |
Bundle Size Benchmarks
The following scenarios have bundle-size changes compared with the baseline:
Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better. |
Uh oh!
There was an error while loading. Please reload this page.
Merging this PR will regress 4 benchmarks
|
| Mode | Benchmark | BASE | HEAD | Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem server aborted-requests (vue) | 1,014.4 KB | 1,110.8 KB | -8.68% |
| ❌ | Memory | mem server error-paths redirect (react) | 316.6 KB | 334.2 KB | -5.26% |
| ❌ | Memory | mem server server-fn-churn (vue) | 345.8 KB | 364.7 KB | -5.18% |
| ❌ | Memory | mem server server-fn-churn (react) | 409.2 KB | 423.2 KB | -3.31% |
| ⚡ | Memory | mem server error-paths redirect (vue) | 454.2 KB | 410.9 KB | +10.53% |
| ⚡ | Memory | mem server error-paths not-found (react) | 450.3 KB | 408.5 KB | +10.21% |
| ⚡ | Memory | mem client unique-location-churn (solid) | 409.6 KB | 385.1 KB | +6.36% |
| ⚡ | Memory | mem client mount-unmount (solid) | 511 KB | 482.3 KB | +5.94% |
| ⚡ | Memory | mem client interrupted-navigations (vue) | 356.7 KB | 340.1 KB | +4.86% |
| ⚡ | Memory | mem server error-paths not-found (vue) | 503.4 KB | 482.9 KB | +4.24% |
| ⚡ | Memory | mem server peak-large-page (vue) | 1 MB | 1 MB | +3.96% |
| ⚡ | Memory | mem server error-paths not-found (solid) | 772.7 KB | 743.4 KB | +3.95% |
| ⚡ | Memory | mem client navigation-churn (vue) | 1.6 MB | 1.5 MB | +3.17% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing schiller-manuel-head-asset-stability (2e38f88) with main (0497cae)
Footnotes
48 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
🎯 Changes
React 19 rewrites unchanged head content when
dangerouslySetInnerHTMLgets a new object. This replaces the stylesheet during navigation and can fail under Trusted Types.This prevents redundant writes after hydration, but does not add general Trusted Types support.
All 18 bundle scenarios match or improve the primary gzip metric against
origin/main: eight shrink by 19-31 bytes. Raw output shrinks by 47 bytes in affected scenarios. Brotli increases by 57-175 bytes in five scenarios.Fixes#8250
✅ Checklist
🚀 Release Impact
Summary by CodeRabbit