fix(www): render sponsor links in static HTML for SEO#7285
Conversation
The SponsorBubbles component uses @visx/responsive's ParentSize which returns width: 0 during SSG (no DOM to measure). This causes the `width < 10 ? null` guard to render nothing, making all sponsor links invisible to search engines. Add an SSR fallback that renders a simple grid of sponsor links when width is unavailable. Once the client hydrates and ParentSize measures the actual width, the interactive bubble visualization replaces it.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughUpdated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
@trpc/client
@trpc/next
@trpc/openapi
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
|
Thank you! |
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
Problem
The
SponsorBubblescomponent renders zero HTML during Docusaurus SSG, making all sponsor links in the "All Sponsors" section invisible to search engine crawlers.Root cause:
@visx/responsive'sParentSizeusesuseParentSizewhich returns{ width: 0 }during SSG (no DOM/ResizeObserver). The component's guardwidth < 10 ? null : (...)then returnsnull, producing no HTML output.Verified: Fetching
trpc.ioraw HTML confirms the "All Sponsors" section contains only a heading and "Become a Sponsor" button — zero sponsor<a>tags. TheTopSponsorscomponent (top 5) renders fine since it doesn't depend onParentSize.Fix
Replace the
nullSSG fallback with a simple grid of sponsor links. WhenParentSizecan't measure (SSG/SSR), render plain<a>+<img>tags for all sponsors. Once the client hydrates and measures the parent width, the interactive bubble visualization takes over as before.Changes: 1 file, ~25 lines added — only
SponsorBubbles.jsx.Verification
Built the Docusaurus site locally and confirmed:
grep -c "automatio.ai" build/index.html→ 0 (no sponsor links in HTML)grep -c "automatio.ai" build/index.html→ 1 (all sponsor links present)Summary by CodeRabbit
Release Notes