Skip to content

Deprecate add_startup_system/s#7694

Closed
SpecificProtagonist wants to merge 1 commit into
bevyengine:mainfrom
SpecificProtagonist:no-add_startup_system
Closed

Deprecate add_startup_system/s#7694
SpecificProtagonist wants to merge 1 commit into
bevyengine:mainfrom
SpecificProtagonist:no-add_startup_system

Conversation

@SpecificProtagonist

@SpecificProtagonist SpecificProtagonist commented Feb 16, 2023

Copy link
Copy Markdown
Contributor

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-Needs-SME This type of work requires an SME to approve it. 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
Copy Markdown
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

cart commented Mar 9, 2023

Copy link
Copy Markdown
Member

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

hymm commented Apr 15, 2023

Copy link
Copy Markdown
Contributor

add_startup_system and add_startup_systems were deprecated in #8079

@hymm hymm closed this Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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-Needs-SME This type of work requires an SME to approve it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants