Skip to content

fix(docs): load the player from latest, not a pinned minor - #3320

Merged
miguel-heygen merged 2 commits into
mainfrom
fix-docs-player-pin
Aug 18, 2026
Merged

fix(docs): load the player from latest, not a pinned minor#3320
miguel-heygen merged 2 commits into
mainfrom
fix-docs-player-pin

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

The catalog pages load the player from a CDN. That URL pinned a minor line, and the pin was a line behind: it still asked for 0.7 after the repo moved to 0.8.

Every reference now asks for latest, in the three hand-written files and the 175 generated pages, plus a test that fails if a pin comes back.

Why

The failure mode is the reason this is worth changing rather than bumping.

A stale pin does not break anything visibly. The page renders, the preview plays, the controls work, all on the older build. The only symptom is that a fix published to npm never reaches the docs, which shows up weeks later as "that bug is still there" rather than as a red check. Nobody greps 178 files for a version.

The generator already derived its pin from the player's package.json, which is correct only if every page is regenerated on the release that moves the line. That is the step that did not happen. Getting it right permanently means carrying one version in step across 175 generated pages and three hand-written files, on every minor, forever. latest removes the thing that has to be carried.

What this costs. The docs can no longer be held back from a bad player release. That is real, and it is paid deliberately: the pin did not buy that control either, because it was not being moved on purpose. It only delayed the good releases too. A deliberate hold is still available by pinning again, at which point the test says so out loud instead of the pin rotting quietly.

Timing. jsDelivr serves latest with s-maxage=43200 and max-age=604800, so a newly published player reaches the edge within about twelve hours, and a reader with a warm cache within a week.

How

  • scripts/generate-catalog-pages.ts emits @latest instead of interpolating the player's minor version, and the 175 pages it owns were regenerated.
  • docs/snippets/variables-explorer.jsx, docs/snippets/catalog-overview-player.jsx and docs/catalog/index.mdx are hand-written and were changed directly.
  • scripts/player-cdn-pin.test.ts walks docs, scripts, packages and registry and asserts every player CDN reference asks for latest. It also asserts it found more than a hundred references, so it cannot pass by matching nothing, and it checks the generator's own constant so a regeneration cannot quietly reintroduce a pin across every page.

Test plan

  • Unit tests added/updated

  • Manual testing performed

  • Documentation updated (if applicable)

  • bun run test:scripts: 184 Node tests and 29 catalog Vitest tests passed, up from 182 with the two added here.

  • The new test was confirmed to fail, not just pass: reintroducing @0.7 in one page turns it red and names the file.

  • curl on the latest URL returns 200 with x-jsd-version: 0.8.0, so the URL this ships resolves to a real build rather than a 404 on 178 pages.

  • oxlint and oxfmt clean on the changed sources.

Nothing here changes what a page does once the script loads. The diff is one URL, repeated.

The catalog pages pinned the player CDN URL to a minor line, and that pin
sat one line behind after the last release. Every page kept rendering, on
the older build, so nothing surfaced it: the only symptom was that a fix
published to npm never appeared on the docs.

The generator derived its pin from the player's package.json, which is
correct only if every page is regenerated on the release that moves it.
That is the step that did not happen, and it has to happen across 175
generated pages plus three hand-written files for the pin to be true.

A version carried in step across 178 places will be stale, and stale here
is silent. Ask for latest instead and there is nothing to carry.

This costs the ability to hold the docs back from a bad player release.
Paid deliberately: the pin did not buy that either, it only delayed the
good releases too.

A test asserts no pinned version comes back, and fails if it stops finding
the references at all, so it cannot pass by matching nothing.
@mintlify

mintlify Bot commented Aug 18, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
hyperframes 🟢 Ready View Preview Aug 18, 2026, 12:55 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

The pin guard hand-rolled a recursive directory walk with its own skip
list and size cap, which the audit flagged: helpers living in a test file
earn no coverage, so their complexity lands straight on the CRAP score.

git already knows which files to read, and ignores node_modules and build
output for us, so one call replaces the walker and both findings go away.
@miguel-heygen
miguel-heygen merged commit d7688f9 into main Aug 18, 2026
47 of 53 checks passed
@miguel-heygen
miguel-heygen deleted the fix-docs-player-pin branch August 18, 2026 01:11
@miguel-heygen miguel-heygen mentioned this pull request Aug 18, 2026
3 tasks
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