mirror of
https://github.com/joelhooks/joelclaw.git
synced 2026-09-19 01:24:04 +08:00
1.7 KiB
1.7 KiB
Static Shell Continuation (apps/web)
Current state
- Build path is standard Next.js:
build: next build --webpackinapps/web/package.json
- Cache Components are fully enabled:
cacheComponents: trueinapps/web/next.config.js
- Public shells remain static; dynamic/runtime behavior is isolated with explicit Suspense seams.
Hard rules for this repo
- No
connection()usage. - Keep static shells deterministic:
- no
Date.now() - no
new Date()in server static render paths - no request-bound reads (
cookies(),headers()) in static shells
- no
- If personalization is needed, use a dynamic hole:
- dynamic entry component
- static shell renderer
- explicit slot props wrapped with
Suspense
- Keep client provider islands local to interactive features.
Static shell guidance tied to current code
- Global shells (
app/layout.tsxand shared nav/footer surfaces) should only consume static constants. - Relative or "now-based" time UI belongs in client-only components and should render deterministic server fallbacks.
app/network/page.tsxmust stay offline-safe for build:- remote failures return empty collections, not build failures.
Link prefetch policy
- Keep default prefetch for stable static routes.
- Use
prefetch={false}for volatile/personalized URLs (query-heavy user paths).
Ongoing checklist
- Keep MDX rendering in Suspense-backed dynamic holes when library internals depend on wall-clock/random APIs.
- Keep Convex provider scope narrow to routes that require Convex hooks.
- Keep root layout free from request/user-specific reads unless isolated behind Suspense.
- Verify with:
pnpm --filter web build