Repository navigation
Conversation
Changed Files
|
Contributor
|
| Project | Bevy Scripting |
| Branch | agent/reactive-ui-script-props |
| Testbed | linux-gha |
⚠️ WARNING: Truncated view!The full continuous benchmarking report exceeds the maximum length allowed on this platform.
🐰 View full continuous benchmarking report in Bencher
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
This was referenced Nov 13, 2026
…rops # Conflicts: # assets/benchmarks/reactive_ui/closures.lua # assets/benchmarks/reactive_ui/paths.lua # assets/tests/reactive_ui/inventory/inventory.lua # crates/bevy_mod_scripting_reactive_ui/src/lib.rs
This was referenced Nov 13, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Functions of the reactive ui can take dependencies: values handed back to them as their first arguments, instead of captured.
computed(f, deps),effect(f, deps),show(f, deps),list(items, f, deps){ f, a, b }element(Def, f, deps, key)renders a component withf(deps..)instead of a props tableWhy: closures of Rune can only capture numbers and strings when handed to Rust (
rune_function_to_script), not signals or entities, so without this a Rune component can only share state through the per-scriptstate()store, one instance per component. In Lua it is optional, captures work as before.This replaces the Lua only "function instead of props" of the first version of this PR (that form still works in Lua, it is
element(Def, f)without dependencies).Cost, same binary, 3 rounds, the Closures ui with every function taking dependencies instead of capturing:
The cost is the references (signals, entities) converted on every call, about ten per slot when mounting. A first version with a
ui.callback(f, deps)function was +55%, each one being its own call into Rust, hence the list form. So: capture where the language can, and use row templates for large lists, which need neither.