Skip to content

Remove add_sub_app api #7286

@hymm

Description

@hymm

Consider removing the add_sub_app api. This method is somewhat redundant with the insert_sub_app api. Consider:

let sub_app = App::empty();
app.add_sub_app(SubAppLabel, sub_app, extract_function);

vs

let sub_app = App::empty();
app.insert_sub_app(
  SubAppLabel,
  SubApp {
    app: sub_app,
    extract: Box::new(extract_function),
  }
);

This is a somewhat niche feature and may not deserve an extra api for slight better ergonomics.

See this comment from cart from the pipelined rendering pr

Maybe we should just remove this in favor of insert_sub_app. The insert semantics are "correct" anyway whereas add is generally used for repeatable / non-overwriting actions. This function is slightly more ergonomic, but SubApps aren't exactly a common pattern anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or changeC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with Bevy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions