Repository navigation
Conversation
Changed Files
|
Contributor
|
| Project | Bevy Scripting |
| Branch | agent/reactive-ui-templates |
| 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.
…templates # Conflicts: # assets/tests/reactive_ui/inventory/inventory.lua # crates/bevy_mod_scripting_reactive_ui/src/expr.rs # crates/bevy_mod_scripting_reactive_ui/src/lib.rs # crates/bevy_mod_scripting_reactive_ui/src/runtime.rs
…templates # Conflicts: # 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.
Draft: the API below is a first cut, see the open choices.
ui.list_template(items, function(item) .. end): alistwhose function runs once for the whole list.itemstands for the item of each row, thenodes andtexts the function returns are a template, and every row is made from it in Rust: no script code runs per row.How a row is made (
bind_template):Expr::bind):itembecomes the item,path(watch_item(..))reads a watch of the row's entity (owned by the row, removed with it),selected(selector, value)reads its key from the row once. A bound value which reads nothing is a plain property, spawned with the entity.Works with closures restricted to capturing constants (Rune), as nothing has to capture the item. Lua only tests and benches, as the rest of the crate.
Open choices:
nodeandtextonly: components and regions inside a template are an error (they run script code per instance)watch_itemneeds the items to be entities. Items which are plain values work withitemitself (format("{}", { item }),selected(selector, item))whenlist_templatefunction, rather than a flag or a wrapper aroundlist's functionStacked on #724. Same binary, 3 rounds (new
Templatebench variant, the Paths ui with a templated list):The two slower rows are the bench's own choices, not the template: its list holds 200 entity references instead of 200 strings (costlier to pass to Rust and back), and its click handler reads the item's name from the component.