From e57dd862decd912a23cf7a70f92282311ff1844a Mon Sep 17 00:00:00 2001 From: Yunfei He Date: Sun, 16 Aug 2026 16:23:51 +0800 Subject: [PATCH 1/5] Refine project README --- README.md | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8c596fa..d609ec5 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,37 @@ # TaffyJS -TaffyJS provides JavaScript bindings and compatibility layers for the Taffy layout engine. +TaffyJS brings the Taffy layout engine to JavaScript through native, WebAssembly, and Yoga-compatible packages. -The first package is `@taffyjs/node`, the ESM-only native Node-API entry point built with napi-rs. A future `@taffyjs/node-yoga` package may provide a Yoga-compatible API on top of `@taffyjs/node` without adding another native binding. +## Features -The current package implements Taffy 0.13 for Linux x64 GNU and Windows x64 MSVC with Node.js 22.18.0 or newer. Publication is not configured. +- A direct binding to Taffy's behavior, without another layout abstraction or a new mental model. +- JavaScript-friendly inputs and readable outputs, with APIs optimized for common usage patterns while preserving Taffy's semantics. +- Native performance on Node.js through Rust and Node-API. +- First-class WebAssembly support for bundled browsers and deployments where a native addon is not the right fit. +- One public API across native and WebAssembly runtimes: use `@taffyjs/node` for native performance on Node.js or `@taffyjs/wasm` for WebAssembly portability; only the underlying implementation changes. +- Yoga compatibility through `@taffyjs/yoga` and `@taffyjs/yoga-wasm` (work in progress), preserving Yoga's API shape for straightforward migration. -## Repository layout +## Installation -- `crates/` contains Rust crates. The repository starts with one native adapter in `crates/taffyjs_binding`; shared Rust crates should only be extracted when another native consumer needs them. -- `packages/` contains independent JavaScript package boundaries. `packages/taffyjs-node` owns the authored public ESM wrapper and types, the private generated native loader, rare package-local unit tests, and npm metadata for `@taffyjs/node`. -- `tests/` contains private consumer packages for integration and end-to-end coverage. `tests/taffyjs-node` exercises `@taffyjs/node` through the same package boundary used by downstream JavaScript consumers. +```sh +npm install @taffyjs/node +``` -The two native packages are `@taffyjs/binding-linux-x64-gnu` and `@taffyjs/binding-win32-x64-msvc`. They are private implementation dependencies; application code imports only `@taffyjs/node`. +## Packages -## Development +| Package | Version | +| ------------------------------------------------------------------------ | ------- | +| [`@taffyjs/node`](https://www.npmjs.com/package/@taffyjs/node) | — | +| [`@taffyjs/wasm`](https://www.npmjs.com/package/@taffyjs/wasm) | — | +| [`@taffyjs/yoga`](https://www.npmjs.com/package/@taffyjs/yoga) | — | +| [`@taffyjs/yoga-wasm`](https://www.npmjs.com/package/@taffyjs/yoga-wasm) | WIP | -Install dependencies with `vp install`, then run `vp run ready` for formatting, linting, Rust checks, the native build, Rust and JavaScript tests, and type checks. After changing an input under `api/`, run `vp run codegen`; the default local checks never run generation. CI separately regenerates source and rejects any resulting Git diff. The public `@taffyjs/node` TypeScript source is built with `vp pack`; napi-rs generates the private native loader separately. +## Credits + +- [Taffy](https://github.com/DioxusLabs/taffy), the layout engine at the core of TaffyJS. +- [napi-rs](https://github.com/napi-rs/napi-rs), the tooling behind the native and WebAssembly bindings. +- [Yoga](https://github.com/react/yoga), the API and compatibility target for the Yoga packages. + +## License + +MIT From a51366b1fb7ec012696feffea2f2352559097fe7 Mon Sep 17 00:00:00 2001 From: Yunfei He Date: Sun, 16 Aug 2026 16:41:17 +0800 Subject: [PATCH 2/5] Refine feature descriptions --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d609ec5..bae2708 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ TaffyJS brings the Taffy layout engine to JavaScript through native, WebAssembly ## Features -- A direct binding to Taffy's behavior, without another layout abstraction or a new mental model. -- JavaScript-friendly inputs and readable outputs, with APIs optimized for common usage patterns while preserving Taffy's semantics. -- Native performance on Node.js through Rust and Node-API. -- First-class WebAssembly support for bundled browsers and deployments where a native addon is not the right fit. -- One public API across native and WebAssembly runtimes: use `@taffyjs/node` for native performance on Node.js or `@taffyjs/wasm` for WebAssembly portability; only the underlying implementation changes. -- Yoga compatibility through `@taffyjs/yoga` and `@taffyjs/yoga-wasm` (work in progress), preserving Yoga's API shape for straightforward migration. +- **Direct binding to Taffy:** Preserves Taffy's behavior without adding another layout abstraction or mental model. +- **Optimized binding bridge:** Minimizes cross-boundary data transfer with targeted tree operations that update only the relevant state. +- **Native performance:** Runs Taffy as native Rust code in Node.js through Node-API. +- **WebAssembly support:** Runs Taffy in bundled browsers and deployments where a native addon is not the right fit. +- **One API, two runtimes:** Use `@taffyjs/node` for native performance on Node.js or `@taffyjs/wasm` for WebAssembly portability; only the underlying implementation changes. +- **Yoga compatibility:** Use `@taffyjs/yoga` or `@taffyjs/yoga-wasm` (work in progress) while preserving Yoga's API shape for straightforward migration. ## Installation From dda43ca51828b5570dca9f049798b9ed50e03e5c Mon Sep 17 00:00:00 2001 From: Yunfei He Date: Sun, 16 Aug 2026 16:44:57 +0800 Subject: [PATCH 3/5] Clarify package positioning --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bae2708..4ea2c7d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ TaffyJS brings the Taffy layout engine to JavaScript through native, WebAssembly - **Optimized binding bridge:** Minimizes cross-boundary data transfer with targeted tree operations that update only the relevant state. - **Native performance:** Runs Taffy as native Rust code in Node.js through Node-API. - **WebAssembly support:** Runs Taffy in bundled browsers and deployments where a native addon is not the right fit. -- **One API, two runtimes:** Use `@taffyjs/node` for native performance on Node.js or `@taffyjs/wasm` for WebAssembly portability; only the underlying implementation changes. +- **One API, two runtimes:** Switch freely between `@taffyjs/node` and `@taffyjs/wasm` for native performance or WebAssembly flexibility—their public APIs are identical. - **Yoga compatibility:** Use `@taffyjs/yoga` or `@taffyjs/yoga-wasm` (work in progress) while preserving Yoga's API shape for straightforward migration. ## Installation @@ -19,12 +19,12 @@ npm install @taffyjs/node ## Packages -| Package | Version | -| ------------------------------------------------------------------------ | ------- | -| [`@taffyjs/node`](https://www.npmjs.com/package/@taffyjs/node) | — | -| [`@taffyjs/wasm`](https://www.npmjs.com/package/@taffyjs/wasm) | — | -| [`@taffyjs/yoga`](https://www.npmjs.com/package/@taffyjs/yoga) | — | -| [`@taffyjs/yoga-wasm`](https://www.npmjs.com/package/@taffyjs/yoga-wasm) | WIP | +| Package | Description | Version | +| ------------------------------------------------------------------------ | ----------------------------------------------- | ------- | +| [`@taffyjs/node`](https://www.npmjs.com/package/@taffyjs/node) | Native Node.js runtime for maximum performance. | — | +| [`@taffyjs/wasm`](https://www.npmjs.com/package/@taffyjs/wasm) | WebAssembly runtime for flexible deployment. | — | +| [`@taffyjs/yoga`](https://www.npmjs.com/package/@taffyjs/yoga) | Yoga-compatible API backed by `@taffyjs/node`. | — | +| [`@taffyjs/yoga-wasm`](https://www.npmjs.com/package/@taffyjs/yoga-wasm) | Yoga-compatible API backed by `@taffyjs/wasm`. | WIP | ## Credits From b02c41eeb2fc82be27bb719349b5d59fafa506e6 Mon Sep 17 00:00:00 2001 From: Yunfei He Date: Sun, 16 Aug 2026 16:48:21 +0800 Subject: [PATCH 4/5] Clarify runtime interchangeability --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ea2c7d..12a45b3 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ TaffyJS brings the Taffy layout engine to JavaScript through native, WebAssembly - **Optimized binding bridge:** Minimizes cross-boundary data transfer with targeted tree operations that update only the relevant state. - **Native performance:** Runs Taffy as native Rust code in Node.js through Node-API. - **WebAssembly support:** Runs Taffy in bundled browsers and deployments where a native addon is not the right fit. -- **One API, two runtimes:** Switch freely between `@taffyjs/node` and `@taffyjs/wasm` for native performance or WebAssembly flexibility—their public APIs are identical. +- **One API, two runtimes:** Both packages expose the same JavaScript API; only the underlying implementation differs—native code in `@taffyjs/node` and WebAssembly in `@taffyjs/wasm`—so you can switch between them to prioritize performance or flexibility. - **Yoga compatibility:** Use `@taffyjs/yoga` or `@taffyjs/yoga-wasm` (work in progress) while preserving Yoga's API shape for straightforward migration. ## Installation From 50b1379d9c070622aaa557a1220893c13530c2e2 Mon Sep 17 00:00:00 2001 From: Yunfei He Date: Sun, 16 Aug 2026 16:49:29 +0800 Subject: [PATCH 5/5] Shorten runtime description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 12a45b3..d236b73 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ TaffyJS brings the Taffy layout engine to JavaScript through native, WebAssembly - **Optimized binding bridge:** Minimizes cross-boundary data transfer with targeted tree operations that update only the relevant state. - **Native performance:** Runs Taffy as native Rust code in Node.js through Node-API. - **WebAssembly support:** Runs Taffy in bundled browsers and deployments where a native addon is not the right fit. -- **One API, two runtimes:** Both packages expose the same JavaScript API; only the underlying implementation differs—native code in `@taffyjs/node` and WebAssembly in `@taffyjs/wasm`—so you can switch between them to prioritize performance or flexibility. +- **One API, two runtimes:** The same JavaScript API, backed by native code in `@taffyjs/node` for performance or WebAssembly in `@taffyjs/wasm` for flexibility. - **Yoga compatibility:** Use `@taffyjs/yoga` or `@taffyjs/yoga-wasm` (work in progress) while preserving Yoga's API shape for straightforward migration. ## Installation