Cargo Features

[dependencies]
rustate = { version = "0.3.0", default-features = false, features = ["codegen", "xstate-compat", "mbt", "property-testing", "wasm", "proto", "integration", "tokio", "getrandom"] }
default = serde_json, tokio

Add serde_json to default features

codegen = proc-macro2, quote, serde_json, syn

Affects codegen::CodegenExt.parse_from_rust_file, codegen::machine_builder_to_json, codegen::generate_rust_code, rustate::codegen, codegen::machine_builder_to_proto

xstate-compat = serde_json
mbt
property-testing = proptest, rand
wasm = console_error_panic_hook, js-sys, serde-wasm-bindgen, wasm-bindgen, wasm-bindgen-futures

Add serde-wasm-bindgen and wasm-bindgen-futures

Affects rustate::wasm

proto = prost, prost-types

Affects codegen::CodegenExt.export_to_proto, codegen::machine_builder_to_proto

integration

Add integration feature

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.

serde_json default codegen? xstate-compat?

Enables serde_json

Keep optional for feature consistency, but default enables it

tokio default

Enables tokio

Ensure features needed are here

syn codegen?

Enables syn

Codegen feature deps
Enable full and parsing features

quote codegen?
proc-macro2 codegen?
prost proto?

Enables prost ^0.12

Proto feature deps

prost-types proto?

Enables prost-types ^0.12

wasm-bindgen wasm?

Enables wasm-bindgen

WASM feature deps

js-sys wasm?
console_error_panic_hook wasm?
serde-wasm-bindgen wasm?

Enables serde-wasm-bindgen

Add serde-wasm-bindgen

wasm-bindgen-futures wasm?

Enables wasm-bindgen-futures

Add wasm-bindgen-futures

rand property-testing?

Enables rand ^0.8

getrandom implicit feature

Enables getrandom ^0.2

Needed for rand on wasm

proptest property-testing?

Enables proptest

Property testing feature deps