Skip to content

chore(playground): replace Astro with Vite + React#20

Closed
arzafran wants to merge 2 commits into
mainfrom
chore/vite-playground
Closed

chore(playground): replace Astro with Vite + React#20
arzafran wants to merge 2 commits into
mainfrom
chore/vite-playground

Conversation

@arzafran

Copy link
Copy Markdown
Member

What this does

Replaces the Astro playground with a minimal Vite + React multi-page app. The Astro toolchain was the repo's entire dependency and staleness surface — hundreds of transitive packages (language server, vite, esbuild, sharp, shiki, …) to render 4 demo pages, and the origin of every Dependabot advisory. The published tempus package (zero runtime deps, 1.98 kB gzipped) is completely unaffected; the playground is dev-only and not published.

This is why we closed the astro-upgrade PRs (#12/#14/#16) — rather than chase astro majors, we remove it. Mirrors darkroomengineering/hamo#14.

Result

  • Lockfile: 629 → 264 packages (−365, ~58%). astro and all @astrojs/* gone.
  • Same demos, all building and serving: index, core (vanilla TS + profiler), landing (the full hero prototype), react.

Summary

  • vite.config.ts: MPA inputs (4 HTML entries) + @vitejs/plugin-react, preserving the tempus / tempus/react / tempus/profiler source aliases so local dev still HMRs against packages/ source (validates the published entry points).
  • index/core/react/landing.html replicate the old layout nav + per-page markup; landing.html ports the full hero prototype (its 4 driven element IDs — load, metro-arm, scope, toggle — verified against hero.ts).
  • react/main.tsx mounts <App/>; app.tsx now renders frame state (it was a no-render placeholder, which tsc correctly rejects as a JSX component — Astro's client:only never type-checked that).
  • Dropped astro, @astrojs/react, @astrojs/check, astro.config.mjs, www/*.astro, core/browser.js.
  • Moved lottie-web + motion from root devDeps into the playground (only core/test.ts uses them) — folds in chore: move playground-only deps out of root #18.

Test Plan

  • pnpm build (library) succeeds
  • pnpm --filter playground build green — tsc --noEmit + vite build, all 4 pages
  • pnpm dev:playground serves all 4 pages (200) with source aliases resolving
  • landing.html retains the DOM elements hero.ts drives

Closes #19. Supersedes #18.

The Astro playground was the repo's entire dependency/staleness surface:
~365 of the lockfile's packages came from astro + @astrojs/* (language
server, vite, esbuild, sharp, shiki, …) to render 4 demo pages, and every
Dependabot advisory originated there. The published library is untouched
(zero runtime deps, not affected by playground tooling).

Replace it with a minimal Vite multi-page app:
- vite.config.ts: MPA (index/core/react/landing) + @vitejs/plugin-react,
  preserving the tempus / tempus/react / tempus/profiler source aliases so
  local dev still HMRs against packages/ source.
- index/core/react/landing .html entries replicating the old layout nav +
  per-page markup (landing.html ports the full hero prototype).
- react/main.tsx mounts <App/>; app.tsx now renders frame state.
- drop astro, @astrojs/react, @astrojs/check, astro.config.mjs, www/*.astro,
  core/browser.js.
- move lottie-web + motion from root devDeps into the playground (folds #18).

Lockfile: 629 -> 264 packages (-365). astro/@astrojs fully gone.
Closes #19.
@arzafran arzafran force-pushed the chore/vite-playground branch from 302258a to 5e356cb Compare June 19, 2026 21:06
After removing Astro, the remaining 10 advisories were all transitive
under tsup (the library's build tool, a dev dependency): glob, minimatch,
rollup, picomatch, esbuild, brace-expansion.

- bump tsup 8.3.6 → 8.5.1
- pnpm.overrides pin patched versions of the transitive leaves

`pnpm audit` now reports 0. The published library has zero runtime deps,
so none of these ever reached consumers; this only cleans the dev tree and
the Dependabot dashboard. Verified: library + playground build green, core
bundle byte-identical (1985 B gz).
@arzafran

Copy link
Copy Markdown
Member Author

Consolidated into #22. We're keeping the Astro playground for v1 (bringing it back rather than replacing it with Vite), so this rewrite is superseded. #22 is the single PR to review: bun + biome toolchain, Astro pages unchanged.

@arzafran arzafran closed this Jun 22, 2026
@arzafran arzafran deleted the chore/vite-playground branch June 22, 2026 12:05
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.

Replace Astro playground with Vite + React (cut the astro staleness surface)

1 participant