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

Rust-powered JavaScript runtime for Flutter. JSC on Apple, QuickJS elsewhere, host JS on web.

flutter_jolt #

pub.dev CI

Flutter plugin for Jolt — a Rust-powered JavaScript runtime that picks the best engine per platform.

Platform Engine Bundle cost
iOS / macOS JavaScriptCore 0 (system framework)
Android / Linux / Windows QuickJS ~1 MB
Web Host browser JS 0

Usage #

import 'package:flutter_jolt/flutter_jolt.dart';

// Initialize once (in main)
await RustLib.init();

// Create a runtime
final rt = JoltRuntime();

// Evaluate JavaScript
final result = await rt.eval(code: '1 + 1');

// Globals
await rt.setGlobal(name: 'x', value: JsValue.int_(42));
final x = await rt.getGlobal(name: 'x');

// Call JS functions
await rt.eval(code: 'function greet(n) { return "Hello, " + n; }');
final greeting = await rt.callFunction(
  name: 'greet',
  args: [JsValue.string('Flutter')],
);

Installation #

dependencies:
  flutter_jolt: ^0.1.0

Requires Rust toolchain for native compilation. The plugin uses Cargokit to build Rust code automatically during flutter build / flutter run.

License #

MIT — see LICENSE.

1
likes
120
points
68
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Rust-powered JavaScript runtime for Flutter. JSC on Apple, QuickJS elsewhere, host JS on web.

Topics

#javascript #runtime #ffi #rust

License

MIT (license)

Dependencies

flutter, flutter_rust_bridge, freezed_annotation, plugin_platform_interface

More

Packages that depend on flutter_jolt

Packages that implement flutter_jolt