-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Separate state crate #13216
Separate state crate #13216
Conversation
…te-state-crate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, much cleaner now that it's in separate files.
Proposal: move state related examples to separate folder?
Yeah, we should move the examples to a separate folder now :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to update the publish.sh script, but otherwise this LGTM.
https://github.com/bevyengine/bevy/blob/main/tools/publish.sh
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one quick thing before this gets merged!
crates/bevy_ecs/macros/Cargo.toml
Outdated
@@ -11,7 +11,7 @@ proc-macro = true | |||
[dependencies] | |||
bevy_macro_utils = { path = "../../bevy_macro_utils", version = "0.14.0-dev" } | |||
|
|||
syn = { version = "2.0", features = ["full"] } | |||
syn = "2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bad merge from main where the same thing was fixed. I think the merge might go through if this change is removed.
Co-authored-by: Kristoffer Søholm <k.soeholm@gmail.com>
Objective
Extracts the state mechanisms into a new crate called "bevy_state".
This comes with a few goals:
moving state into a new crate makes it easier to encapsulate as it's own feature, and easier to read and understand since it's no longer a single, massive file.
Solution
move the state-related elements from bevy_ecs to a new crate
Testing
Migration Guide
Since bevy_state is now gated behind the
bevy_state
feature, projects that use state but don't use thedefault-features
will need to add that feature flag.Since it is no longer part of bevy_ecs, projects that use bevy_ecs directly will need to manually pull in
bevy_state
, trigger the StateTransition schedule, and handle any of the elements that bevy_app currently sets up.