Skip to content

fix(www): render sponsor links in static HTML for SEO#7285

Merged
KATT merged 1 commit intotrpc:mainfrom
shtefcs:fix/sponsor-bubbles-ssr
Mar 24, 2026
Merged

fix(www): render sponsor links in static HTML for SEO#7285
KATT merged 1 commit intotrpc:mainfrom
shtefcs:fix/sponsor-bubbles-ssr

Conversation

@shtefcs
Copy link
Contributor

@shtefcs shtefcs commented Mar 24, 2026

Problem

The SponsorBubbles component renders zero HTML during Docusaurus SSG, making all sponsor links in the "All Sponsors" section invisible to search engine crawlers.

Root cause: @visx/responsive's ParentSize uses useParentSize which returns { width: 0 } during SSG (no DOM/ResizeObserver). The component's guard width < 10 ? null : (...) then returns null, producing no HTML output.

Verified: Fetching trpc.io raw HTML confirms the "All Sponsors" section contains only a heading and "Become a Sponsor" button — zero sponsor <a> tags. The TopSponsors component (top 5) renders fine since it doesn't depend on ParentSize.

Fix

Replace the null SSG fallback with a simple grid of sponsor links. When ParentSize can'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:

  • Before: grep -c "automatio.ai" build/index.html0 (no sponsor links in HTML)
  • After: grep -c "automatio.ai" build/index.html1 (all sponsor links present)
  • 19 unique sponsor URLs now appear in the static HTML
  • Zero new build warnings (111 pre-existing HTML minifier warnings unchanged)
  • Interactive bubble visualization still works identically on the client

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed sponsor display on extremely small viewports. Sponsors now render with a simplified layout instead of being hidden.

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.
@shtefcs shtefcs requested a review from a team as a code owner March 24, 2026 06:59
@vercel
Copy link

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
next-prisma-starter Ready Ready Preview Mar 24, 2026 7:00am
og-image Ready Ready Preview, Comment Mar 24, 2026 7:00am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 77571b5f-321f-4df7-ad77-c885a323f4f4

📥 Commits

Reviewing files that changed from the base of the PR and between 9b42e02 and 31813da.

📒 Files selected for processing (1)
  • www/src/components/sponsors/SponsorBubbles.jsx

Walkthrough

Updated SponsorBubbles component to provide a fallback UI for very small viewport widths (width < 10). Previously, the component returned null for such cases. Now, it renders a flex-wrapping list of sponsor links with image thumbnails, while maintaining existing visualization logic for larger viewports.

Changes

Cohort / File(s) Summary
Viewport Fallback Rendering
www/src/components/sponsors/SponsorBubbles.jsx
Added conditional branch to render plain sponsor links with thumbnail images for very small viewports (width < 10), replacing the previous null return. Existing bubble/tooltip visualization preserved for width >= 10.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 When screens grow tiny, shrink so small,
Our sponsors now don't vanish at all—
Plain links and thumbs in flexing grace,
A humble refuge in cramped space! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is comprehensive with clear Problem, Fix, and Verification sections. However, it deviates from the template by not using the required template format with 'Closes #', '🎯 Changes', and '✅ Checklist' sections. Restructure the description to follow the template format: include 'Closes #' reference, use '🎯 Changes' and '✅ Checklist' sections, and ensure all checklist items are addressed.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing SEO by rendering sponsor links in static HTML instead of returning null during SSG.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 24, 2026

Open in StackBlitz

@trpc/client

npm i https://pkg.pr.new/@trpc/client@7285

@trpc/next

npm i https://pkg.pr.new/@trpc/next@7285

@trpc/openapi

npm i https://pkg.pr.new/@trpc/openapi@7285

@trpc/react-query

npm i https://pkg.pr.new/@trpc/react-query@7285

@trpc/server

npm i https://pkg.pr.new/@trpc/server@7285

@trpc/tanstack-react-query

npm i https://pkg.pr.new/@trpc/tanstack-react-query@7285

@trpc/upgrade

npm i https://pkg.pr.new/@trpc/upgrade@7285

commit: 31813da

@KATT KATT merged commit f6e839f into trpc:main Mar 24, 2026
48 of 49 checks passed
@shtefcs
Copy link
Contributor Author

shtefcs commented Mar 24, 2026

Thank you!

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants