Skip to content

Improve performance of InlineLinkTooltip #3339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Jun 18, 2025
Merged

Improve performance of InlineLinkTooltip #3339

merged 33 commits into from
Jun 18, 2025

Conversation

emmerich
Copy link
Contributor

@emmerich emmerich commented Jun 17, 2025

InlineLinkTooltip was having a negative effect on the loading and rendering time of pages for two reasons:

  1. Despite being entirely client-side/interaction-based, it was rendered on the server, included in the RSC payload, and hydrated.
  2. On pages with 1000s of links, it was causing a very slow browser experience. I think optimizing for this size of page is a bigger task and quite niche.

This PR addresses both of these points:

  1. The tooltip is now marked as a client component, and is loaded lazily post-hydration to avoid having an impact on initial render. There's no SEO impact as the tooltips don't contain meaningful SEO content. Even on pages with only a handful of links this is a net benefit.
  2. We disable the tooltip on pages with more than 100 links.

Copy link

changeset-bot bot commented Jun 17, 2025

🦋 Changeset detected

Latest commit: aca512e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
gitbook Patch
gitbook-v2 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

argos-ci bot commented Jun 17, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v1 (Inspect) ✅ No changes detected - Jun 18, 2025, 9:13 AM
customers-v2 (Inspect) 👍 Changes approved 77 changed Jun 18, 2025, 9:16 AM
default (Inspect) ✅ No changes detected - Jun 18, 2025, 9:17 AM
v2-cloudflare (Inspect) ✅ No changes detected - Jun 18, 2025, 9:18 AM
v2-vercel (Inspect) ✅ No changes detected - Jun 18, 2025, 11:13 AM

@emmerich emmerich changed the title Rewrite link tooltip as an RSC component. Improve performance of InlineLinkTooltip Jun 17, 2025
@emmerich emmerich marked this pull request as ready for review June 17, 2025 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants