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.
//! The wire protocol shared between the JS reconciler and the Bevy side.
//!
//! Everything here derives `serde`. Ops only ever flow JS -> Rust — as ONE
//! `JSON.stringify`ed batch per commit, decoded with `serde_json` (see
//! `js_thread::op_flush` for why that beats a per-property `serde_v8` walk) —
//! so they need `Deserialize` only; `UiEvent` flows Rust -> JS (via `serde_v8`
//! natively) and is `Serialize`.
//!
//! Wire strings are decoded **once, here at the serde boundary** — never
//! re-parsed on apply. The unit-bearing types (`Length`/`Angle`/`Time`/
//! `FontSize`) parse into their own wire types, and the keyword-valued style
//! properties (`display`/`align*`/`flex*`/grid tracks/…) decode directly into
//! the `bevy_ui`/`bevy_text` values they drive (their codecs wrap the decoders
//! here — see [`crate::style`]), so a style writer copies the value as is. A malformed string must **not** fail the whole batch
//! (one typo would abort the entire commit and trigger a reload), so every
//! deserializer falls back to the bevy default and emits a
//! `tracing::warn!` naming the bad value (`tracing` reaches the same log sink
//! `bevy_log` drains). In dev builds with devtools those fallbacks are also
//! collected as structured `crate::diag` entries (`decode_warn` +
//! [`op::OpBatch`]'s per-op attribution) so the inspector can flag the offending
//! style/prop rows.

pub mod animatable;
pub mod background_image;
pub mod grid;
pub mod keywords;
mod merge;
pub mod op;
pub mod outbound;
pub mod props;
pub mod transform;
pub mod units;
pub mod visual;

/// Stable identity for a node, assigned by the JS reconciler. `0` is reserved
/// for the root container (the Bevy UI root entity).
pub type NodeId = u32;

pub const ROOT_ID: NodeId = 0;

/// Emit a decode-fallback warning: the terminal `warn!` (deduped per distinct
/// message — [`crate::diag::log_warn`]) plus, in dev builds with devtools, a
/// structured [`crate::diag`] entry so the inspector can flag the row. `kind`
/// names the value's domain (`"length"`, `"rect"`, a keyword field's kind, …);
/// `value` is the raw offending wire string.
pub fn decode_warn(kind: &'static str, value: &str, message: &str) {
    crate::diag::decode_report(kind, value, message);
}