Skip to content

fix(docsite): prerender the templates gallery - #5940

Merged
cixzhang merged 2 commits into
mainfrom
fix-templates-page-performance
Sep 3, 2026
Merged

fix(docsite): prerender the templates gallery#5940
cixzhang merged 2 commits into
mainfrom
fix-templates-page-performance

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep the /templates gallery in the prerendered static shell by narrowing useSearchParams() to an invisible URL synchronizer
  • link template playground actions by slug, resolve source inside the playground instead of serializing every template's code into gallery HTML, then replace the bootstrap URL with the original canonical /playground#code=… form
  • preserve preview deep links, close/navigation behavior, and native playground links with regression coverage

Measured result

Using the same headless Chromium probe against the current deploy and this production build:

  • gallery heading after response start: ~515 ms → ~19 ms
  • layout shift: 0.258 → 0.005
  • script execution: 690 ms → 546 ms
  • the production build now reports /templates as static, and its initial HTML contains the heading and gallery description

Test plan

  • pnpm lint:strict
  • pnpm -F @astryxdesign/docsite typecheck
  • pnpm -F @astryxdesign/docsite test — 457 passed
  • pnpm -F @astryxdesign/docsite build — 341 static pages, /templates static
  • pnpm vitest run --project node packages/cli — 3,119 passed
  • Playwright production-build flow: card → preview query, close clears query, direct preview deep link, template → playground source handoff

The monolithic pnpm test run hit the repository's known full-load CLI timeout cluster (12 tests); the isolated CLI project above passed all 3,119 tests.

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 2, 2026 10:46pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 2, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Sep 2, 2026
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run completed, but its trusted analysis is unavailable. Preview links are not shown.


Generated by PR Enrichment workflow | View current CI run

@imdreamrunner
imdreamrunner marked this pull request as ready for review September 2, 2026 22:51
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
@cixzhang
cixzhang merged commit 9fa8c66 into main Sep 3, 2026
35 checks passed
josephfarina pushed a commit that referenced this pull request Sep 4, 2026
* fix(docsite): prerender the templates gallery

* fix(docsite): canonicalize template playground URLs
@github-actions
github-actions Bot deleted the fix-templates-page-performance branch September 4, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants