Skip to content

fix(docs): keep showcase pages working without the share API - #1937

Open
ulivz wants to merge 1 commit into
mainfrom
fix/showcase-static-snapshot
Open

fix(docs): keep showcase pages working without the share API#1937
ulivz wants to merge 1 commit into
mainfrom
fix/showcase-static-snapshot

Conversation

@ulivz

@ulivz ulivz commented Aug 1, 2026

Copy link
Copy Markdown
Member

Problem

/showcase, /showcase/:slug and /replay/:id resolved every record through the
external share Worker — build time for the list, runtime for detail and replay.
Any Worker outage blanks the list and breaks every detail page, since those fetch on
each visit.

Change

Ship the 17 public shares as a committed snapshot (src/data/showcaseShares.ts) and
resolve list / sessionId / slug lookups from it. The build-time fetch plugin and the
now-unused share API client are removed. pnpm refresh:showcase-data regenerates the
snapshot on demand — manual and best-effort by design: a stale snapshot beats a site
that needs the API to be up.

Verification

Blackholed the Worker host (hosts entry, proxy bypassed, so requests fail at connect)
and rebuilt:

before after
/showcase 0 cards 17 cards; pills All(17) AI Browser(4) CodeAct(4) Research(4) AI Coding(3) MCP(1) General(1)
/showcase/analyze-google-network-request-ea86c5 Failed to Load Shared Content / Failed to fetch title, author, tags and replay iframe all render
/replay/neo-brutalism-poster-agent-bfa30c Error Loading Replay renders
requests to the Worker one per route 0

The snapshot matches the live API field for field (17/17, values verbatim — url and
imageUrl keep their scheme-less form so ensureHttps still applies). The build output
contains no reference to the Worker host.

Incidental fix: extractIdFromPath tells slugs and sessionIds apart by looking for a
dash, so the two sessionIds that contain one (D7wFqLQ-3eFFhxFxvlgjW,
PNVJooGmZiJHpD6-5Zsfk) always 404'd on direct links. Lookups now match either field.

Out of scope

  • Replay HTML and cover images still load from lf3-static.bytednsdoc.com; only the
    metadata is vendored.
  • /zh/showcase/<slug> still 404s — theme/index.tsx and netlify.toml only handle
    the unprefixed /showcase and /replay routes. Pre-existing.

Showcase list, detail and replay pages resolved every record through an
external Cloudflare Worker — at build time for the list and at runtime for
detail/replay — so any Worker outage blanked the list and broke every
detail page. Ship the 17 public shares as a committed snapshot instead, so
all three routes render from the bundle and need no network at all.

The read API client and the build-time fetch plugin have no callers left
and are removed; `pnpm refresh:showcase-data` regenerates the snapshot on
demand.
@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for tarko ready!

Name Link
🔨 Latest commit 6b07186
🔍 Latest deploy log https://app.netlify.com/projects/tarko/deploys/6a6e5752d8ef7f0008db56d9
😎 Deploy Preview https://deploy-preview-1937--tarko.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit 6b07186
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/6a6e57514382400008f41db8
😎 Deploy Preview https://deploy-preview-1937--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

const tempFile = `${targetFile}.tmp`;
try {
mkdirSync(path.dirname(targetFile), { recursive: true });
writeFileSync(tempFile, source, 'utf8');
@ulivz
ulivz requested a review from ycjcl868 August 1, 2026 20:33
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.

2 participants