Skip to content

WASM/JS bindings via wasm-bindgen #928

@caweinshenker

Description

@caweinshenker

Summary

Adding JavaScript/TypeScript bindings for Taffy via wasm-bindgen, enabling use of Taffy's block, flexbox, and CSS grid layout from JS/TS environments (browser and Node.js).

I've already put together a working implementation in PR #927 — apologies for not filing an issue first per the contribution guidelines.

The bindings live in bindings/wasm/ as a separate crate (same structure as the earlier #394 effort) and produce a ~339KB optimized WASM binary. They expose tree creation, style setting from plain JS objects, layout computation, and result retrieval.

AI disclosure: The binding code was generated with assistance from Claude (Anthropic). It has been reviewed, tested, and verified — 385 lines of pure glue code with 0 unsafe blocks.

Happy to be assigned this and iterate on feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions