Skip to content
New issue

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

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

Already on GitHub? # to your account

Deprecate add_startup_system/s #7694

Conversation

SpecificProtagonist
Copy link
Contributor

@SpecificProtagonist SpecificProtagonist commented Feb 16, 2023

Objective

Startup systems used to require add_startup_system and belonged to special startup stages. This is no longer necessary: They can just be added to the CoreSchedule::Startup instead (and add_startup_system/add_startup_systems are one-liners doing that).

Outside of example apps, startup system aren't as useful anyways as using states is more common, so removing their special status makes sense.

Changelog

  • deprecated App::add_startup_system/add_startup_systems

Migration Guide

  • replace add_startup_system(my_system) with add_system_to_schedule(CoreSchedule::Startup, my_system)

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events X-Controversial There is active debate or serious implications around merging this PR C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Feb 16, 2023
@alice-i-cecile alice-i-cecile requested a review from cart February 16, 2023 16:39
@joseph-gio joseph-gio self-requested a review February 24, 2023 00:22
@joseph-gio
Copy link
Member

Can you update this to use .on_startup(), as added in #7790?

Also, I agree with deprecating add_startup_system, but I think we should consider leaving add_startup_systems.

I think that this:

app.add_startup_systems((
    system_a,
    system_b,
    system_c,
))

Is much more ergonomic than this:

app.add_systems(
    (
        system_a,
        system_b,
        system_c,
    )
        .on_startup(),
)

@cart
Copy link
Member

cart commented Mar 9, 2023

As a heads up, we've been discussing the on_x pattern a bit on Discord (and now in github). I don't want to deprecate add_startup_system until that conversation comes to a conclusion:
#8005

@hymm
Copy link
Contributor

hymm commented Apr 15, 2023

add_startup_system and add_startup_systems were deprecated in #8079

@hymm hymm closed this Apr 15, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use X-Controversial There is active debate or serious implications around merging this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants