BSN: changing prefixes for Template and SceneComponent to allow removing confusing "inheritance" concept#24367
Merged
Merged
Conversation
Contributor
Author
|
CI is expected to fail for a while, until all tests, uses, etc are migrated. Will likely impact currently open PRs which use BSN, as it changes syntax, unless they don't use |
…h lib.rs files are left out as their docs are undergoing a major rework
…sly part of "inheritance"
cart
approved these changes
May 21, 2026
Member
cart
left a comment
There was a problem hiding this comment.
This is a solid step forward! Just pushed a minor tweak.
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Contributor
|
From Discord :
~Thing
-ThingThese are visually very similar, it might be worth considering a different symbol as followup |
Zeophlite
reviewed
May 21, 2026
Zeophlite
approved these changes
May 21, 2026
Contributor
Zeophlite
left a comment
There was a problem hiding this comment.
i think this greatly improves developer intuition on the concept
mockersf
approved these changes
May 21, 2026
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.
Objective
Changes discussed with cart:
:will not be called "inheritance" anymore, but instead "cacheable" (name not final)@->~:->@:prefix is allowed in front of@SceneComponentas well, marking it as being cachedLink to the discord thread, specifically my recap message.
The exact reasoning is in the linked discord discussion, but the tldr is:
"Inheritance" as a term for the ":" syntax didn't really fit what bsn was doing, since scenes without
:produce the same result. All:is, is a way to say "cache this pls" with the design of bsn imposing the limitation that only the first scene can be cachedThat was all fine, except for one case: Disambiguating SceneComponents from normal components. So if we redefine
:to just mean "caching" we needed to untangle it from SceneComponents. That means disambiguating SceneComponents needed a different syntax, and the decision ended up being to take the @ prefix from the much less common@Templateusecase, sinceSceneComponent {@prop: val}already used @ as well and introduce a new prefix to replace@Templateinstead, replacing it with~Template.Solution
Implement these changes in macros.
Notably, this still doesn't implement/enable caching right now.
Most docs are updated, except for the big blocks in
bevy_scene/src/lib.rsandbevy_scene/macros/src/lib.rssince i've been working on reworking those on another branch and didn't want to duplicate whats already been a lot of work and likely to be a bunch moreTesting
bevy_scenetests passingcargo check --workspaceandcargo check --workspace --examplespassingSince this PR does not yet enable caching, I think passing the current tests should be enough.