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

Update Bevy to 0.11 #364

Merged
merged 5 commits into from
Jul 11, 2023
Merged

Conversation

paul-hansen
Copy link
Collaborator

@paul-hansen paul-hansen commented Jul 10, 2023

The only thing I wasn't sure about is with input mocking, .11 adds a window field to input events that I just populated with Entity::PLACEHOLDER when sending events because our test environment doesn't create a window so all the tests would fail trying to get a window.

Appears this just isn't needed anymore as I had removed the others
without issue.

In 0.10 `#[bundle]` was used, in 0.11 `#[bundle(ignore)]` was added,
 causing `#[bundle]` to error. I couldn't find mention of how migrate
`#[bundle]` but removing it seems to just work.
@alice-i-cecile alice-i-cecile added dependencies Update dependencies breaking-change A breaking change that requires a new major version labels Jul 10, 2023
@alice-i-cecile
Copy link
Contributor

Yep, placeholder is correct.

Why do we need TypePath now?

@paul-hansen
Copy link
Collaborator Author

Why do we need TypePath now?

This line was complaining without it:

app.register_type::<ActionState<A>>()

If you remove the TypePath requirement from Actionlike, it gives this error:

error[E0277]: the trait bound `A: TypePath` is not satisfied
   --> src\plugin.rs:146:29
    |
146 |         app.register_type::<ActionState<A>>()
    |                             ^^^^^^^^^^^^^^ the trait `TypePath` is not implemented for `A`
    |
note: required for `ActionState<A>` to implement `GetTypeRegistration`
   --> src\action_state.rs:85:80
    |
85  | #[derive(Resource, Component, Clone, Debug, PartialEq, Serialize, Deserialize, Reflect)]
    |                                                                                ^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
86  | pub struct ActionState<A: Actionlike> {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `App::register_type`
   --> D:\Packages\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_app-0.11.0\src\app.rs:816:29
    |
816 |     pub fn register_type<T: bevy_reflect::GetTypeRegistration>(&mut self) -> &mut Self {
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `App::register_type`
    = note: this error originates in the derive macro `Reflect` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
    |
82  | impl<A: Actionlike + bevy::reflect::TypePath> Plugin for InputManagerPlugin<A> {
    |                    +++++++++++++++++++++++++

I'm open to suggestions, was just added to get it to compile.

@paul-hansen
Copy link
Collaborator Author

paul-hansen commented Jul 10, 2023

Opened an issue as it seems like it might be an unintentional restriction since it isn't mentioned in the migration guide:
bevyengine/bevy#9094

Migration guide: https://bevyengine.org/learn/migration-guides/0.10-0.11/#bevy-reflect-stable-type-path-v2

@alice-i-cecile
Copy link
Contributor

Great; doesn't look like something we can work around here.

@alice-i-cecile
Copy link
Contributor

Once bevy_egui ships I'll merge this and then cut a release. Thanks a ton!

@alice-i-cecile
Copy link
Contributor

bevy_egui v0.21 is now live: once that's swapped over I'll merge this and cut a release <3

@paul-hansen paul-hansen marked this pull request as ready for review July 11, 2023 00:52
@paul-hansen
Copy link
Collaborator Author

Done, looking good to go on my end!

@alice-i-cecile alice-i-cecile merged commit 10df780 into Leafwing-Studios:main Jul 11, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change A breaking change that requires a new major version dependencies Update dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants