Skip to content

v0.8.0

Choose a tag to compare

@lynnswap lynnswap released this 04 Oct 12:46
ae4fbce

ABIBridge v0.8.0

Breaking Changes

  • Swift callable handles and hook continuations now use complete function signatures, such as NativeSwiftFunction<(Int64) -> String>. Native errors and async isolation belong in the signature; separate throwing/async handle types and inheritsCallerIsolation: have been removed.
  • Replace substituting: with genericArguments:. Swift getters now take a zero-argument function type, such as (() -> String).self.
  • NativeSwiftValue replaces NativeSwiftOpaqueValue. Use NativeSwiftClosure with NativeSwiftBorrowedValue instead of NativeSwiftBorrowingClosure, and ordinary member handles instead of borrowedMethod and borrowedGetter.
  • ABICopyObjCMethod now takes consumed-parameter indexes and a count; pass NULL, 0 for ordinary borrowed parameters. Native hook callers must also initialize the new consumed-parameter fields in ABIObjCHookOptions.

New Features

  • Bind multiple generic parameters, constraints, and type packs across Swift functions, generic types, and members using existing native conformances.
  • Pass runtime-only values through calls and callbacks with borrowing, consuming, and inout ownership. Support noncopyable payloads and process nonescapable results inside unsafeInvoke(..., withResult:).
  • Compose tuples, runtime values, and nested or returned closures through the same calling APIs. Resolve generic opaque results, including results inside tuples, optionals, and returned closures.
  • Extend existential values and callbacks to parameterized protocols and generic superclass compositions. See the supported shapes and compiler limitations.
  • Hook generic and async Swift imports and virtual methods while preserving generic bindings, native errors, and the caller's task across suspension.
  • Call C/C++ variadic functions and Objective-C variadic messages or captured implementations with concrete argument tails and C's default argument promotions.
  • Declare consumed Objective-C arguments with NativeMethodOptions.consumedArguments. Use Unmanaged<T> for pointer-based Core Foundation references with explicit ownership.

Improvements

  • Reduce allocation and preparation overhead for repeated native calls and Swift callbacks.
  • Reduce repeated work in Swift type/protocol lookup, missing-module searches, and sparse pointer scans.

Migration Notes

See the Swift API migration guide for before-and-after examples covering signatures, generic arguments, runtime values, callbacks, and scoped results.

Full Changelog: v0.7.0...v0.8.0