Getting started

In your own crate

Replace the v8 dependency with v8x and pick an engine feature:

[dependencies]
v8 = { package = "v8x", version = "149.4.0", features = ["quickjs"] }

Engine features are mutually exclusive; enable exactly one:

featureenginenotes
quickjsQuickJS-ng, vendored + staticworks everywhere, ~1 MB, fastest build
jscWebKit JSCOnly, built from sourcemacOS; shippable, JIT-enabled
system_jscApple’s JavaScriptCore.frameworkmacOS; zero engine bytes in your binary

Your code keeps using the v8 crate API: v8::Isolate, v8::Local, handle scopes, all of it. Nothing else changes.

Under Deno

Patch the workspace instead, so deno_core and everything above it picks up the swap:

# deno's workspace Cargo.toml
[patch.crates-io]
v8 = { package = "v8x", version = "149.4.0", features = ["jsc"] }
cargo build -p deno

deno_core compiles unchanged; the resulting binary runs your JS on the engine you selected.

macOS note: JIT entitlements

JavaScriptCore’s JIT needs permission to allocate executable memory. Binaries using the jsc backend must be codesigned with the JIT entitlement:

codesign -s - -f --entitlements tools/jit-entitlements.plist ./your-binary

The system_jsc and quickjs backends don’t need this. The test harness in the v8x repo does it automatically.

Building from the repo

git clone --recursive https://github.com/littledivy/v8x
cd v8x
cargo build --no-default-features --features quickjs   # no engine build step
cargo build --features jsc                             # builds WebKit from source

The first vendored JSC build compiles WebKit’s JSCOnly target, which takes a while. QuickJS builds in seconds.