Skip to content

feat: reactive ui built on signals - #714

Draft
makspll wants to merge 5 commits into
agent/reactive-ui-corefrom
agent/reactive-ui-signals
Draft

makspll wants to merge 5 commits into
agent/reactive-ui-corefrom
agent/reactive-ui-signals

Conversation

@makspll

@makspll makspll commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

bevy_mod_scripting_reactive_ui: script described bevy_ui trees built on signals (components run once, bound props and dynamic regions re-run, reload keeps state). Follows the prototype comparison in #712.

  • flush: cached interaction query, watches polled once per flush, idle flushes skipped
  • push-pull computed (readers only wake when the value changed), ui.selector
  • ui.path/format/percent/lt/mul/select/is: properties computed in Rust, no script code or context entry when they update

Landing order: #713 (core, required) → this PR → optimisations (#719 mounting, #723 ui.each, #724 props kept in the script, Lua only) → row templates. The Lua conversion PRs (#720, #721) are independent of this stack.

Measured before #717 and the later PRs, see those for current numbers:

scenario closures paths
health tick 12.2 µs 8.0 µs
inventory item count 10.4 µs 4.3 µs
inventory select (200) 28 µs 24 µs
inventory search 2.75 ms 2.88 ms
mount/unmount 200 3.0 ms 3.2 ms
idle 2.4 µs 2.4 µs

(before the flush/selector fixes: health 16.1 µs, select 341 µs, item count 12.7 µs)

@makspll
makspll added this pull request to stack #715 November 12, 2026 22:24
@semanticdiff-com

semanticdiff-com Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectBevy Scripting
Branchagent/reactive-ui-signals
Testbedlinux-gha

⚠️ WARNING: Truncated view!

The full continuous benchmarking report exceeds the maximum length allowed on this platform.

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

🐰 View full continuous benchmarking report in Bencher

@makspll
makspll removed this pull request from stack #715 November 13, 2026 00:31
@makspll
makspll added this pull request to stack #718 November 13, 2026 00:31
Adds bevy_mod_scripting_reactive_ui: script described bevy_ui trees where
components run once, bound properties and dynamic regions re-run when the
signals they read change, and reloads keep component state.
- keep the interaction query between flushes, poll watched components once
  per flush (again only after handlers or effects ran), skip idle flushes
- computeds only wake their readers when their value changed (push-pull)
- ui.selector: selector:is(key) only re-runs the readers of the old and
  new key, so selecting in a list re-runs two items instead of all
ui.path, ui.format, ui.percent, ui.lt, ui.mul, ui.select and ui.is build
UiValues: properties made of them know what they read up front and update
without running script code or entering the script's context.
component, element, render, show, when, selected, background_color, flex_direction.
select and is are keywords in Rune.
@makspll
makspll force-pushed the agent/reactive-ui-signals branch from 865ded4 to 8640516 Compare November 14, 2026 16:59

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant