Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose access to SubApps within App #16952

Conversation

LikeLakers2
Copy link
Contributor

@LikeLakers2 LikeLakers2 commented Dec 24, 2024

Objective

SubApps is visible within the documentation for bevy_app. However, no way of accessing the SubApps field in App is currently available.

Solution

Expose two new functions, App::sub_apps() and App::sub_apps_mut(), which give immutable and mutable access to SubApps respectively.

The other solution is to hide SubApps, which I submitted as a PR at #16953.

Testing

Because of the simplicity of the changes, I only tested by compiling bevy_app - which compiled successfully.

Note: SubApps, and its corresponding field on App, are not used outside of bevy_app - which means that compiling the other crates is not necessary.

@BenjaminBrienen BenjaminBrienen added C-Feature A new feature, making something new possible S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it A-App Bevy apps and plugins D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Dec 24, 2024
@alice-i-cecile
Copy link
Member

I still think that subapps need a real design doc rethink, but given that it's here we may as well expose it for now.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 24, 2024
Merged via the queue into bevyengine:main with commit 4a681c3 Dec 24, 2024
33 checks passed
@LikeLakers2 LikeLakers2 deleted the fix/bevy_app/expose_subapps_in_app_struct branch December 24, 2024 07:55
pcwalton pushed a commit to pcwalton/bevy that referenced this pull request Dec 25, 2024
# Objective
`SubApps` is visible within the documentation for `bevy_app`. However,
no way of accessing the `SubApps` field in `App` is currently available.

## Solution
Expose two new functions, `App::sub_apps()` and `App::sub_apps_mut()`,
which give immutable and mutable access to `SubApps` respectively.

The other solution is to hide `SubApps`, which I submitted as a PR at
<bevyengine#16953>.

## Testing
Because of the simplicity of the changes, I only tested by compiling
`bevy_app` - which compiled successfully.

Note: `SubApps`, and its corresponding field on `App`, are not used
outside of `bevy_app` - which means that compiling the other crates is
not necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-App Bevy apps and plugins C-Feature A new feature, making something new possible D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants