You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f696518
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .agents/docs/intent.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,18 @@ TaffyJS is intended to bring Taffy, a high-performance layout engine written in
9
9
- A future `@taffyjs/yoga` package may provide a Yoga-compatible JavaScript API built on top of `@taffyjs/node` rather than as a second native implementation. [VOUCHED @hyfdev 2026-08-14]
10
10
- The package family should support real consumers such as terminal UI frameworks without forcing those consumers to own their own Taffy bindings.
11
11
12
+
## Bun and Deno runtime support
13
+
14
+
[VOUCHED @hyfdev 2026-08-16]
15
+
16
+
**Ruling:** The implemented `@taffyjs/node` and `@taffyjs/wasm` packages support Bun 1.2+ within the Bun 1 major and Deno 2.2+ within the Deno 2 major. Runtime support follows one current major at a time rather than spanning majors.
17
+
18
+
**Limits:** Adopting a new Bun or Deno major requires choosing and documenting a new mainstream minimum minor and ends the support promise for the previous major. This ruling does not treat unimplemented packages as supported. Deno use of `@taffyjs/node` requires local `node_modules` plus environment, read, and FFI permissions; `@taffyjs/wasm` requires no Deno permission flags.
19
+
20
+
**Verification:** CI runs one minimal public-package layout smoke at only the first release of each supported minor floor, Bun 1.2.0 and Deno 2.2.0. It does not copy the complete behavior suite, test a second endpoint, or retain a cross-major matrix.
21
+
22
+
**Source:** Yunfei (`@hyfdev`), 2026-08-16; selected mainstream minimum minors within only the current runtime majors, chose Bun 1.2+ and Deno 2.2+ after both package paths passed at their `.0` releases, required only that minimum endpoint in CI, and asked to vouch the rule.
23
+
12
24
## @taffyjs/node binding role
13
25
14
26
`@taffyjs/node` exposes Taffy's high-level `TaffyTree` workflow without exposing low-level extension machinery or reimplementing layout in JavaScript. Taffy owns topology, Style, Layout, cache, and computation state; JavaScript adds only the public wrapper data needed for safe Node.js use.
@@ -19,5 +31,5 @@ The binding role and API priority are recorded in [@taffyjs/node decisions](taff
19
31
20
32
## Open questions
21
33
22
-
- Runtime and platform support beyond the current native targets and the approved `@taffyjs/wasm` Node.js and bundled-browser scope require a concrete consumer need.
34
+
- Runtime and platform support beyond the current native targets, the approved `@taffyjs/wasm` Node.js and bundled-browser scope, Bun 1.2+ within major 1, and Deno 2.2+ within major 2 requires a concrete consumer need.
23
35
- The coverage and release timing of `@taffyjs/yoga` remain open. Yoga compatibility is not part of the `@taffyjs/node` contract.
Copy file name to clipboardExpand all lines: .agents/docs/taffyjs-wasm-package.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The package reuses the public API and authored JavaScript behavior of `@taffyjs/
8
8
9
9
## Public use
10
10
11
-
Node.js and browser applications use the same ESM import and receive an initialized API:
11
+
Node.js, Bun 1.2+ within major 1, Deno 2.2+ within major 2, and browser applications use the same ESM import and receive an initialized API:
12
12
13
13
```ts
14
14
import { TaffyTree } from"@taffyjs/wasm";
@@ -44,7 +44,7 @@ Exact output extensions and directories may follow the repository's Vite+ conven
44
44
45
45
## Runtime chains
46
46
47
-
The default Node entry connects the existing authored TaffyJS source to a private ESM bridge and a generated CommonJS factory. The bridge statically imports the shared payload and immediately calls that factory. The factory is mechanically derived from napi-rs's generated eager Node loader: it decodes the supplied payload with `Buffer.from`, uses `instantiateNapiModuleSync`, and retains the generated registration, rollback, cleanup, and binding-export lifecycle. The selected graph has no top-level await, so ordinary static imports expose an initialized `TaffyTree` without making Node consumers await package initialization.
47
+
The default entry used by Node.js, Bun, and Deno connects the existing authored TaffyJS source to a private ESM bridge and a generated CommonJS factory. The bridge statically imports the shared payload and immediately calls that factory. The factory is mechanically derived from napi-rs's generated eager Node loader: it decodes the supplied payload with `Buffer.from`, uses `instantiateNapiModuleSync`, and retains the generated registration, rollback, cleanup, and binding-export lifecycle. The selected graph has no top-level await, so ordinary static imports expose an initialized `TaffyTree` without making consumers await package initialization. Deno uses this package without runtime permission flags.
48
48
49
49
The browser entry connects the same authored source to a private ESM adapter. That adapter decodes the shared payload with `Uint8Array.fromBase64` when available and otherwise uses `atob` plus a direct `Uint8Array` fill, calls `WebAssembly.compile` exactly once, and passes the resulting `WebAssembly.Module` to napi-rs's unmodified deferred loader through `instantiate(module)`. It uses top-level await, so browser static importers run only after initialization and still use `new TaffyTree()` without an explicit initialization call.
50
50
@@ -68,11 +68,12 @@ Both runtime chains use napi-rs's JavaScript WASI implementation without forward
68
68
- Do not publish or ask users to install a TaffyJS WASIP binding package.
69
69
- Do not add a public initialization API, public raw binding, hand-maintained WASI or emnapi implementation, or Wasm-specific Taffy API.
70
70
- Do not use wasm-bindgen, a second Rust binding implementation, a second authored `TaffyTree`, gzip, `wasm-opt`, or a threaded WASIP target.
71
-
- Do not claim workerd, Deno, Bun, unbundled CDN, or legacy-browser support without separate evidence and a deliberate support decision.
71
+
- Do not claim support below the documented Bun or Deno minor floors, across Bun or Deno majors, for workerd, for unbundled CDN use, or for legacy browsers without separate evidence and a deliberate support decision.
72
72
73
73
## Verification contract
74
74
75
75
- A Node.js ESM consumer must import `@taffyjs/wasm` and use the ordinary public Taffy API without initialization calls, top-level await in the selected package graph, or native platform packages.
76
+
- Consumers on Bun 1.2+ within major 1 and Deno 2.2+ within major 2 must import the same public entry and complete a minimal layout through the ordinary API; the Deno check must run without permission flags. CI covers only Bun 1.2.0 and Deno 2.2.0 as the first releases of the supported minor floors and does not retain a cross-major runtime matrix.
76
77
- A bundled browser consumer must use the same import and API, include the inline payload without emitting a `.wasm` asset, and work without `SharedArrayBuffer`, cross-origin isolation, COOP, or COEP.
77
78
- The Node and browser builds must derive their JavaScript and TypeScript surface from the same authored source. Except for a documented and evidenced host-specific exception, every public Node binding behavior test must run unchanged against both `@taffyjs/node` and `@taffyjs/wasm`; one test configuration redirects the exact package import instead of copying test files.
78
79
- Package inspection must show exactly one base64 Wasm payload, no independent `.wasm` file, exactly one browser-side `WebAssembly.compile`, synchronous `instantiateNapiModuleSync` in the Node graph, no Node environment or filesystem-root WASI capabilities, no retained `require.resolve` or dependency on `@taffyjs/binding-wasm32-wasip1`, no public initialization subpath, and no accidentally published raw binding entry.
Copy file name to clipboardExpand all lines: .agents/docs/technology-stack.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ The root Vite+ task graph builds the napi-rs artifacts into `packages/taffyjs-wa
26
26
27
27
`tools/api-codegen` owns source generation that must keep Rust and TypeScript API facts aligned. Its first maintained input is `api/numeric-families.json`; `vp run codegen` updates both language outputs. CI runs `vp run check:codegen`, which regenerates and rejects any resulting Git diff.
28
28
29
-
CI has five jobs. Ubuntu x64 and Windows x64 each build the native addon and run all Rust, JavaScript, and type tests with Node.js 22.18.0. Ubuntu also rejects stale committed package JavaScript and declarations after the build. A separate Ubuntu WASIP job installs the Rust target and Playwright Chromium, builds `@taffyjs/wasm`, reruns the complete Node public API suite against it, and runs type, package-content, packed-consumer, bundled-consumer, and browser-runtime checks against the generated package. A Node-only job checks formatting, JavaScript and repository TypeScript including maintained tools through Vite+'s type-aware lint path, and generated-source drift. A Rust-only job checks formatting and Clippy. macOS and publication workflows are not configured.
29
+
CI has five jobs. Ubuntu x64 and Windows x64 each build the native addon and run all Rust, JavaScript, and type tests with Node.js 22.18.0, then smoke-test the public `@taffyjs/node` entry with Bun 1.2.0 and Deno 2.2.0; Ubuntu also rejects stale committed package JavaScript and declarations after the build. A separate Ubuntu WASIP job installs the Rust target and Playwright Chromium, builds `@taffyjs/wasm`, reruns the complete Node public API suite against it, runs type, package-content, packed-consumer, bundled-consumer, and browser-runtime checks against the generated package, and applies the same Bun 1.2.0 and Deno 2.2.0 smoke checks to the public entry. Alternate-runtime smoke checks perform one fixed layout rather than copying the complete behavior suite. A Node-only job checks formatting, JavaScript and repository TypeScript including maintained tools through Vite+'s type-aware lint path, and generated-source drift. A Rust-only job checks formatting and Clippy. macOS and publication workflows are not configured.
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,17 @@ npm install @taffyjs/node
26
26
|[`@taffyjs/yoga`](https://www.npmjs.com/package/@taffyjs/yoga)| Yoga-compatible API backed by `@taffyjs/node`. | — |
27
27
|[`@taffyjs/yoga-wasm`](https://www.npmjs.com/package/@taffyjs/yoga-wasm)| Yoga-compatible API backed by `@taffyjs/wasm`. | WIP |
28
28
29
+
## Runtime compatibility
30
+
31
+
TaffyJS supports Bun 1.2+ within the Bun 1 major and Deno 2.2+ within the Deno 2 major. CI smoke-tests the first release of each minimum minor by importing each public package, computing a minimal layout, and verifying the result. Support follows one current major per runtime rather than spanning runtime majors.
Copy file name to clipboardExpand all lines: apps/website/node/index.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@ The package requires Node.js 22.18.0 or newer and currently provides native bina
13
13
| Linux | x64 |`x86_64-unknown-linux-gnu`|
14
14
| Windows | x64 |`x86_64-pc-windows-msvc`|
15
15
16
+
Bun 1.2+ within major 1 and Deno 2.2+ within major 2 are also supported on these native targets. CI smoke-tests Bun 1.2.0 and Deno 2.2.0 through the public package entry. Support does not span runtime majors. Deno requires a local `node_modules` directory and the `--allow-env`, `--allow-read`, and `--allow-ffi` permissions.
17
+
16
18
The package is ESM-only. Application code imports the public package entry:
| Bun | Version 1.2 or newer within the Bun 1 major |
35
+
| Deno | Version 2.2 or newer within the Deno 2 major, without permission flags |
34
36
| Browser | Applications built with a bundler that supports package export conditions and top-level await |
35
37
36
38
The browser build contains the Wasm payload inside JavaScript, so it does not fetch a separate `.wasm` file. It is threadless and does not require `SharedArrayBuffer` or cross-origin isolation headers.
37
39
38
-
Direct imports from a CDN and runtimes other than the supported Node.js and bundled-browser paths are not currently part of the package contract.
40
+
Bun versions below 1.2, Deno versions below 2.2, other Bun and Deno majors, direct CDN imports, and runtimes not listed above are not part of the package contract.
39
41
40
42
## Loading
41
43
@@ -58,7 +60,7 @@ Your bundler must select the package's browser entry. No TaffyJS-specific loader
Copy file name to clipboardExpand all lines: packages/taffyjs-node/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Install it with npm:
8
8
npm install @taffyjs/node
9
9
```
10
10
11
-
The package requires Node.js 22.18.0 or newer. Its native targets are Linux x64 GNU and Windows x64 MSVC. Application code imports only the public package entry:
11
+
The package requires Node.js 22.18.0 or newer. Its native targets are Linux x64 GNU and Windows x64 MSVC. Bun 1.2+ within major 1 and Deno 2.2+ within major 2 are also supported and smoke-tested on those targets; support does not span runtime majors. Deno requires a local `node_modules` directory and the `--allow-env`, `--allow-read`, and `--allow-ffi` permissions. Application code imports only the public package entry:
Copy file name to clipboardExpand all lines: packages/taffyjs-wasm/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# `@taffyjs/wasm`
2
2
3
-
`@taffyjs/wasm` runs the Taffy layout engine as threadless WebAssembly in Node.js and bundled browsers. It exposes the same public TaffyJS API as `@taffyjs/node`; choosing this package guarantees that the implementation is Wasm rather than a native addon.
3
+
`@taffyjs/wasm` runs the Taffy layout engine as threadless WebAssembly in Node.js, Bun 1.2+ within major 1, Deno 2.2+ within major 2, and bundled browsers. It exposes the same public TaffyJS API as `@taffyjs/node`; choosing this package guarantees that the implementation is Wasm rather than a native addon.
4
4
5
5
```ts
6
6
import { TaffyTree } from"@taffyjs/wasm";
@@ -16,4 +16,4 @@ No explicit initialization call is needed. The Wasm payload is inlined once in t
The supported browser path is through a bundler that honors conditional exports and top-level await. It does not emit or fetch a separate `.wasm` asset. Direct CDN use and runtimes other than supported Node.js and bundled browsers are not currently part of the package contract.
19
+
The supported browser path is through a bundler that honors conditional exports and top-level await. It does not emit or fetch a separate `.wasm` asset. Deno needs no runtime permission flags. Bun versions below 1.2, Deno versions below 2.2, other Bun and Deno majors, direct CDN use, and other runtimes are not currently part of the package contract.
0 commit comments