ffigen_js 0.1.3
ffigen_js: ^0.1.3 copied to clipboard
ffigen, but for Javascript/WebAssembly interop bindings
0.1.3 #
- Generate
sizeOf<T>()for complete structs and unions using Clang's ABI size constants, including padding. Primitive types retain runtime support and opaque records remain unsupported. No module initialization is required.
Regenerate JS bindings to expose the new sizeOf<T>() helper.
0.1.2 #
- Correct
CharandBoolsizes to one byte forsizeOf, pointer arithmetic, and stack allocations, matching the Wasm C/C++ ABI.
0.1.1 #
- Generate lossless
BigIntaccessors for signed 64-bit struct fields, including packed, unaligned fields. - Expose Clang's padded record size as
byteSizeand generate indexed pointer views for arrays of complete structs and unions. - Honor explicit struct inclusion when pointer dependencies are configured as opaque.
Regenerate JS bindings to pick up these changes.
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.shruns 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 sofree(),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-emscriptentarget by default, so target-dependent C types (size_t,long, ...) resolve with the Wasm ABI instead of the host ABI (e.g.size_twas 64-bit and generated mismatchedJSBigIntbindings on 64-bit hosts). Override withcompiler-opts: ['-target', '<other-triple>']. - Disables the automatic macOS SDK include paths by default
(
compiler-opts-automatic.macos.include-c-standard-librarynow defaults tofalse): they use the host ABI and conflict with the wasm32 target. Wasm headers getstddef.h/stdint.h/stdbool.hfrom clang's built-in headers. Opt back in withcompiler-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
.addressfixes introduced in0.0.13-pre, including support forInt64List.
0.0.13-pre #
- Fixes
.addressfor typed lists backed by the Emscripten heap. - Adds typed-data address coverage to the bundled Emscripten example.