Skip to content

Docs + DX: zero-runtime-first positioning and scopeId collision guardrails (P3.5.1, P3.5.2)#102

Merged
dbanksdesign merged 2 commits into
mainfrom
p3.5.1-p3.5.2-zero-runtime-first-and-collision-guardrails
Jun 17, 2026
Merged

Docs + DX: zero-runtime-first positioning and scopeId collision guardrails (P3.5.1, P3.5.2)#102
dbanksdesign merged 2 commits into
mainfrom
p3.5.1-p3.5.2-zero-runtime-first-and-collision-guardrails

Conversation

@dbanksdesign

Copy link
Copy Markdown
Collaborator

Summary

  • P3.5.1 — Zero-runtime-first docs: Restructures the getting-started guide, landing page, and sidebar navigation so build extraction is the primary story, not runtime injection. An evaluator's first impression is now "zero-runtime in production" rather than "another runtime CSS-in-JS library."
  • P3.5.2 — scopeId collision guardrails: Adds a dev-mode console.warn when styles.component() registers the same namespace twice without a scopeId. Documents scope isolation best practices for apps, published packages, and per-file isolation.

Docs changes (P3.5.1)

  • Getting started: Installs @typestyles/vite by default, shows Vite plugin setup and convention entry before the first style example, explains the dev/prod runtime split
  • Landing page: Hero sample uses createTypeStyles({ scopeId }), benefit card chore: version packages #3 rewritten from "lean output" to "static CSS in production"
  • Navigation: Promotes "Zero-runtime extraction" and "Vite Plugin" from Advanced Features into Getting Started section
  • Next steps table: Leads with zero-runtime extraction
  • Best practices: New "Scope isolation" section with guidance for apps, packages, and fileScopeId
  • Component library guide: Adds required scopeId section for published packages

Code changes (P3.5.2)

  • registry.ts: New warnUnscopedCollision() emits once per namespace when the same unscoped namespace is registered more than once
  • component.ts: Calls warnUnscopedCollision in claimComponentNamespace when no scopeId is set
  • 3 new tests covering: warning fires on collision, no false positive with scoped HMR, warning emits only once per namespace

Test plan

  • pnpm --filter typestyles test — 334 tests pass (including 3 new)
  • pnpm --filter typestyles typecheck — clean
  • Verify docs site builds and renders updated navigation/content correctly
  • Verify warning appears in browser console when two unscoped components share a namespace

🤖 Generated with Claude Code

dbanksdesign and others added 2 commits June 17, 2026 14:51
…P3.5.1, P3.5.2)

Restructure docs to lead with build extraction as the primary production
story, and add dev-mode warnings for unscoped namespace collisions.

P3.5.1 — Getting-started now installs the Vite plugin by default, shows
the convention entry setup, and explains the dev/prod split. Landing page
hero uses createTypeStyles with scopeId. Navigation promotes zero-runtime
and Vite plugin into the Getting Started section. Next steps table leads
with zero-runtime extraction.

P3.5.2 — warnUnscopedCollision() in registry.ts emits a one-time
console.warn when styles.component() registers the same namespace twice
without a scopeId. Best-practices adds a scope isolation section with
guidance for apps, packages, and per-file isolation. Component-library
guide now requires scopeId for published packages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dbanksdesign dbanksdesign merged commit a984b6b into main Jun 17, 2026
6 checks passed
@dbanksdesign dbanksdesign deleted the p3.5.1-p3.5.2-zero-runtime-first-and-collision-guardrails branch June 17, 2026 22:12
@github-actions github-actions Bot mentioned this pull request Jul 4, 2026
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