bevy_react_core 0.7.0

The core bridge of bevy-react (drive bevy_ui from React over an embedded V8 runtime). Apps depend on the `bevy-react` crate.
[package]
name = "bevy_react_core"
version.workspace = true
edition.workspace = true
description = "The core bridge of bevy-react (drive bevy_ui from React over an embedded V8 runtime). Apps depend on the `bevy-react` crate."
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
readme = "../../README.md"
keywords = ["bevy", "react", "ui", "gamedev", "gui"]
categories = ["gui", "game-development"]

# docs.rs documents the default (native) target. `rusty_v8` (via deno_core) skips
# its network V8 download when the `DOCS_RS` env var is set, so the native build
# succeeds without network access.
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lib]
name = "bevy_react_core"
path = "src/lib.rs"

# The devtools inspector (auto-registered by `ReactUiPlugin`, `<root>`-hosted
# panel). A default feature: consumers get devtools in dev builds with zero
# setup (the plugin is inert in `--release` builds); size-conscious release
# builds compile it out with `default-features = false`.
[features]
default = ["devtools"]
devtools = []
# Named custom image cursors (`ReactUiPlugin::cursor`). Turns on
# `bevy/custom_cursor`, which pulls in `bevy_winit` — so a build with it needs
# a winit backend (`bevy/x11` or `bevy/wayland` on Linux; every windowed app
# has one). Not a default here, so a standalone core build/test stays
# winit-free; the `bevy-react` facade turns it on by default.
custom_cursor = ["bevy/custom_cursor"]
# SVG `<text>` support in file-mode SVGs (`<image src="x.svg">`): pulls in
# usvg's font machinery (fontdb + a system-font scan). Off by default — most
# icon/illustration SVGs have no text. usvg splits the two halves: `text` is
# shaping (fontdb + rustybuzz), `system-fonts` is fontdb's filesystem scan —
# loading system fonts needs both.
svg_text = ["usvg/text", "usvg/system-fonts"]
# The headless op harness (`bevy_react_core::test_util`) for a feature crate's
# own tests: unstable, dev-dependency only.
test_util = []

[dependencies]
accesskit = { workspace = true }
# Exactly what the code references (no transitive shortcuts: the list
# documents what the crate touches and survives bevy reshuffling its feature
# graph). Cargo unifies features, so each of these also decides what the
# app's `DefaultPlugins` contains — never add one the code doesn't need.
bevy = { workspace = true, features = [
    "std",
    "bevy_asset",
    "bevy_image",
    "bevy_color",
    "bevy_window",
    "bevy_camera",
    "bevy_mesh",
    "bevy_shader",
    "bevy_render",
    "bevy_core_pipeline",
    # Only for the camera gate's ordering against
    # `UpdateDirectionalLightCascades` (plugin.rs) — required, not optional:
    # our `cfg` can't see the app's bevy features, and an app with 3D lights
    # needs the ordering.
    "bevy_light",
    "bevy_ui",
    "bevy_ui_render",
    "bevy_ui_widgets",
    "bevy_input_focus",
    "bevy_text",
    "bevy_picking",
    "keyboard",
    "mouse",
    "touch",
    "gamepad",
    # Not referenced by the code, but bevy-react is broken without them at
    # runtime: no UI pointer hits (no clicks/hover), invisible text unless a
    # font is configured, and `<editableText>` copy/paste confined to the app.
    "ui_picking",
    "default_font",
    "system_clipboard",
] }
bevy-react-macros = { workspace = true }
bytemuck = { workspace = true }
crossbeam-channel = { workspace = true }
resvg = { workspace = true }
erased-serde = { workspace = true }
smallbox = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tiny-skia = { workspace = true }
usvg = { workspace = true }
tracing = { workspace = true }
# `no-serde-warnings`: the `#[react_*]` macros route serde through
# `#[serde(crate = "…::__private::serde")]` (so callers need no direct serde
# dependency), and ts-rs 10's serde-compat parser warns on that key at every
# expansion. ts-rs 12 parses it silently — drop the feature on upgrade.
ts-rs = { workspace = true, features = ["no-serde-warnings"] }

# Native host: the embedded V8 isolate (deno_core) on a dedicated thread, driven by
# a tokio current-thread runtime. Neither builds for wasm.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
deno_core = { workspace = true }
deno_error = { workspace = true }
tokio = { workspace = true }

# Web host: React runs in the browser's own engine, reached over wasm-bindgen.
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { workspace = true }
wasm-bindgen-futures = { workspace = true }
js-sys = { workspace = true }
serde-wasm-bindgen = { workspace = true }
web-sys = { workspace = true, features = ["console"] }
console_error_panic_hook = { workspace = true }
# Bevy/rand pull `getrandom`; on wasm it needs the browser backend enabled (the
# `wasm_js` feature plus `--cfg getrandom_backend="wasm_js"`, set in .cargo/config.toml).
getrandom = { workspace = true, features = ["wasm_js"] }

[dev-dependencies]
# Parse/validate the crate's WGSL in unit tests. Already in the dependency
# tree via bevy's wgpu; the version requirement must keep resolving to that
# same copy.
naga = { version = "29.0", features = ["wgsl-in"] }
tokio = { workspace = true }