Cargo Features

[dependencies]
hai_core = { version = "0.5.2", default-features = false, features = ["desktop", "js_runtime", "quickjs", "text", "v8", "video", "web"] }
default = desktop, js_runtime, quickjs

These default features are set whenever hai_core is added without default-features = false somewhere in the dependency tree.

desktop default

Enables tokio, desktop of hai_pal

js_runtime default

Affects node::Node.update_properties, utils::convert, utils::dispatch_event, hai_core::ops, hai_core::spawn_runtime_with_core, hai_core::spawn_runtime_with_core, ops::init, ops::init

quickjs default = hai_runtime

Enables quickjs of hai_macros

Affects convert::JSValue, convert::from_js, convert::to_js, hai_core::spawn_runtime_with_core, ops::init

text

Enables huozi ^0.4

v8 = hai_js_runtime

Enables v8 of hai_macros

Affects convert::JSValue, convert::from_js, convert::to_js, hai_core::spawn_runtime_with_core, ops::init

video

Enables ffmpeg-rs

web

Enables pollster ^0.2.5, serde-wasm-bindgen ^0.4, wasm-bindgen, wasm-bindgen-futures, and web-sys, web of hai_pal and webgl of wgpu ^0.19.1

wgpu:

Enables the GLES backend on Wasm

* ⚠️ WIP: Currently will also enable GLES dependencies on any other targets.

Affects hai_core::spawn_runtime_with_core, system::load_resources, convert::JSValue, convert::from_js, convert::to_js, hai_core::ops

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

hai_js_runtime v8?
hai_runtime quickjs