Skip to content

RFC: Once UI 2.0 package architecture (foundations / core / data / nextjs) - #124

Open
lorant-one wants to merge 4 commits into
mainfrom
claude/once-ui-2-architecture-fn89zk
Open

RFC: Once UI 2.0 package architecture (foundations / core / data / nextjs)#124
lorant-one wants to merge 4 commits into
mainfrom
claude/once-ui-2-architecture-fn89zk

Conversation

@lorant-one

@lorant-one lorant-one commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

Two things ride this PR:

  1. rfcs/2026-08-once-ui-2-architecture.md — the library-split RFC scheduled for Week 3 of ROADMAP.md, extended into a full Once UI 2.0 architecture plan per Lorant's direction (foundations split, opt-in data package, optional Next.js, test coverage as a release gate).
  2. Phase 0 groundwork (test infrastructure + one packaging bug fix) — valuable on 1.x regardless of the RFC's go/no-go, and none of it pre-empts the RFC's open decisions.

The RFC

  • @once-ui-system/foundations — tokens + styles (~8,100 lines of SCSS) plus token types; no React, no sass requirement for CSS-only consumers.
  • @once-ui-system/core 2.0 — framework-agnostic React; drops the next peer and recharts dependency.
  • @once-ui-system/data — charts/gauges, owning recharts behind the existing lazy loader.
  • @once-ui-system/nextjs — the 8 Next-coupled files as adapter bindings plus today's ./server utils; core falls back to standard DOM (<a>, <img>, History API) via an adapter provider when Next is absent.
  • Five shippable phases: only the last (2.0.0 peer-dep flip) is breaking. Chirio and magic act as codemod canaries before publish.
  • §9 reconciles with the ROADMAP Week 3 sketch: keeps server isolation, defers the blocks split to 2.x.

Phase 0 groundwork included here

  • Framework-boundary test — pins the next/* import surface to the 8 known files and confines recharts to modules/data, so the coupling the split relies on can't silently grow. (Surfaced that the count was 8, not 7 — Meta.tsx has a type-only next import.)
  • CSS API-surface guard — snapshots the compiled CSS API by name only (722 token custom properties, 1,290 utility classes, 21 theme attribute selectors). Value tweaks pass; renames/removals fail CI until the snapshot is intentionally updated.
  • Fix: dead subpath exports./icons, ./types, ./interfaces pointed at dist/<name>/index.js while the build emits dist/<name>.js; all three were unresolvable for every consumer (including bundlers) since they shipped. Now fixed and guarded by a new exports-integrity test.
  • pnpm check:package — publint + arethetypeswrong wired as an advisory script. It surfaced a significant finding now documented in the RFC (§2 "Packaging reality"): dist is ESM syntax in .js files without "type": "module" and uses extensionless imports, so plain Node cannot load the package at all — it is bundler-only today. Fixing the module format is proposed as a 2.0 build decision (§6), not patched here.
  • Interaction tests for Accordion, Checkbox, Switch (pointer, keyboard, controlled/uncontrolled, disabled). One a11y finding flagged for the Week 5 audit: Switch's keydown handler lives on an inner focusable div with no role or accessible name.
  • Baselines updated in AGENTS.md: 9 suites / 108 tests (was 5 / 92); advisory check:package baseline documented.

Full gate on this branch: build ✓, typecheck 0 errors, 108/108 tests, no new Biome diagnostics.

Next steps

Per the roadmap gate, the RFC itself is a go/no-go decision for Lorant before any split work begins. Open decisions (naming, icons, lockstep versioning, SCSS-source shipping, RSC posture) are listed in §10.

…/nextjs split)

Drafts the Week 3 library-split RFC from verified repo state: extracts
tokens+styles into a framework-agnostic foundations package, moves charts
(recharts) into an opt-in data package, makes Next.js optional via an
adapter provider with DOM fallbacks, and defines a test-first sequencing
plan (package-contract tests, interaction tests, CSS snapshot guard)
across five shippable phases ending in the 2.0 breaking release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H5EsMG3atqKPXbp6xaqwVf
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
core-docs Ignored Ignored Aug 12, 2026 8:18am

claude added 2 commits August 12, 2026 08:10
Pins the next/* import surface to the 8 known files and confines recharts
to modules/data, so the coupling the 2.0 split relies on cannot silently
grow. Snapshots the compiled CSS API (722 token custom properties, 1,290
utility classes, 21 theme attribute selectors) by name only — value tweaks
pass, renames/removals fail CI until intentionally updated. Corrects the
RFC's Next-import inventory from 7 to 8 files (Meta.tsx's type-only
next import, surfaced by the new test).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H5EsMG3atqKPXbp6xaqwVf
…contract checks

The exports map pointed ./icons, ./types and ./interfaces at
dist/<name>/index.js while the build emits dist/<name>.js, leaving all
three subpaths unresolvable for every consumer (incl. bundlers) since
they shipped. Points them at the real files, adds an exports-integrity
test that fails on any exports path the build does not emit, and wires
publint + arethetypeswrong as 'pnpm check:package' (advisory for now:
the packed output is ESM-in-.js without type:module, so plain Node
cannot load the package at all — documented as a 2.0 build decision in
the RFC rather than patched here).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H5EsMG3atqKPXbp6xaqwVf
@lorant-one
lorant-one force-pushed the claude/once-ui-2-architecture-fn89zk branch from 6f678bb to cb3d7b9 Compare August 12, 2026 08:15
…selines

Adds pointer/keyboard/controlled/disabled coverage for Accordion,
Checkbox and Switch (9 tests). Surfaces one a11y finding for the Week 5
audit: Switch's keydown handler sits on an inner focusable div without a
role or accessible name, separate from the role=switch element. Updates
AGENTS.md's do-not-regress inventory to the new 9-suite/108-test
baseline and documents the advisory check:package baseline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H5EsMG3atqKPXbp6xaqwVf
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