Skip to content

Write crate docs for bevy_scene2 / BSN#23604

Merged
alice-i-cecile merged 11 commits intobevyengine:mainfrom
alice-i-cecile:bsn-docs
Apr 1, 2026
Merged

Write crate docs for bevy_scene2 / BSN#23604
alice-i-cecile merged 11 commits intobevyengine:mainfrom
alice-i-cecile:bsn-docs

Conversation

@alice-i-cecile
Copy link
Copy Markdown
Member

Objective

The existing crate docs merged in #23413 were minimalistic.

This is not ideal, as there's a ton of complex, interconnected features that are important to explain.
In particular, we want to explain how all of these types, traits and concepts relate to each other
and the broad picture of both "how should you use this crate" and "why does this even exist".

Crate docs are the ideal home for this.

Solution

Write 400 lines of crate docs. Easy.

I am still relatively new to BSN: I haven't had a chance to use it in my projects yet either! Please keep an eye out for both technical and conceptual errors.

Thankfully, the PR description from #23413 was extremely detailed, laying out the architectural context and broader patterns.
The docs on each item, the tests, and to a lesser extent the old design discussions #9538 and #14437 were also very useful.

Notable editorial choices

  • relatively high on hype for technical documentation
    • users need to understand why the complexity is useful, ideally without tripping over these problems themselves
    • we really want users to actually use bsn! (and .bsn): the experience is better and standardization is powerful
  • intro uses the dreaded "object" word: calling things with multiple entities an "entity" is flatly confusing
    • also very useful for translating the BSN model for users of other engines
  • drops users immediately into a Quick Start guide
    • some folks find it extremely useful to see a simple working example before getting the explanation
  • explicitly calls out the asset format as future work
    • this is a major, important feature. It's important to acknowledge its absence, and offer workarounds for now.
    • having some information about how it's likely to work allows people to plan effectively.
  • I spent a lot of time trying to carefully explain the differences between the composition strategies
    • this mentions asset-format BSN, because it's a primary driver of why we need inheritance
  • explaining the FromTemplate / Default distinction was hard but important
  • gave an explicit bolded warning about the lack of field overrides
    • I did not call out horrible specialization hack: far too distracting in the crate docs

Important omissions and divergences from past discussions

  • GetTemplate was renamed to FromTemplate
  • Construct is now Template and FromTemplate
  • reactivity (not yet implemented)
  • scene composition as a styling/composition alternative (belongs in the bevy_feathers crate docs later)

@alice-i-cecile alice-i-cecile added this to the 0.19 milestone Mar 31, 2026
@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-Scenes Composing and serializing ECS objects X-Contentious There are nontrivial implications that should be thought through D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 31, 2026
@alice-i-cecile
Copy link
Copy Markdown
Member Author

@NicoZweifel, you're one of the most familiar with BSN currently; I would appreciate your review here as well.

@jbuehler23
Copy link
Copy Markdown
Contributor

I’m currently off on holiday until Friday evening, but am happy to take a look at this then - if this is not immediately urgent!

Copy link
Copy Markdown
Contributor

@urben1680 urben1680 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read that as someone who never touched scenes and even assets rarely. I skipped the BSN PR(s) because I was overwhelmed by it, lacking the prior experience with the matter. I guess that makes me an ideal person to review this. 🙃

All in all I found this very informative and questions I had in my head were all answered. I just wrote comments on things I did not fully understand so maybe these can be improved.

Copy link
Copy Markdown
Contributor

@cookie1170 cookie1170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

github-merge-queue bot pushed a commit that referenced this pull request Mar 31, 2026
# Objective

While writing docs in #23604, I was wondering if closures and comments
worked, especially after @urben1680's review comments.

It's not immediately obvious that they should, and it's easy to break
macros and parsing.

## Solution

Add some simple tests to verify that this does in fact work!
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 31, 2026
@alice-i-cecile
Copy link
Copy Markdown
Member Author

I've gotten quite a bit of feedback at this point (thanks y'all!). Merging; we can improve on this more in follow-up <3

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 31, 2026
Merged via the queue into bevyengine:main with commit c3d9ebe Apr 1, 2026
40 checks passed
@NicoZweifel
Copy link
Copy Markdown
Contributor

NicoZweifel commented Apr 1, 2026

I've gotten quite a bit of feedback at this point (thanks y'all!). Merging; we can improve on this more in follow-up <3

I'll leave this here for future reference:

To expand on what @jasmine-nominal said, I think it would be good if the examples focused on things that you can't do or are hard/inconvenient without bsn, e.g.:

  • composition
  • inheritance
  • templates
  • patching

I know it is hard to put these into simple examples/few words but I think this is where the high value is at.

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

Labels

A-Scenes Composing and serializing ECS objects C-Docs An addition or correction to our documentation D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Contentious There are nontrivial implications that should be thought through

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants