Repository navigation
Conversation
The Video facade hard-coded loading="lazy" on its YouTube thumbnail. On /workflows that thumbnail is the mobile LCP element, so LCP waited for layout before the image request even started (lab mobile LCP 4.8-13 s against ~1.1 s on other pages). Add an opt-in priority prop. When set, the thumbnail loads eagerly with fetchpriority="high" (React 19 also hoists a matching image preload into <head>) and the page preconnects to i.ytimg.com. The default stays lazy so videos further down a page don't compete for bandwidth. The img now carries width/height for its intrinsic 480x360 size. Set priority on the three videos that start inside the first screen at 412x823: /workflows and the two AI featured pages. The other four start 911-1568 px down and stay lazy.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📖 Docs PR preview links
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the opt-in video thumbnail priority-loading change.
No open issues 🎉
What changed in this PR
Adds opt-in priority loading to video thumbnails to reduce mobile Largest Contentful Paint delays, while keeping other videos lazy-loaded.
Changes:
- Adds a
priorityprop for eager, high-priority thumbnail loading and a YouTube image-host preconnect. - Sets explicit thumbnail dimensions and enables priority loading on three selected pages.
- Documents when and how to use the new prop.
| File | Description |
|---|---|
src/components/elements/Video/Video.tsx |
Adds priority loading, preconnect, and thumbnail dimensions. |
readme/COMPONENTS.md |
Documents the priority prop and usage guidance. |
docs/encyclopedia/workflow/workflow-overview.mdx |
Prioritizes the Workflow overview video thumbnail. |
docs/ai/featured/memory-state-stripe.mdx |
Prioritizes the Agent Memory & State video thumbnail. |
docs/ai/featured/agent-gateway-nexus.mdx |
Prioritizes the Agent Gateway & Nexus video thumbnail. |
Review effort: Balanced
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an opt-in
priorityprop to theVideocomponent and sets it on the three videos that are visible without scrolling on a phone.The click-to-play facade hard-coded
loading="lazy"on its YouTube thumbnail. A PageSpeed baseline found that on/workflowsthat thumbnail is the mobile LCP element, with lab mobile LCP of 4.8–13 s against ~1.1 s on other pages. A lazy image can't start downloading until layout runs, so the LCP request was delayed. Field p75 LCP for the page is 1.45 s, so the lab overstates it, but a lazy LCP image is a known anti-pattern.With
priority:loading="eager"andfetchpriority="high". React 19 also hoists<link rel="preload" as="image" fetchpriority="high">for it into<head>.https://i.ytimg.com.Without it, the thumbnail stays lazy, so videos further down a page don't compete for bandwidth. The
<img>now haswidth={480} height={360}(the fixed size ofhqdefault.jpg)..aspectBoxstill sizes the rendered image.Which videos got
priorityMeasured with the built site at 412×823, the Lighthouse mobile viewport:
priority/workflows/ai/featured/agent-gateway-nexus/ai/featured/memory-state-stripe/evaluate/why-temporal/activities/production-deployment/worker-deployments/worker-versioning/temporalreadme/COMPONENTS.mddocuments the new prop. The LLM Markdown pipeline ignores it (it reads onlyvideoIdandtitle), andtests/test-mdx-to-md.mjspasses.Verification
yarn buildpasses. Built/workflowsHTML has the eager, high-priority<img>, the preconnect, and the image preload in<head>..vale-ci.ini) is clean on the changed docs pages.