perf(unhead): scale duplicate tag resolution - #945
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR adds a duplicate-heavy SSR benchmark, changes performance significance calculations to use confidence intervals, propagates benchmark failures in CI, and updates tag deduplication to clone merged values and reject unsafe properties. ChangesPerformance benchmark reporting
Tag deduplication safety
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant DuplicateHeavyRenderer
participant PerfCI
participant PerfReport
DuplicateHeavyRenderer->>PerfCI: Measure cached SSR CPU, wall time, and allocations
PerfCI->>PerfReport: Emit benchmark metrics
PerfReport->>PerfReport: Classify deltas with confidence intervals
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
📦 Bundle Size
All bundles (14)
📦 Runtime Dependencies✅ No runtime dependency changes All packages (10)
Skipped optional dependencies (18)
Production dependencies only. Peer dependencies and Unhead workspace packages are excluded. Skipped optional dependencies are unavailable on the CI platform. ⚡ Performance (directional)🟢 2 faster
All benchmarks (28)
Baseline: main @ 29d105a · 2026-08-12 · gzipped is the headline size metric · perf is directional (shared-runner, gated) |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/unhead/src/utils/resolve.ts`:
- Line 80: Update the duplicate-handling logic in the resolve flow around
ownedMergeProps so both non-merge branches remove the current key from
ownedMergeProps after replacing the mapped tag or appending a new final array
item. Add a regression test that renders, disposes, and renders again to verify
later merges do not retain attributes from the disposed entry.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f9ebe0c7-f7d9-4797-88c0-1b86820ffdba
📒 Files selected for processing (7)
.github/workflows/bundle-size.ymlbench/bundle/perf-report.test.tsbench/bundle/perf-report.tsbench/perf-ci.mjspackages/unhead/src/utils/resolve.tspackages/unhead/test/unit/server/deduping.test.tspackages/unhead/test/unit/server/prototype-pollution.test.ts
🔗 Linked issue
Stacked on #943.
❓ Type of change
📚 Description
Repeated merge tags copied a growing props object for every duplicate. Arrayable metadata also copied its growing accumulator.
Reuse render-owned accumulators after one copy. Keep cached entry props immutable, and reject unsafe inherited keys while merging.
The benchmark in #943 measures 100 merged
htmlAttrsentries and 100 arrayableog:imagevalues.Summary by CodeRabbit
Bug Fixes
class,style, and language attributes while preventing unsafe properties from being rendered.Performance