Skip to content

feat(ssr): add Next shared CSS output - #287

Merged
tenphi merged 2 commits into
mainfrom
codex/next-shared-css
Aug 28, 2026
Merged

feat(ssr): add Next shared CSS output#287
tenphi merged 2 commits into
mainfrom
codex/next-shared-css

Conversation

@tenphi

@tenphi tenphi commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • add withTastyNext() at @tenphi/tasty/ssr/next-config
  • emit eager configured globals to one content-hashed shared stylesheet
  • keep component rules and all route-specific hook artifacts in the streaming TastyRegistry path
  • add immutable caching for Next server deployments while preserving static-export compatibility
  • preserve basePath, existing env/headers, monorepo roots, CSP nonces, and safe CSS URL semantics

Shared vs route-specific

The shared file contains built-in/custom @property, tokens and presets, @font-face, @counter-style, native @function, and configured globalStyles.

Component chunks plus route calls to useGlobalStyles, useRawCSS, useKeyframes, useProperty, useFontFace, useCounterStyle, and useFunction remain route-specific. Configured keyframes stay lazy.

Verification

  • production Next.js 16.2.7 App Router build with Turbopack
  • direct / and /about loads: exactly one shared link plus the correct route CSS
  • Home → About client navigation: shared link retained; only newly needed route CSS/keyframes injected
  • computed tokens, global body styles, component styles, and animation verified in Chromium
  • generated asset returned Cache-Control: public, max-age=31536000, immutable
  • pnpm typecheck
  • pnpm lint
  • pnpm format:check
  • pnpm build
  • pnpm check:test-only
  • pnpm knip
  • pnpm test (2,204 tests)
  • pnpm size

Includes a minor changeset.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

📦 Snapshot release

Published 0.0.0-snapshot.5ee6468.

pnpm add @tenphi/tasty@0.0.0-snapshot.5ee6468

Comment thread src/ssr/next-config.ts Fixed
@tenphi
tenphi merged commit 3a7be8c into main Aug 28, 2026
6 of 7 checks passed
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