Skip to content

feat(web): TanStack Start app skeleton with SSR and gate wiring#27

Open
ByteMeBaby wants to merge 1 commit into
mainfrom
feat/web-skeleton
Open

feat(web): TanStack Start app skeleton with SSR and gate wiring#27
ByteMeBaby wants to merge 1 commit into
mainfrom
feat/web-skeleton

Conversation

@ByteMeBaby

Copy link
Copy Markdown
Owner

What

Stands up apps/web as a TanStack Start (React) app that server-renders a placeholder home page and hydrates it on the client, replacing the prior library-style stub. It is the booting frontend shell; later chunks attach the UI kit, a typed API client, theming, and auth to the same app.

Changes

  • Routing: file-based routes under apps/web/src/routes; the root route renders the document shell and owns the top-level error boundary and 404. Page components live outside route files (so routes stay code-split); the / route registers HomePage from src/components.
  • Generated route tree: src/routeTree.gen.ts is generated and gitignored — the Start plugin regenerates it on vite build, and tsr generate runs before typecheck. Never committed; rebuilds from a clean checkout.
  • Gate adaptation for a Vite app: vite build produces dist/client + dist/server; Vitest runs on jsdom with Testing Library; web-specific tsconfig overrides (jsx, DOM libs, bundler resolution).
  • Lint: the shared ESLint config now matches .tsx, so no-explicit-any and @forgekit/dependency-flow apply to React files.
  • Dependency edge: the home page renders UI_VERSION from @forgekit/ui (the only internal import web is allowed), keeping the Turborepo build edge real.
  • Doc: docs/web/app-skeleton.md.

Verification

  • All four gates green from a clean checkout with cache forced off (build, lint, typecheck, test).
  • Route tree regenerates from a deleted state — no reliance on a committed generated file.
  • Booted in headless Chromium: SSR renders the placeholder and the client hydrates cleanly — 0 console errors, 0 hydration mismatches, client module graph loads.
  • dist/server is not nested under the client's served directory.

Deferred (intentional)

  • react-hooks ESLint plugin lands with the next chunk's first hook — no hooks exist yet, and enforcement travels with the code it guards.
  • tsconfig layout left as-is to keep parity with sibling packages.

Stand up apps/web as a TanStack Start (React) application that server-renders a placeholder home page and hydrates it on the client, replacing the prior library-style stub. This is the booting frontend shell that later chunks attach UI, a typed API client, theming, and auth to.

- File-based routing with a generated, gitignored route tree, regenerated by the Start plugin on build and by tsr generate for typecheck; never committed.
- Root route renders the document shell and owns the top-level error boundary and 404; page components live outside route files so they stay code-split.
- Adapt the workspace gates to a Vite app: vite build (dist/client + dist/server), jsdom Vitest with Testing Library, and web-specific tsconfig overrides (jsx, DOM libs, bundler resolution).
- Extend the shared ESLint config to lint .tsx so no-explicit-any and dependency-flow apply to React files.
- Keep a real @forgekit/ui import (UI_VERSION) so the web to ui build edge stays honest.

Doc: docs/web/app-skeleton.md.
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