Skip to content

refactor(renderers): collapse React and Vue onto @layoutit/polycss/runtime with perf and lifecycle gates - #93

Merged
alowpoly merged 9 commits into
mainfrom
single-renderer-runtime
Dec 3, 2026
Merged

alowpoly merged 9 commits into
mainfrom
single-renderer-runtime

Conversation

@alowpoly

@alowpoly alowpoly commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Single DOM renderer (@layoutit/polycss/runtime): Added side-effect-free @layoutit/polycss/runtime and Adopt-DOM seams (elements, wrapper, bakedLightPolicy, autoCenterSource, groundShadowFallback, atomicAtlas, onFrameReady, per-mesh render overrides, excludeFromAutoCenter) to @layoutit/polycss.
  • Thin React & Vue Adopt-DOM bindings: Collapsed @layoutit/polycss-react and @layoutit/polycss-vue onto @layoutit/polycss/runtime (-15,500+ lines of duplicated atlas/voxel/shadow/style/controls code deleted; check-boundaries.mjs enforces @layoutit/polycss/runtime-only imports from @layoutit/polycss; check-mirrors.mjs shrunk to 12 React↔Vue sets).
  • Hard fail-closed CI gates:
    • Visual gate (bench/visual-gate.mjs): Tightened all 14 cross-renderer parity cases (Vanilla/HTML/React/Vue) to threshold: 0, includeAA: true, 0 px mismatch on Chromium + Firefox.
    • Perf gate (bench/perf-gate.mjs + perf-gate CI job): Fail-closed A/B perf gate verifying active motion, 0 per-frame childList and descendant attribute mutations, exact leaf counts, no non-bucket DOM/style/<s>/layout regressions, and paired p50/p95/JS-per-frame/bimodal budgets on Chromium (also fixed a pre-existing frozen-camera bug in bench/perf-vanilla.html caught by the new motion check).
    • Lifecycle gate (bench/lifecycle-gate.mjs + lifecycle-gate CI job): Fail-closed pure Node SSR (React + Vue renderToString with zero DOM globals) and real Chromium dev-mode React <StrictMode> + post-mount state-transition gate (3x rebake, directionalLight/strategies clearing to undefined, textureQuality updates, real .vox class updates + rebake, stable-topology per-mesh overrides, dynamic shadow emit + receiveShadow toggle, real .obj Vue async src single-mount, and controls interaction).

Verification

  • pnpm verify — passed (155 script tests, all package unit tests, builds, typecheck, 3-way IR conformance, 7 packs, 6 bench bundles, 4 examples).
  • pnpm test:coverage — passed across all 8 workspace packages.
  • pnpm --filter @layoutit/polycss-website verify:domformat & pnpm build:website — 304 models (199,847 leaves), 23 static pages built.
  • pnpm bench:gate:ci -- --base-ref origin/main --browsers chromium,firefox --software-backend --no-sandbox — 55/55 pass (23 strict + 28 cross-renderer parity at 0 px, threshold: 0, includeAA: true).
  • pnpm bench:gate:perf -- --base-ref origin/main --software-backend --no-sandbox — 9/9 pass (0 childList and 0 descendant mutations; React dyn-light p50 41.8 ms → 24.75 ms, JS/f 15.69 ms → 0.28 ms; Vue dyn-light p50 49.9 ms → 24.9 ms, mutations 10,532 → 0).
  • pnpm bench:gate:lifecycle -- --software-backend --no-sandbox — 13/13 pass.

@alowpoly
alowpoly merged commit 9843cc8 into main Dec 3, 2026
5 of 6 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.

1 participant