Skip to content

superui v0.3.6 (bevy 0.19)

Choose a tag to compare

@strowk strowk released this 10 Oct 12:27
· 39 commits to main since this release

Added

  • <img> tag: reconciled into a bevy_ui ImageNode. src resolves relative to
    the document's own directory (recorded on UiRuntime as its base dir, the same
    way CSS and JS links already resolve), loads as a Handle<Image>, and is
    load-guarded so a stable src loads only once. Sizing is CSS-driven
    (NodeImageMode::Auto); object-fit is intentionally out of scope until
    bevy_ui gains fit modes.
  • cargo superui test: the end-to-end test runner is now included as a subcommand
    of the CLI.
  • UiRuntime::take_errors: drains uncaught JavaScript evaluation errors captured
    since the last call. Previously these were logged and discarded; now apps and
    tooling can read them to surface a failing author script.
  • transpiler cargo feature on superui: compiles the oxc .tsx transpiler into
    the build (including wasm), enabling in-browser transpilation for live
    playgrounds.
  • page.emit(name, value) in the end-to-end test engine: a spec can deliver a
    game→UI bridge event to the UI's bevy.on(name, …) handlers (the counterpart
    of the game's commands.trigger), so a headless test with no game side can
    drive and assert the UI's reaction to bridge data.
  • .json imports: import x from "./data.json" — default, import * as x, and
    import { x } all bind the whole value — inlines the file's parsed value as
    a top-level const x, resolved relative to the importing file. Only the
    whole value binds; picking a sub-path or member out of the JSON is out of
    scope, and other cross-file imports are still stripped. A missing or invalid
    file is fatal in the end-to-end test engine (the spec fails to transpile)
    and a skipped-binding warning everywhere else (runtime/HMR and build);
    editing the JSON hot-reloads the .tsx that imports it.

Changed

  • cargo-superui parses its arguments with argh instead of hand-rolled flag
    parsing.
  • Test engine --ui mode: specs are shown as a tree with their tests nested
    underneath; each spec header carries a status icon (spinner while running,
    check/cross once finished, hollow dot when not yet run) and each test a
    pass/fail icon. Time-travel now records a frame per step, so the slider moves
    the rendered image together with the DOM, and selecting a test jumps to its
    final step. The shell starts at a slightly larger zoom.

Fixed

  • The test engine now loads images, fonts, and class utilities, so
    screenshot-based end-to-end tests render the same as the running app.