A cross-platform framework for building native applications with Rust business logic and platform-native UIs.
Write your business logic once in Rust. Build native UIs for each platform.
- Write business logic once in Rust
- Use native UI frameworks (SwiftUI, Jetpack Compose, WinUI, etc.)
- Get truly native performance and platform feel
- Maintain type safety end-to-end via UniFFI
# Install the released JFFI CLI
cargo install jffi --locked# Create a new app with platform support
jffi new my-app --platforms ios,macos,android,linux,windows
# Navigate and run
cd my-app
jffi run --platform ios # iOS Simulator
jffi run --platform macos # macOS app
jffi run --platform android # Android Emulator
jffi run --platform linux # Linux GTK app
jffi run --platform windows # Windows app
jffi run --platform web # Web browserThat's it! The app builds, compiles Rust, generates platform bindings, and launches automatically.
Before building or bundling for new platforms, use jffi doctor to reconcile and verify that your development environment has all the required tools, SDKs, and compilers installed. Pass --no-setup or --offline for validation without installation.
# Check enabled platforms that this host can build
jffi doctor bundle
# Validate jffi.toml without checking SDKs or development tools
jffi doctor config
# Check readiness for a specific platform
jffi doctor bundle --platform android
# Explicitly install missing development tools for a platform
jffi setup --platform android
# Keep builds non-mutating in controlled environments
jffi build --platform ios --no-setup
# Disable network access and automatic managed-tool setup
jffi build --platfor
8000
m ios --offlineJFFI automatically reconciles uniffi-bindgen to the exact UniFFI version resolved by the project's Cargo.lock, then resumes build, run, debug, or dev. Use --no-setup, --offline, or JFFI_NO_SETUP=1 when tool installation must remain explicit. Windows also checks the UniFFI release line reported by uniffi-bindgen-cs and replaces incompatible generators before building. Custom C# generator forks must report their UniFFI version in --version output (for example, 0.11.1+v0.31.0); configure their source with JFFI_UNIFFI_BINDGEN_CS_GIT and JFFI_UNIFFI_BINDGEN_CS_TAG or JFFI_UNIFFI_BINDGEN_CS_BRANCH. Web setup resolves a missing Cargo.lock, including after new --no-build, while honoring offline mode.
Once your application is ready, JFFI can orchestrate packaging for the formats it currently supports: Android APK/AAB, macOS app/DMG/PKG, iOS IPA, Windows MSIX, Linux Flatpak, and web distributions.
Real bundle operations reconcile the selected platform's prerequisites automatically. On Linux this includes the configured Flatpak SDK and runtime, not only flatpak-builder. Use the global --no-setup or --offline flag when installation must be disabled; plan and dry-run modes remain read-only.
Configured source icons must be PNG, JPEG, or ICO files. A configured but missing or unreadable icon is treated as a build error.
# Bundle for macOS (creates a .dmg)
jffi bundle --platform macos
# Bundle for Windows (creates MSIX packages)
jffi bundle --platform windows
# Bundle for Linux (creates a Flatpak)
jffi bundle --platform linux --no-sign # Or configure a Linux GPG signing profile
# Bundle for Android (creates an .aab or .apk)
jffi bundle --platform android
# Advanced options (code signing, notarization, specific formats)
jffi bundle --platform macos --format app --profile release --notarizeBundle one platform per invocation. This keeps native-host requirements and
release artifacts explicit; jffi bundle --platform all is intentionally not
supported.
| Platform | Status | UI Framework | Language |
|---|---|---|---|
| iOS | ✅ Ready | SwiftUI | Swift |
| macOS | ✅ Ready | SwiftUI | Swift |
| Android | ✅ Ready | Jetpack Compose | Kotlin |
| Linux | ✅ Ready | GTK 4 + Libadwaita | Python |
| Web | ✅ Ready | Vanilla JS + WASM | JavaScript |
| Windows | ✅ Ready | WinUI 3 | C# |
JFFI currently requires the native host for building and running most desktop/mobile platforms. Android and Web are cross-platform by default.
| Target Platform | Mac Host | Windows Host | Linux Host |
|---|---|---|---|
| iOS | ✅ Native | ❌ No | ❌ No |
| macOS | ✅ Native | ❌ No | ❌ No |
| Android | ✅ Native | ✅ Native | ✅ Native |
| Windows | ❌ No | ✅ Native | ❌ No |
| Linux | ❌ No | ❌ No | ✅ Native |
| Web | ✅ Native | ✅ Native | ✅ Native |
Note: Android and Web can be developed from any host. Other platforms currently require their respective native host for UI development and execution.
JFFI automatically handles the UniFFI + JNA + ndk-context incompatibility for Android apps using networking libraries.
The Problem:
- UniFFI uses JNA (Java Native Access) which doesn't call
JNI_OnLoad - Some Rust crates (like
hickory-resolverused byiroh) need Android context for DNS resolution - Without initialization, apps crash with:
android context was not initialized
JFFI's Solution: When building for Android, JFFI automatically:
- Detects if your Rust dependencies use
ndk-context(viacargo tree) - Generates a JNI bridge (
core/src/android.rs) to initialize ndk-context - Creates a Kotlin helper (
JffiAndroidInit.kt) withinitNdkContext()method - Injects the initialization call in
MainActivity.onCreate() - Updates
core/Cargo.tomlwithndk-contextandjnidependencies - Configures 16 KB page alignment for all Rust libraries (
.cargo/config.toml) - Sets
android:extractNativeLibs="true"for prebuilt AAR dependencies (JNA, ML Kit)
Result: Android apps using networking libraries (iroh, hickory-resolver, etc.) work out of the box with zero configuration.
16 KB native-library support:
JFFI applies 16 KB linker flags to the Rust core. Bundling also checks the finished
APK/AAB: every packaged native library must match its ABI, all 64-bit ELF LOAD
segments must support 16 KB pages, and each configured ABI must contain the core.
This includes libraries supplied by JNA and other AARs. An incompatible dependency
must be updated or rebuilt; extracting it at install time does not repair its ELF
alignment. APK ZIP alignment is checked with SDK zipalign (JFFI_ZIPALIGN can
select the executable). AABs with uncompressed native libraries must request
16 KB or 64 KB alignment in BundleConfig.pb.
Android Rust builds and packaging use the same ABI selection. Configure
platforms.android.abis, bundle.android.abis, or both with matching sets.
Supported ABIs are arm64-v8a, armeabi-v7a, and x86_64. Unknown, duplicate,
empty or conflicting lists fail before building. compile_sdk, target_sdk, and
min_sdk must agree, and Gradle's compileSdk is synchronized too.
Omitted bundle ABI and minimum-SDK settings inherit their platform values;
explicit empty, duplicate or conflicting lists still fail. AAB configuration
larger than 1 MiB is rejected instead of checking a truncated prefix. Native
inspection excludes application assets and bundle/signature metadata.
The generated ABI selection is applied at Gradle's DSL finalization stage, so an
app's later android {} block cannot add the template's default ABIs back.
This applies to defaultConfig, build-type and product-flavor ABI filters.
Android wrapper bootstrapping and doctor checks honor JAVA_HOME, falling back
to java on PATH only when no JDK home is set.
Windows already supports x86_64-pc-windows-msvc, aarch64-pc-windows-msvc, and
i686-pc-windows-msvc through bundle.windows.targets; empty, duplicate and
unknown selections are rejected. These are CPU architectures, not certification
of tablet, foldable, desktop-window or accessibility behavior.
To inspect an existing Android artifact without rebuilding or checking signing:
jffi --no-setup doctor artifact --platform android --artifact path/to/app.aab
jffi --no-setup doctor artifact --platform android --artifact path/to/app.apkSigned Apple App Store exports and doctor bundle --release check the selected
Xcode and device SDK. Current iOS submission minimums are Xcode 26 / SDK 26;
Apple has announced SDK 27 for April 2027. Labeled beta/RC toolchain paths are
rejected, including DEVELOPER_DIR overrides. The iOS archive and embedded app
extensions are checked for the actual device SDK; SDK 27 apps must declare a
launch screen. Development and website exports do not inherit the App Store SDK
floor. Store declarations, privacy-reason accuracy, screenshots, account tasks,
physical-device QA and Windows App Certification Kit remain app/release work.
Note on Production Bundling & Signing Environment:
- When running
jffi bundle --platform android, JFFI's build orchestrator automatically generates a production signing configuration block derived from yourjffi.tomlprofiles. - Secure Interactive Prompts (recommended): If the signing environment variables are not pre-set,
jffi bundlewill securely prompt you for your keystore and key passwords at runtime with masked input — no plaintext exposure in shell history:🔑 Env var JFFI_ANDROID_STORE_PASSWORD not set. Keystore password is required for signing. Enter Android Keystore Password (JFFI_ANDROID_STORE_PASSWORD): •••••••••••••• 🔑 Env var JFFI_ANDROID_KEY_PASSWORD not set. Key password is required for signing. Enter Android Key Password (JFFI_ANDROID_KEY_PASSWORD): •••••••••••••• - CI/CD (non-interactive): For automated pipelines, export the variables before invoking the command:
export JFFI_ANDROID_STORE_PASSWORD=your_keystore_password export JFFI_ANDROID_KEY_PASSWORD=your_key_password jffi bundle --platform android
⚠️ Never hard-code passwords in scripts committed to version control. Use CI secret management (e.g. GitHub Actions Secrets, GitLab CI Variables, Fastlane Match).
References:
my-app/
├── core/ # Rust business logic + UniFFI exports
│ ├── src/lib.rs
│ └── Cargo.toml
│
├── ffi-web/ # WASM FFI wrapper (present when web is enabled)
│ └── src/lib.rs
│
├── platforms/
│ ├── ios/ # iOS SwiftUI app (auto-generated Xcode project)
│ ├── android/ # Android Jetpack Compose app
│ ├── macos/ # macOS SwiftUI app
│ ├── linux/ # GTK 4 Python app
│ ├── windows/ # WinUI 3 C# app
│ └── web/ # Vanilla JS + Vite frontend
│
├── jffi.toml # Framework configuration
├── Cargo.toml # Workspace manifest
└── Makefile # Convenience commands
core/src/lib.rs:
use uniffi;
#[derive(uniffi::Object)]
pub struct Core {
// Pure computation, no UI state
}
#[uniffi::export]
impl Core {
#[uniffi::constructor]
pub fn new() -> Self {
Self {}
}
pub fn greeting(&self) -> String {
"Hello from JFFI".to_string()
}
pub fn process_data(&self, input: String) -> String {
format!("Processed: {}", input)
}
}
uniffi::setup_scaffolding!();For iOS:
jffi run --platform ios # Simulator
jffi run --platform ios --device ipad # Available iPad simulator
jffi run --platform ios --device iphone # Available iPhone simulator
jffi run --platform ios --device "iPad Pro 11-inch (M4)" # Exact simulator name
jffi run --platform ios --device --device-id <UDID> # Physical deviceFor Android:
jffi run --platform android # Emulator (auto-starts)For macOS:
jffi run --platform macosFor Linux:
jffi run --platform linuxFor Web:
jffi run --platform webFor Windows:
jffi run --platform windowsThis automatically:
- iOS/macOS: Compiles Rust, generates Swift bindings, creates Xcode project, builds and launches
- Android: Compiles Rust for 3 architectures, generates Kotlin bindings, starts emulator, builds APK, installs and launches app
- Linux: Compiles Rust, generates Python bindings, installs dependencies (GTK 4, build tools), builds and launches GTK app
- Web: Compiles Rust to WASM, generates JavaScript bindings, installs npm dependencies, starts Vite dev server
- Windows: Compiles Rust, generates C# bindings with uniffi-bindgen-cs, builds with MSBuild/dotnet, launches WinUI 3 app
platforms/ios/ContentView.swift:
Button("Refresh") {
greeting = core.greeting()
}The generated bindings make Rust functions available natively in Swift, Kotlin, C#, Python, and JavaScript.
JFFI works seamlessly with native IDE hot reload plus automatic Rust rebuilding.
# Start Rust file watcher
jffi dev --platform ios
# In Xcode:
# 1. Open platforms/ios/*.xcodeproj in Xcode
# 2. Run the app (Cmd+R)
# 3. Edit Swift files → Xcode hot reloads automatically ⚡
# 4. Edit Rust files → Watcher rebuilds dylib → Press Cmd+B in Xcode# Start Rust file watcher + Android Studio
jffi dev --platform android
# In Android Studio:
# 1. Press ▶️ to run the app
# 2. Edit Kotlin files → Compose hot reloads automatically ⚡
# 3. Edit Rust files → Watcher rebuilds .so → Rebuild in Android Studio# Start Rust file watcher
jffi dev --platform linux
# The app will auto-restart when Rust code changes
# 1. Edit Python/GTK files → Save and re-run
# 2. Edit Rust files → Watcher rebuilds .so → App auto-restarts ⚡# Start Rust file watcher + Vite dev server
jffi dev --platform web
# Vite provides hot reload for JS/CSS changes
# 1. Edit HTML/JS/CSS → Vite hot reloads instantly ⚡
# 2. Edit Rust files → Watcher rebuilds WASM → Refresh browserNote on Web Builds & C Compilers:
jffiautomatically unsetsCC_wasm32_unknown_unknownto prevent build failures if you have it set in your shell profile (e.g. foresp32development). If you need to override it, you can run:CC_wasm32_unknown_unknown=clang jffi dev --platform web
Native UI Changes:
- iOS/macOS: Edit
.swiftfiles → Xcode hot reloads instantly - Android: Edit
.ktfiles → Compose hot reloads automatically - Web: Edit
.js/.cssfiles → Vite hot reloads instantly - Use native IDE features (SwiftUI previews, Compose previews, etc.)
- Full debugging support
Rust Changes:
- Edit any
.rsfile incore/orffi/ - File watcher rebuilds Rust library automatically
- Rebuild in native IDE to use new Rust code
- App updates with new business logic
✅ Native IDE experience - Use all platform IDE features ✅ Native UI previews - SwiftUI/Compose previews work ✅ Native hot reload - Instant UI updates ✅ Rust auto-rebuild - No manual cargo commands ✅ Full debugging - Native debuggers work normally
# Create new project
jffi new <name> --platforms <platforms>
# Build for platform
jffi build --platform <platform>
jffi build --platform ios --device # Build for physical device
# Run on platform (builds automatically)
jffi run --platform <platform>
jffi run --platform ios --device --device-id <UDID> # Run on physical device
# Run a debug build with verbose JFFI output and Rust backtraces
jffi debug --platform <platform>
jffi debug --platform ios --device --device-id <UDID> # Verbose diagnostics on physical device
# Development mode (auto-rebuild on changes)
jffi dev --platform <platform>
# Add platform to existing project
jffi add <platform>
# Remove platform from existing project
jffi remove <platform>
# Show available commands and platform arguments
jffi --helpjffi build, jffi run, and jffi doctor do not install system packages. JFFI
may reconcile managed Rust tools such as uniffi-bindgen unless --no-setup or
--offline is set. Use jffi setup --platform <platform> when you want JFFI to
install missing platform tools. Use jffi new ... --no-build to scaffold a
project without installing tools or running its initial build.
New configuration files declare schema_version = 1. Unknown configuration fields are rejected so misspelled settings cannot be silently ignored.
┌─────────────────────────────────────────┐
│ Your Rust Business Logic │
│ (core/src/lib.rs) │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ UniFFI FFI Layer │
│ (ffi/src/lib.rs) │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Auto-Generated Bindings │
│ (Swift, Kotlin, C#, etc.) │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Native Platform UI │
│ (SwiftUI, Compose, WinUI, etc.) │
└─────────────────────────────────────────┘
jffi.toml is the checked-in source of truth for application metadata,
enabled platforms, native target settings, bundle formats, icons, and signing
references. Credentials and private signing material stay in the platform
keychain, CI secret store, or environment variables.
See the focused guides for the complete operating model:
- Configuration reference and ownership
- CI/CD and release pipelines
- Apple signing and multi-target applications
jffi.toml:
[package]
name = "my-app"
version = "0.1.0"
release_date = "2026-08-28"
[platforms]
enabled = ["ios"]
[platforms.ios]
deployment_target = "16.0"
bundle_id = "com.example.myapp"Apps containing extensions must map every signed bundle identifier to its own provisioning profile. JFFI writes this mapping into the iOS export options and lets the Xcode project retain target-specific archive signing settings:
[bundle.signing.profiles.ios-appstore.apple]
team_id = "YOUR_TEAM_ID"
method = "app-store-connect"
signing_certificate = "Apple Distribution"
provisioning_profiles = { "com.example.myapp" = "My App Store Profile", "com.example.myapp.ShareExtension" = "My Share Extension Profile" }provisioning_profile = "Profile Name" remains supported for single-target
apps. Do not use both forms unless the mapping is intended to take precedence.
| Feature | JFFI | Flutter | React Native |
|---|---|---|---|
| Business Logic | Rust | Dart | JavaScript |
| UI | Native | Cross-platform | Near-native |
| Performance | Native | Good | Good |
| Platform Feel | Native | Consistent | Near-native |
| Type Safety | End-to-end | Strong | Weak |
Use JFFI when:
- You want truly native UI and performance
- You have platform-specific design requirements
- You want to leverage native UI libraries
- You need Rust for business logic (performance, safety)
- Rust toolchain
- iOS: Xcode, iOS Simulator
- Android: Android Studio, Android SDK, Android Emulator (auto-configured)
- macOS: Xcode
- Linux: compiler, pkg-config, GTK 4, Libadwaita, Python 3, and Flatpak Builder (reconciled by
jffi setup --platform linuxon supported package managers) - Web: Node.js, npm (for Vite dev server)
- Windows: .NET SDK 8.0+, Visual Studio Build Tools or MSBuild
cargo build --package jffi
cargo run --package jffi -- --help- CLI tool foundation
- iOS support with SwiftUI
- macOS support with SwiftUI
- Android support with Jetpack Compose
- Linux support with GTK 4 + Python
- Web support with Vanilla JS + WASM
- Windows support with WinUI 3 + C#
- Automatic Xcode project generation
- Automatic Android project generation
- One-command build and run (iOS, macOS, Android, Linux, Windows)
- Hot reload for iOS (Xcode-native workflow)
- Hot reload for Android (Android Studio-native workflow)
- Hot reload for Linux (auto-restart workflow)
- Hot reload for Web (Vite hot reload)
- Automatic emulator/simulator management
- Auto-install build dependencies (targets, NDK, GTK, WASM, wasm-bindgen, uniffi-bindgen-cs, etc.)
- Full cross-compilation support (build any platform from any host)
- macOS -> Windows (via MinGW/Wine)
- Linux -> Windows (via MinGW/Wine)
- Linux -> macOS/iOS (via osxcross)
- Windows -> Linux (via WSL or cross-rs)
Early-stage framework. Contributions welcome!
High priority:
- Additional platform features and improvements
- State persistence (SQLite/local storage)
- Advanced UI components and patterns
- Hot reload for Windows (file watcher workflow)
GPL-3.0
- UniFFI - FFI bindings generator
- The Rust community
Built with and Rust
See native workflows for build outputs, release runs, device selection, signing, development reload behavior, and validation coverage.
Both commands accept the same selection options:
jffi run --platform ios --device ipad
jffi debug --platform ios --device iphone
jffi run --platform ios --device "iPhone Duo"
jffi run --platform ios --device "iPad Pro 11-inch (M4)"
jffi run --platform android --device emulator
jffi debug --platform android --device Pixel_Tablet
jffi run --platform android --device-id emulator-5554
jffi run --platform ios --device physical --device-id <UDID>
jffi run --platform android --device physical --device-id <ADB-SERIAL>For Android, use an exact AVD name from emulator -list-avds or a connected
serial from adb devices. A named AVD is reused if already running, or started
if stopped. --device emulator uses an existing emulator, or starts the first
available AVD. Multiple connected matches require an explicit selection.
For iOS, family selection prefers a booted matching simulator; exact names and
UDIDs are also accepted. If the simulator name is missing or ambiguous, run
xcrun simctl list devices available to check the installed simulators and use
jffi run --platform ios --device-id <SIMULATOR-UDID> to pick a specific one.
Bare --device still means a physical device.
Do not combine a named --device selector with --device-id.
macOS, Windows, Linux, and web run locally and do not accept device selectors.
Web builds regenerate ffi-web/src/lib.rs from the compiled UniFFI API, including
exported methods, objects, and standalone functions. JavaScript uses camelCase names, so Rust's
get_count() becomes core.getCount(). run, build, and Rust watch-mode
rebuilds use the same generator; new web projects start with a generated wrapper.
The generator creates matching WASM exports and TypeScript declarations for
UniFFI records, enums (including variant payloads), errors, exported object
references, type aliases, callback traits, UniFFI custom types, and nested Option, Vec, HashMap, and BTreeMap
values. No serde annotations need to be added to the native core: generated
wire conversion code lives in ffi-web. The required web-crate dependencies are
reconciled automatically.
| Rust API | JavaScript / TypeScript |
|---|---|
| record fields | Typed plain objects with camelCase field names |
| enum | Tagged union: { tag: "Variant", value: ... } |
Option<T> |
T | null |
Vec<T> |
Array<T> |
byte buffers (Vec<u8>) |
Uint8Array (JffiBytes) |
SystemTime |
bigint nanoseconds since the Unix epoch (JffiTimestamp) |
Duration |
Nonnegative bigint nanoseconds (JffiDuration) |
| maps | Map<K, V> |
u64, i64 |
bigint, preserving all integer bits |
Arc<ExportedObject> |
Live typed JS class with shared Rust state; call .free() when done |
Result<T, E> |
Returns T; throws Error with typed exported error data in .details |
| async methods and callbacks | Promise<T> |
callback traits (Box<dyn ...> / Arc<dyn ...>) |
Typed JS interfaces, callable in both directions |
custom_type! / custom_newtype! |
Named TS alias of the builtin representation, with native UniFFI validation and normalization |
Parameterized constructors are supported; alternate Rust constructors become
static camelCase factories. Async constructors, including new, become async
static factories (await Class.new(...)). Objects do not need a constructor
named new. Custom conversions reuse the core's FfiConverter
implementation with the same UniFFI version and tag; their logic is not duplicated
in JavaScript. Remote types and the default Into/TryFrom converter form are
supported too.
JavaScript callback objects must implement the exported camelCase methods. Rust
can retain them, return native trait implementations to JavaScript, or nest them
in records. JavaScript method receivers are preserved. self: Arc<Self> receivers
and callbacks with more than eight arguments are supported too. Async callback methods
accept Promises; both local and Send future modes are supported when matching the
core's UniFFI/async-trait configuration. Callbacks execute on the WASM instance's
event loop; this does not add browser worker/native-thread support.
A declared callback error is thrown as Error with its exported error value in
.details. Unexpected callback exceptions and invalid return values follow
UniFFI's native LiftReturn policy, including the core's
From<UnexpectedUniFFICallbackError> implementation. An infallible callback must
honor its return/exception contract, just as on native platforms.
Standalone #[uniffi::export] pub fn and async functions become top-level
camelCase JavaScript exports with generated TypeScript signatures, using the
same type and error conversions as object methods. A Core object is optional.
The exported contract is read from the compiled WASM library's UniFFI metadata (0.29.x and 0.31.x), after Rust resolves macros, includes, features, build scripts, and conditional compilation. The generated adapter calls UniFFI's exported C ABI symbols and uses the UniFFI wire format, object ownership rules, callback tables, and future protocol. It does not import the original Rust types or call Rust methods by source path. Private modules, private exported types/fields/functions, renamed exports, and arbitrary compiler-expanded legacy macros therefore need no public reexports or manual web adapters. This includes macros defined in dependencies.
Exported dependency types are included from compiled metadata, including custom types reached through transitive or renamed dependencies and separate workspaces. The adapter links Core's existing dependency graph; it does not add direct imports of those dependencies. Custom validation/normalization and unexpected callback error conversion run in the original UniFFI scaffolding. Conflicting public type names are qualified with their metadata namespace. Only APIs actually exported by UniFFI are included; ordinary private Rust helpers remain internal.
Disabled declarations disappear from JavaScript and .d.ts on the next build.
Generic APIs and external types without UniFFI metadata/custom mappings require
an explicit adapter. Platform-specific Rust APIs must themselves work on wasm32;
code generation cannot supply native OS facilities or browser worker support.
On Rust's wasm32-unknown-unknown target, SystemTime cannot represent pre-epoch
timestamps; those inputs return a type error. Nanoseconds and large durations
otherwise remain exact. UniFFI 0.31.1 requires its
wasm-unstable-single-threaded feature for WASM futures; the suite tests that
supported mode and tests both local and Send future modes with 0.29.4.
The compatibility suite compiles real WASM, generates and loads native UniFFI Python bindings, compares normalized results across both runtimes, type-checks valid/invalid TypeScript calls, tests native Rust behavior, and checks removal of exports after feature/profile/source changes. CI runs it for 0.29.4 and 0.31.1:
JFFI_TYPESCRIPT_TSC=/path/to/typescript/lib/tsc.js \
cargo test -p jffi --test web_bindings_wasm -- --ignored --nocapture
# To exercise the current metadata format, put matching uniffi-bindgen on PATH:
JFFI_COMPAT_UNIFFI_VERSION=0.31.1 JFFI_TYPESCRIPT_TSC=/path/to/typescript/lib/tsc.js \
cargo test -p jffi --test web_bindings_wasm -- --ignored --nocaptureIt requires Node, Python, the wasm32 Rust target, wasm-pack, matching
uniffi-bindgen, and wasm-bindgen-cli 0.2.129. TypeScript checks run when
JFFI_TYPESCRIPT_TSC is supplied; CI always supplies it. An optional absolute
JFFI_WASM_TEST_TARGET_DIR reuses a build cache. Regular unit tests do not install
or invoke these tools. The suite defines tested compatibility coverage rather
than claiming every possible Rust/UniFFI API has been verified.
The original greeting-only JFFI scaffold is migrated automatically. Custom
wrappers are preserved: back up and remove ffi-web/src/lib.rs to opt into
generation. Edit exported methods in core/src, not the generated wrapper.
UI elements and event handlers remain application code.