Skip to content

fix(site): keep the browse page's hero out of the products bundle - #62491

Merged
thdxr merged 1 commit into
devfrom
site-browse-hero-budget
Nov 7, 2026
Merged

thdxr merged 1 commit into
devfrom
site-browse-hero-budget

Conversation

@thdxr

@thdxr thdxr commented Nov 7, 2026

Copy link
Copy Markdown
Member

#62487 made ProductHero import prefersReducedMotion and rescueMedia from products.tsx and pageScheme from videos.ts, which pulled the whole products bundle into /product/browse. The page went to 116.9 kB against its 99 kB budget, so deploy-site fails on check-client-bundle.

  • prefersReducedMotion, rescueMedia and pageScheme move to media.tsx, and heroStills moves to product-hero.tsx. Callers import them from there.
  • Browse is now 105 kB: the hero (2.6 kB) plus media.tsx with the stills manifest (3.9 kB), which the hero needs for its AVIF and WebP copies. Its budget goes from 99 to 106, measured plus a kB, as the comment there asks. The product pages stay at 126.2 kB.

Full bun run build passes locally.

No flag needed. This fixes the build.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none"><style>.b{animation:s 3s ease-in-out infinite;transform-origin:40px 60px}@keyframes s{0%,20%{transform:scaleY(1)}60%,100%{transform:scaleY(.62)}}@media (prefers-reduced-motion:reduce){.b{animation:none;transform:scaleY(.62)}}</style><line x1="20" y1="20" x2="220" y2="20" stroke="currentColor" stroke-opacity=".35" stroke-dasharray="4 4"/><rect class="b" x="28" y="12" width="24" height="48" rx="3" fill="currentColor" fill-opacity=".6"/><rect x="64" y="28" width="24" height="32" rx="3" fill="currentColor" fill-opacity=".3"/><rect x="100" y="24" width="24" height="36" rx="3" fill="currentColor" fill-opacity=".3"/><rect x="136" y="30" width="24" height="30" rx="3" fill="currentColor" fill-opacity=".3"/><rect x="172" y="22" width="24" height="38" rx="3" fill="currentColor" fill-opacity=".3"/></svg>

@thdxr
thdxr merged commit 7b8e93a into dev Nov 7, 2026
12 checks passed
@thdxr
thdxr deleted the site-browse-hero-budget branch November 7, 2026 02:18

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bundle check fails on the base and passes with this change. I ran vite build and check-client-bundle.ts in both checkouts. On the base, /product/browse measures 115.3 kB against its 99 kB budget, and the check fails. With this change it measures 103.4 kB against the new 106 kB budget and the check passes. The product pages measure 124.6 kB. The site's tests (192 pass) and tsc are clean, and no importers of the moved helpers' old locations are left.

The public API is unchanged: this only moves internal site helpers between modules.

No concerns.

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