Repository navigation
Add @taffyjs/yoga-wasm package - #27
Merged
Merged
Conversation
hyfdev
force-pushed
the
agent/yoga-wasm-research
branch
from
August 16, 2026 13:15
df81a8e to
6e1a199
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a new @taffyjs/yoga-wasm package that reuses the existing @taffyjs/yoga TypeScript facade while redirecting the backend from @taffyjs/node to @taffyjs/wasm, and expands the CI/task graph and test suites to validate behavior, package contents, consumer installation, bundler selection, and real Chromium execution.
Changes:
- Add
packages/taffyjs-yoga-wasmwith Vite+ build-time backend redirection and documentation/licensing. - Expand Yoga compatibility and Wasm validation coverage (behavior diffs, percentage parsing cases, packed-consumer + browser bundle/runtime checks).
- Stop committing Yoga build outputs (
dist/), update CI/task orchestration, and refresh/extend Project Context Records.
Reviewed changes
Copilot reviewed 37 out of 46 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Updates task graph: renames Yoga test workspace target, adds Yoga-Wasm checks, and adjusts build/check ordering and ignores. |
| tests/taffyjs-yoga/yoga-layout-source.d.ts | Adds ambient module declarations to map yoga-layout specifiers to test-only source entries. |
| tests/taffyjs-yoga/vite.config.ts | Adds Vite resolve aliases to run runtime tests against built Yoga dist entries; updates lint ignores. |
| tests/taffyjs-yoga/types/public-api.test-d.ts | Extends public API type assertions, including new percentage-string literal cases. |
| tests/taffyjs-yoga/tsconfig.json | Adds TS paths mappings to Yoga source and includes the new ambient declaration file. |
| tests/taffyjs-yoga/style.test.mts | Expands numeric/percentage boundary fixture set to include whitespace and non-decimal numeric forms. |
| tests/taffyjs-yoga/package.json | Renames the Yoga integration test workspace package. |
| tests/taffyjs-yoga/measurement.test.mts | Renames a test to be backend-neutral (native → backend). |
| tests/taffyjs-yoga/fixtures/measure-path-profile.mjs | Makes backend and Yoga entry specifiers injectable via env vars for reuse in wasm runs. |
| tests/taffyjs-yoga/differences.test.mts | Adds new “Different” regression fixtures (partial shrink when total < 1; percentage gap in auto-sized container) and imports Gutter. |
| tests/taffyjs-yoga-wasm/vite.config.ts | New: config to rerun Yoga tests against wasm backend via aliases and env-injected entry URLs. |
| tests/taffyjs-yoga-wasm/tsconfig.public-api.json | New: public API typecheck against @taffyjs/yoga-wasm declaration outputs. |
| tests/taffyjs-yoga-wasm/tsconfig.json | New: TS config for the Yoga-Wasm test workspace. |
| tests/taffyjs-yoga-wasm/tests/packed-consumer.ts | New: packs tarballs, installs via npm/pnpm, validates Node and Chromium behavior and lazy /load compilation boundary. |
| tests/taffyjs-yoga-wasm/tests/package-contents.ts | New: validates packed file set, backend imports, no embedded wasm payload, and no stray .d.ts emission into shared Yoga source. |
| tests/taffyjs-yoga-wasm/package.json | New: scripts and deps for Yoga-Wasm test workspace (including Playwright). |
| tests/taffyjs-wasm/tests/packed-consumer.ts | Ensures consumer install has a minimal package.json (module context) before running eval program. |
| README.md | Promotes @taffyjs/yoga-wasm from WIP and links Yoga/Yoga-Wasm docs and compatibility boundary. |
| pnpm-lock.yaml | Adds lock entries for the new packages/taffyjs-yoga-wasm and tests/taffyjs-yoga-wasm workspaces. |
| packages/taffyjs-yoga/THIRD-PARTY-LICENSES | Renames/standardizes third-party license bundle file naming. |
| packages/taffyjs-yoga/src/values.ts | Expands accepted percentage string syntax (whitespace + hex/binary/octal) and refines numeric parsing checks. |
| packages/taffyjs-yoga/src/projection.ts | Updates the third-party license reference path in the PixelGrid attribution comment. |
| packages/taffyjs-yoga/src/load.ts | Makes loadYoga() genuinely lazy by dynamically importing createYoga from the facade. |
| packages/taffyjs-yoga/README.md | Updates third-party license reference to the standardized filename. |
| packages/taffyjs-yoga/package.json | Updates published files list to include THIRD-PARTY-LICENSES instead of the prior notice filename. |
| packages/taffyjs-yoga/dist/types-CQnSOAjF.d.ts | Removes committed Yoga build artifact (dist no longer tracked). |
| packages/taffyjs-yoga/dist/load.js | Removes committed Yoga build artifact (dist no longer tracked). |
| packages/taffyjs-yoga/dist/load.d.ts | Removes committed Yoga build artifact (dist no longer tracked). |
| packages/taffyjs-yoga/dist/index.js | Removes committed Yoga build artifact (dist no longer tracked). |
| packages/taffyjs-yoga/dist/index.d.ts | Removes committed Yoga build artifact (dist no longer tracked). |
| packages/taffyjs-yoga/dist/facade-CjSanW_Y.js | Removes committed Yoga build artifact (dist no longer tracked). |
| packages/taffyjs-yoga/COMPATIBILITY.md | Updates compatibility wording and adds new “Different” rows for shrink-total<1 and percentage gap in auto main size. |
| packages/taffyjs-yoga-wasm/vite.config.ts | New: builds Yoga facade entries from shared Yoga source while externalizing @taffyjs/wasm and rewriting @taffyjs/node imports. |
| packages/taffyjs-yoga-wasm/tsconfig.json | New: TS config for the Yoga-Wasm package’s Vite+ config. |
| packages/taffyjs-yoga-wasm/THIRD-PARTY-LICENSES | New: third-party license bundle for derived PixelGrid logic used by the shared facade. |
| packages/taffyjs-yoga-wasm/README.md | New: consumer guidance (aliasing yoga-layout), lazy /load contract, and compatibility boundary notes. |
| packages/taffyjs-yoga-wasm/package.json | New: Yoga-Wasm package metadata/exports/scripts/dependencies. |
| .gitignore | Ignores Yoga and Yoga-Wasm dist/ outputs now treated as build artifacts. |
| .github/workflows/ci.yml | Stops asserting committed Yoga dist freshness; keeps other artifact drift checks. |
| .agents/docs/tooling-decisions.md | Records/vouches repository-wide third-party license filename convention. |
| .agents/docs/technology-stack.md | Updates build/test orchestration narrative for uncommitted Yoga dist and adds Yoga-Wasm verification flow. |
| .agents/docs/taffyjs-yoga-wasm-package.md | New PCR: Yoga-Wasm package design, boundaries, and verification contract. |
| .agents/docs/taffyjs-yoga-reference.md | Updates implementation reference to include new “Different” cases and percent-string parsing boundary. |
| .agents/docs/README.md | Updates PCR map to include Yoga-Wasm design and the new tooling decision topic. |
| .agents/docs/intent.md | Updates repo intent to include @taffyjs/yoga-wasm as a first-class package. |
| .agents/docs/architecture.md | Updates architecture overview to include the 4th public package and Yoga-Wasm testing strategy. |
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.
Comment on lines
+83
to
+90
| const numericSource = value.slice(0, -1); | ||
| if (!Number.isFinite(Number(numericSource))) { | ||
| throw new TypeError(`${name} percentage must be finite`); | ||
| } | ||
| const numeric = Number.parseFloat(numericSource); | ||
| if (Number.isNaN(numeric)) { | ||
| throw new TypeError(`${name} percentage must be numeric`); | ||
| } |
Comment on lines
129
to
+133
| node.setWidth(100); | ||
| node.setWidth(" 1%"); | ||
| node.setWidth("0x10%"); | ||
| node.setWidth("0b10%"); | ||
| node.setWidth("0o10%"); |
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/yoga-wasm, built from the exact@taffyjs/yogaTypeScript source with only the public backend import redirected from@taffyjs/nodeto@taffyjs/wasm/loadentry without embedding another Wasm payload or pulling in the native packageWhy
This provides a Yoga-compatible API for Node.js and modern bundled browsers while keeping one facade implementation and one compatibility policy. Consumers can substitute the package for
yoga-layoutthrough a package-manager alias without changing application imports.Validation
vp run checkvp run check:wasm