Skip to content

perf: defer homepage third-party embeds#603

Open
Treasure520520 wants to merge 2 commits into
tailcallhq:developfrom
Treasure520520:bounty/217-home-lighthouse-third-party-deferral
Open

perf: defer homepage third-party embeds#603
Treasure520520 wants to merge 2 commits into
tailcallhq:developfrom
Treasure520520:bounty/217-home-lighthouse-third-party-deferral

Conversation

@Treasure520520
Copy link
Copy Markdown

/claim #217

Summary

This PR targets the mobile Lighthouse performance bounty for / by reducing third-party work on the initial homepage load.

  • Moves the Robofy chatbot script out of headTags and injects it after the page becomes idle.
  • Replaces the eager Vimeo iframe with a click-to-play poster button so Lighthouse does not load the Vimeo player during the initial page audit.
  • Preserves the existing cookie consent / Vimeo DNT behavior when the user plays the video.

Verification

  • npm ci
  • npm run build
  • npx prettier --check docusaurus.config.ts src/components/shared/GlobalLayout.tsx src/components/home/IntroductionVideo/index.tsx src/components/home/IntroductionVideo/style.css
  • git diff --check
  • Confirmed build/index.html no longer directly contains player.vimeo.com, chatbotscript, or app.robofy.ai.

Note

npm run typecheck was also attempted, but it still fails on existing unrelated repository issues outside this change:

  • publish-externals/src/utils/hashnode.ts missing ../../generated/graphql
  • src/components/playground/Playground.tsx GraphiQL fetcher type mismatch
  • src/theme/SearchBar / src/theme/SearchPage DocSearch and Algolia type errors

@Treasure520520 Treasure520520 force-pushed the bounty/217-home-lighthouse-third-party-deferral branch from 2d8c307 to 2d1a7c9 Compare May 14, 2026 07:39
@Treasure520520
Copy link
Copy Markdown
Author

I pushed an additional performance/privacy hardening commit (2d1a7c9aa) after running a local mobile Lighthouse pass against the built site.

Change:

  • The Robofy chatbot script now only queues after cookie consent is accepted. Previously it still loaded during the Lighthouse measurement window via idle callback, even though the PR had moved other third-party work off the initial path.

Local validation re-run:

  • npm run build
  • npx prettier --check src/components/shared/GlobalLayout.tsx
  • git diff --check
  • Mobile Lighthouse on http://127.0.0.1:3000/ after npm run serve:
    • Performance score: 58 (previous local run before this commit: 37)
    • Total Blocking Time: 150 ms (previous: 1,090 ms)
    • CLS: 0
    • Robofy script present in Lighthouse network requests: false

I am not claiming this local Lighthouse score exactly matches production/CI conditions, but the delta confirms the chatbot script is no longer part of initial mobile page load.

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.

1 participant