Skip to main content

ffigen_js 0.1.0 copy "ffigen_js: ^0.1.0" to clipboard
ffigen_js: ^0.1.0 copied to clipboard

ffigen, but for Javascript/WebAssembly interop bindings

0.1.0 #

  • Use Clang's target ABI field offsets and record sizes for JS struct and union bindings, including internal/tail padding and anonymous nested records.
  • Copy inline arrays and records by value instead of writing a pointer into their storage. Preserve all dimensions in fixed-array size calculations.
  • Handle unaligned packed field access and read/write Array<Float32> using four-byte float slots rather than eight-byte doubles.
  • Add Clang layout tests and extend the existing example with real Emscripten ABI round trips for Dart-to-JS and Dart-to-Wasm. bash example/build.sh runs the generator tests and all example checks locally and on pull requests.

Consumers must regenerate JS bindings and use the updated runtime to pick up the corrected layout and array access.

0.0.17-pre #

  • Register direct malloc() allocations so free(), Pointer.free() and heap-backed typed-data views release them. Stack and borrowed pointers remain excluded from heap release.

0.0.16-pre #

  • First release published via GitHub Actions OIDC automated publishing.
  • No code changes since 0.0.15-pre.

0.0.15-pre #

  • Parses headers with the wasm32-unknown-emscripten target by default, so target-dependent C types (size_t, long, ...) resolve with the Wasm ABI instead of the host ABI (e.g. size_t was 64-bit and generated mismatched JSBigInt bindings on 64-bit hosts). Override with compiler-opts: ['-target', '<other-triple>'].
  • Disables the automatic macOS SDK include paths by default (compiler-opts-automatic.macos.include-c-standard-library now defaults to false): they use the host ABI and conflict with the wasm32 target. Wasm headers get stddef.h/stdint.h/stdbool.h from clang's built-in headers. Opt back in with compiler-opts-automatic.macos.include-c-standard-library: true.
  • Fixes standalone enum emission: named enums at the translation-unit root were routed through the macro-deferral path and only emitted when an included function signature referenced their type. They now go through the type extractor (matching upstream ffigen), so enums that appear only as bitmask constants (no typed signature reference) are emitted as well.

0.0.14-pre #

  • Restores the generated API and output behavior from 0.0.12-pre.
  • Preserves the typed-data .address fixes introduced in 0.0.13-pre, including support for Int64List.

0.0.13-pre #

  • Fixes .address for typed lists backed by the Emscripten heap.
  • Adds typed-data address coverage to the bundled Emscripten example.
3
likes
0
points
6.45k
downloads

Publisher

unverified uploader

Weekly Downloads

ffigen, but for Javascript/WebAssembly interop bindings

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, cli_util, collection, ffi, file, glob, logging, package_config, path, pub_semver, quiver, yaml, yaml_edit

More

Packages that depend on ffigen_js