feat(unhead): add tagWeight option and meta-beyond-1mb validation rule#716
Conversation
… rule Allow users to customise CAPO tag weights via `CreateServerHeadOptions.tagWeight`. This enables reordering `<head>` tags based on request context (e.g. promoting SEO meta above styles for bot requests). Also adds a `meta-beyond-1mb` validation rule to the validate plugin that warns when meta tags are rendered beyond the crawler byte parsing limit (default 1MB), which can happen when large inline styles push OG/SEO tags too far down. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 29 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ 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 |
Bundle Size Analysis
|
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
tagWeightoption toCreateServerHeadOptionsthat allows users to override the default CAPO tag weight function. This enables reordering<head>tags per-request — e.g. promoting SEO meta above styles when the request comes from a bot.meta-beyond-1mbvalidation rule to theValidatePluginthat warns when meta tags are rendered beyond the crawler byte parsing limit (default 1MB). Social crawlers (Facebook, Twitter) only parse the first ~1MB of HTML, and large inline styles can push OG/SEO meta past this limit.capoTagWeightis already exported fromunhead/server, so users can easily wrap it:Closes #693
Test plan
tagWeightoption test: custom weight function promotes meta above stylesmeta-beyond-1mbvalidation rule: warns when meta rendered past configurable byte limitmeta-beyond-1mbdoes not warn when within limit🤖 Generated with Claude Code