Skip to content

Add @taffyjs/yoga compatibility package - #9

Merged
hyfdev merged 20 commits into
mainfrom
agent/node-yoga-design
Aug 16, 2026
Merged

hyfdev merged 20 commits into
mainfrom
agent/node-yoga-design

Conversation

@hyfdev

@hyfdev hyfdev commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • record the accepted @taffyjs/yoga compatibility decisions and the Yoga 3.2.1 API/behavior reference
  • define the TypeScript-over-@taffyjs/node runtime architecture, repository changes, six implementation milestones, and verification gates
  • add the PCR-required unattended-run goal and status files so later implementation can proceed milestone by milestone on this draft PR

Why

The implementation needs a stable boundary before the compatibility facade is built: no Taffy/core or @taffyjs/node changes, no JavaScript Flex implementation, explicit Compatible/Different/Unsupported behavior, and one reviewed observable commit per milestone. The plan also accounts for Vite+ multi-entry shared chunks, pre-commit versus post-commit failure ownership, and the package-manager alias that preserves existing yoga-layout imports.

This PR is intentionally a draft. Milestone 0 contains documentation only. The unattended implementation must not start until Yunfei vouches the exact .agents/docs/loop-goal.md; Milestones 1–6 will then be committed and pushed here after their individual adversarial reviews.

Checks

  • vp run check:format
  • local Markdown link resolution check
  • git diff --check
  • independent adversarial review plus one targeted follow-up; all material findings were incorporated and the final untracked-output freshness correction was verified against the repository's existing intent-to-add pattern

@hyfdev
hyfdev force-pushed the agent/node-yoga-design branch from 5cda76b to aed21c4 Compare August 16, 2026 11:58
@hyfdev
hyfdev marked this pull request as ready for review August 16, 2026 12:10
Copilot AI lite review requested due to automatic review settings August 16, 2026 12:10
@hyfdev
hyfdev merged commit eaf2384 into main Aug 16, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Yoga 3.2.1 compatibility layer to the monorepo (@taffyjs/yoga) implemented in TypeScript over @taffyjs/node, along with a dedicated integration-test workspace and supporting CI/task-graph/docs updates.

Changes:

  • Introduce packages/taffyjs-yoga (ESM-only Yoga facade, translation/projection/measurement logic, compatibility docs) and commit its dist/ outputs.
  • Add tests/taffyjs-yoga workspace with differential/oracle tests plus a d.ts public-API surface check.
  • Wire new build/test tasks into the root Vite+ task graph and update CI/docs (PCR decisions, architecture, tooling notes).

Reviewed changes

Copilot reviewed 39 out of 47 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vite.config.ts Adds yoga build + test tasks and ignores yoga dist for fmt/lint.
tests/taffyjs-yoga/vite.config.ts Vite+ config for yoga integration test workspace.
tests/taffyjs-yoga/tsconfig.json TypeScript config for yoga integration tests.
tests/taffyjs-yoga/package.json Defines yoga integration test workspace (name/scripts/deps).
tests/taffyjs-yoga/layout.test.mts Basic layout parity smoke test vs oracle.
tests/taffyjs-yoga/config.test.mts Config API/state and rejection behavior tests.
tests/taffyjs-yoga/exports.test.mts Export surface parity tests vs oracle (enums/constants/types).
tests/taffyjs-yoga/topology.test.mts Topology/ownership/mutation/lifetime tests.
tests/taffyjs-yoga/style.test.mts Style getter/setter roundtrip + normalization tests vs oracle.
tests/taffyjs-yoga/state.test.mts Dirty/new-layout/public-state transition tests.
tests/taffyjs-yoga/measurement.test.mts Measure callback mapping/normalization/retry behavior tests.
tests/taffyjs-yoga/lifecycle.test.mts free/freeRecursive/reset/destroy behavior tests.
tests/taffyjs-yoga/differences.test.mts Regression fixtures for documented “Different” behaviors.
tests/taffyjs-yoga/fixtures/measure-path-profile.mjs Fixture to assert which native compute path was taken.
tests/taffyjs-yoga/types/tsconfig.json Typecheck-only config for d.ts surface assertions.
tests/taffyjs-yoga/types/public-api.test-d.ts Type-level assertions for public API compatibility constraints.
pnpm-lock.yaml Adds lock entries for new yoga package + tests workspace deps.
packages/taffyjs-yoga/package.json New @taffyjs/yoga package metadata + exports/engines/scripts.
packages/taffyjs-yoga/README.md Usage and compatibility/migration guidance for the facade.
packages/taffyjs-yoga/COMPATIBILITY.md Declares Compatible/Different/Unsupported boundaries + WIP notes.
packages/taffyjs-yoga/THIRD_PARTY_NOTICES.md Third-party notice for ported PixelGrid logic.
packages/taffyjs-yoga/vite.config.ts Vite+ pack config for yoga (multi-entry, dts, clean dist).
packages/taffyjs-yoga/tsconfig.json TypeScript config for yoga package source.
packages/taffyjs-yoga/src/index.ts Root entry: eager default facade + re-exports.
packages/taffyjs-yoga/src/load.ts /load entry: async factory + re-exports.
packages/taffyjs-yoga/src/enums.ts Yoga-shaped enums + legacy constant map.
packages/taffyjs-yoga/src/types.ts Public TS surface types (Node/Config/Value/etc).
packages/taffyjs-yoga/src/declarations.ts Internal declaration storage + edge/gutter resolution helpers.
packages/taffyjs-yoga/src/values.ts Value normalization, conversion to @taffyjs/node inputs.
packages/taffyjs-yoga/src/translate.ts Style translation and calculation-time overrides mapping to Taffy.
packages/taffyjs-yoga/src/projection.ts Projects Taffy output into Yoga-shaped computed output + rounding.
packages/taffyjs-yoga/src/measurement.ts Bridges Taffy measurement calls into Yoga measure callback semantics.
packages/taffyjs-yoga/dist/index.js Committed built JS for root entry.
packages/taffyjs-yoga/dist/index.d.ts Committed built typings for root entry.
packages/taffyjs-yoga/dist/load.js Committed built JS for /load entry.
packages/taffyjs-yoga/dist/load.d.ts Committed built typings for /load entry.
packages/taffyjs-yoga/dist/types-CQnSOAjF.d.ts Committed rolled-up type chunk from the build.
.github/workflows/ci.yml Extends “committed outputs freshness” check to include yoga dist.
.agents/docs/README.md Adds index links for yoga decisions + reference docs.
.agents/docs/taffyjs-yoga-decisions.md New PCR decision ledger for yoga compatibility.
.agents/docs/technology-stack.md Documents yoga’s build/output handling and CI freshness approach.
.agents/docs/architecture.md Updates architecture to include yoga package + tests workspace.
.agents/docs/intent.md Updates intent to reflect yoga as an actual package (not hypothetical).
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@@ -0,0 +1,20 @@
{
"name": "@taffyjs/yoga-integration-tests",
Comment on lines +31 to +35
import { createYoga } from "./facade.js";

const Yoga = createYoga();

export default Yoga;
Comment thread vite.config.ts
dependsOn: ["build"],
},
"check:test:yoga": {
command: "vp run @taffyjs/yoga-integration-tests#test",
hyfdev added a commit that referenced this pull request Aug 16, 2026
hyfdev added a commit that referenced this pull request Aug 16, 2026
Add the Yoga-compatible facade backed by the native Taffy runtime and cover its runtime boundary.

Refs: #9, #12, #14, #28
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