Repository navigation
Add @taffyjs/yoga compatibility package - #9
Merged
Merged
Conversation
hyfdev
force-pushed
the
agent/node-yoga-design
branch
from
August 15, 2026 15:41
007bc33 to
3c221d8
Compare
This was referenced Aug 15, 2026
hyfdev
force-pushed
the
agent/node-yoga-design
branch
from
August 16, 2026 11:51
3c221d8 to
5cda76b
Compare
hyfdev
force-pushed
the
agent/node-yoga-design
branch
from
August 16, 2026 11:58
5cda76b to
aed21c4
Compare
Document Yoga evolution policy
Clarify Yoga Align migration boundary
There was a problem hiding this comment.
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 itsdist/outputs. - Add
tests/taffyjs-yogaworkspace with differential/oracle tests plus ad.tspublic-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; |
| 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@taffyjs/yogacompatibility decisions and the Yoga 3.2.1 API/behavior reference@taffyjs/noderuntime architecture, repository changes, six implementation milestones, and verification gatesWhy
The implementation needs a stable boundary before the compatibility facade is built: no Taffy/core or
@taffyjs/nodechanges, 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 existingyoga-layoutimports.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:formatgit diff --check