Skip to content

Clarify binding boundary names - #10

Merged
hyfdev merged 1 commit into
mainfrom
agent/binding-naming
Aug 15, 2026
Merged

hyfdev merged 1 commit into
mainfrom
agent/binding-naming

Conversation

@hyfdev

@hyfdev hyfdev commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • rename the private napi tree from NativeTaffyTree to BindingTaffyTree
  • rename binding error and measure-failure types to describe their layer rather than their implementation language
  • align private read-only raw methods with the existing rawGet* convention
  • update generated binding artifacts, tests, and binding documentation

Why

The old Native* names described where the code happened to run, while these types specifically belong to the JavaScript binding boundary. The read-only raw methods also used a different naming pattern from the rest of the raw API.

Impact

This changes private binding internals only. The supported @taffyjs/node exports and public index.d.ts surface remain unchanged.

Validation

  • vp run codegen
  • vp run ready (9 Rust unit tests, 45 native tests, 194 integration tests, types, formatting, lint, clippy, and release build)

@hyfdev
hyfdev marked this pull request as ready for review August 15, 2026 06:05
Copilot AI lite review requested due to automatic review settings August 15, 2026 06:05
@hyfdev
hyfdev merged commit 9c9dbfb into main Aug 15, 2026
4 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

This PR clarifies naming at the JavaScript binding boundary by renaming internal binding types from Native* to Binding* and aligning “raw” read-only method names with the existing rawGet* convention, while keeping the public @taffyjs/node API surface unchanged.

Changes:

  • Renamed the private N-API tree class from NativeTaffyTree to BindingTaffyTree across Rust, JS/TS, generated artifacts, and tests.
  • Renamed binding-layer error/result types from NativeError/NativeResult to BindingError/BindingResult.
  • Renamed read-only raw methods (e.g. rawNodeCount) to rawGet* equivalents and updated all call sites.

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/api-codegen/src/emit/tagged-values/rust.ts Updates Rust codegen output to use BindingResult imports/signatures.
tests/taffyjs-node/tests/types/public-api.test-d.ts Updates private-export assertions to reference BindingTaffyTree.
tests/taffyjs-node/tests/tree/constructor.test.mts Ensures root module does not expose BindingTaffyTree.
packages/taffyjs-node/tests/native/style.test.mts Updates internal binding class name and rawGetNodeCount usage in native tests.
packages/taffyjs-node/tests/native/numeric-families.test.mts Updates internal binding class name and rawGetNodeCount usage in native tests.
packages/taffyjs-node/tests/native/numbers.test.mts Updates internal binding class name and rawGetNodeCount usage in native tests.
packages/taffyjs-node/tests/native/length.test.mts Updates internal binding class name and rawGetNodeCount usage in native tests.
packages/taffyjs-node/tests/native/grid.test.mts Updates internal binding class name and rawGetNodeCount usage in native tests.
packages/taffyjs-node/tests/native/geometry.test.mts Updates internal binding class name and rawGetNodeCount usage in native tests.
packages/taffyjs-node/tests/native/available-space.test.mts Updates internal binding class name used by native tests.
packages/taffyjs-node/src/tree.ts Switches wrapper to BindingTaffyTree and read-only rawGet* methods.
packages/taffyjs-node/src/binding.ts Re-exports BindingTaffyTree from the generated binding module.
packages/taffyjs-node/index.js Updates bundled runtime to use BindingTaffyTree and rawGet* methods.
packages/taffyjs-node/binding.js Updates generated binding module exports to BindingTaffyTree.
packages/taffyjs-node/binding.d.ts Updates generated type declarations to BindingTaffyTree and rawGet* methods.
crates/taffyjs_binding/src/tagged_values.rs Migrates parsing helpers to return BindingResult and import it.
crates/taffyjs_binding/src/style.rs Migrates style conversion helpers/collects to BindingResult.
crates/taffyjs_binding/src/owner.rs Updates owner access wrapper to use BindingResult.
crates/taffyjs_binding/src/number.rs Migrates number parsing helpers to BindingResult.
crates/taffyjs_binding/src/measure.rs Renames error/failure variants to binding layer and uses BindingResult.
crates/taffyjs_binding/src/lib.rs Renames exported N-API class to BindingTaffyTree and rawGet* JS method names.
crates/taffyjs_binding/src/length.rs Migrates length parsers to BindingResult.
crates/taffyjs_binding/src/js_object.rs Migrates object parsing helpers to BindingResult.
crates/taffyjs_binding/src/grid.rs Migrates grid parsing helpers/collects to BindingResult.
crates/taffyjs_binding/src/geometry.rs Migrates geometry parsing helpers to BindingResult.
crates/taffyjs_binding/src/error.rs Renames binding-layer error and result types to BindingError/BindingResult.
crates/taffyjs_binding/src/available_space.rs Migrates available-space parser to BindingResult.
.agents/docs/binding-cases.md Updates documentation example to BindingTaffyTree.

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

hyfdev added a commit that referenced this pull request Aug 16, 2026
Implement the native Taffy binding, loader, generated input shorthand, query design, and repository test boundaries.

Refs: #1, #2, #4, #6, #7, #8, #10, #11
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