Files
raea/runtime/js/Cargo.toml
shinyobjectz ee42e31469 NB2a: stat channels and pass timings chosen and read from TypeScript
io/trace's stats.rs: a stat channel is a RAEA_ variable's name without RAEA_ (bake_trace, trace, bevy_passes), on
when the composition chose it (native("stats.on", { channels }) at its top level), when RAEA_STATS lists it, or when
its variable is set, the override. The 51 reads of 24 trace and stat variables go through raea_io_trace::stat. Each
of Bevy's render passes (RenderDiagnosticsPlugin, on by bevy_passes) and PassTimer's go into the run's totals, with
the counters engine/draws and engine/updates; native("stats.read", {}) returns them, and a run that chose a channel
prints the table and keeps stats.json in its trace folder (docs/manual/reference/cli/traces.md).

tools/nobuild.sh stats checks it: every channel decided done reads through stat(); the scene choosing bevy_passes and
trace traces, reads 9 passes and 11 draws back on its last frame, prints the table and keeps stats.json; with nothing
chosen nothing prints; RAEA_TRACE=1 and RAEA_STATS give the same trace lines. 12 frames take 12 updates.

raea-render's lines stay as they were (NB4a's plugin choice folded to one line). native-calls.ts gains the two calls,
and bevy.app.*, which raea registers now that the macOS build links the plugin catalog.
2026-11-22 09:15:58 -08:00

48 lines
2.3 KiB
TOML

[package]
name = "raea-runtime-js"
version = "0.1.0"
edition = "2024"
license = "FSL-1.1-ALv2"
publish = false
description = "TypeScript running natively in a Bevy app under raea's Blitz page: the JS engines (JavaScriptCore on Apple, QuickJS elsewhere), the op wire, native calls, the World API, and the page's media, canvas, 3D view and accessibility pieces"
[lib]
name = "raea_runtime_js"
[features]
default = ["media"]
# the portable engine (QuickJS) on Apple too, in place of JavaScriptCore: how the portable path is tested on a Mac
portable = ["raea-runtime-jsengine/portable"]
# media (docs/ts-native.feature P15): video and sound through raea-io-media
media = ["dep:raea-io-media", "dep:cpal"]
[dependencies]
raea-io-trace = { path = "../../io/trace" }
# images
bevy = { version = "=0.20.0", default-features = false, features = ["std", "default_app", "bevy_render", "bevy_image"] }
dunce = "1"
# the op wire to and from a page's script
raea-core-wire = { path = "../../core/wire" }
raea-io-net = { path = "../../io/net", features = ["ws"] }
# the net.* calls, answered as the native target answers them (docs/targets.feature T2a)
raea-io-net-calls = { path = "../../io/net/calls" }
# os.open, the clipboard, files and dialogs, answered as the native target answers them (docs/targets.feature T2d)
raea-io-os = { path = "../../io/os" }
# the world API: BRP's methods run in-process, watched reads (shared with every raea runtime)
raea-bevy-world = { path = "../../engine/bevy-world" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# the JS engine (JavaScriptCore on Apple, QuickJS elsewhere)
raea-runtime-jsengine = { path = "../jsengine" }
# video and audio elements' sources decoded (src/media_html.rs): the app's backends, else the ffmpeg CLI's
raea-io-media = { path = "../../io/media", default-features = false, optional = true }
# a playing video's or audio's sound out of the device (src/media_sound.rs), the cpal the mixer and the legacy app use
cpal = { version = "0.15", optional = true }
# webaudio's samples across the wire
base64 = "0.22"
# the HTML runtime bundled in process (html_page.rs): raea's files where an install or this checkout has them, and
# raea-bundle's library loaded beside the binary
raea-io-home = { path = "../../io/home" }
raea-runtime-bundle = { path = "../bundle" }