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

[Merged by Bors] - Implement Sub-App Labels #2695

Closed

Conversation

zicklag
Copy link
Member

@zicklag zicklag commented Aug 20, 2021

This is a rather simple but wide change, and it involves adding a new bevy_app_macros crate. Let me know if there is a better way to do any of this!


Objective

  • Allow adding and accessing sub-apps by using a label instead of an index

Solution

  • Migrate the bevy label implementation and derive code to the bevy_utils and bevy_macro_utils crates and then add a new SubAppLabel trait to the bevy_app crate that is used when adding or getting a sub-app from an app.

@zicklag zicklag force-pushed the sub-app-labels branch 2 times, most recently from d86a5b4 to bc75882 Compare August 20, 2021 21:50
@NiklasEi NiklasEi added A-App Bevy apps and plugins C-Enhancement A new feature labels Aug 21, 2021
@zicklag zicklag force-pushed the sub-app-labels branch 2 times, most recently from ad5dad1 to cf6b976 Compare August 21, 2021 14:42
@MinerSebas
Copy link
Contributor

The new crate must also be added to the ./tools/publish.sh script.
Just make sure it is placed before bevy_app in the list.

@zicklag zicklag force-pushed the sub-app-labels branch 4 times, most recently from 80c5c07 to a93e204 Compare August 23, 2021 18:15
Move the label implementation and derive code to bevy_utils
and bevy_macro_utils crates to make it easier to reuse in other
crates.
This replaces the temporary strategy of using indexes to access
sub-apps.
@cart
Copy link
Member

cart commented Aug 24, 2021

I have a number of small tweaks that I'd normally just push to your branch, but it looks like you've disabled that permission. I'll just merge this as-is and follow up with another pr.

@cart
Copy link
Member

cart commented Aug 24, 2021

(in the interest of time)

@cart
Copy link
Member

cart commented Aug 24, 2021

bors r+

bors bot pushed a commit that referenced this pull request Aug 24, 2021
This is a rather simple but wide change, and it involves adding a new `bevy_app_macros` crate. Let me know if there is a better way to do any of this!

---

# Objective

- Allow adding and accessing sub-apps by using a label instead of an index

## Solution

- Migrate the bevy label implementation and derive code to the `bevy_utils` and `bevy_macro_utils` crates and then add a new `SubAppLabel` trait to the `bevy_app` crate that is used when adding or getting a sub-app from an app.
@bors
Copy link
Contributor

bors bot commented Aug 24, 2021

@bors bors bot changed the title Implement Sub-App Labels [Merged by Bors] - Implement Sub-App Labels Aug 24, 2021
@bors bors bot closed this Aug 24, 2021
@zicklag zicklag deleted the sub-app-labels branch August 24, 2021 01:41
bors bot pushed a commit that referenced this pull request Aug 24, 2021
Makes some tweaks to the SubApp labeling introduced in #2695:

* Ergonomics improvements
* Removes unnecessary allocation when retrieving subapp label
* Removes the newly added "app macros" crate in favor of bevy_derive
* renamed RenderSubApp to RenderApp

@zicklag (for reference)
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-Enhancement A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants