Migrate from Event to Message API for Bevy 0.17 #102
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates the codebase from the deprecated
EventAPI to the newMessageAPI introduced in Bevy 0.17.Changes
New Modules
src/action/once/message.rs: New module with message-based actionswrite<M>()- Write a message (replacessend())write_default<M>()- Write default message (replacessend_default())app_exit_success()- Exit app successfullysrc/action/wait/message.rs: New module for waiting on messagescomes<M>()- Wait until message arrivescomes_and<M>(predicate)- Wait for message matching predicateread<M>()- Wait and return messageread_and<M>(predicate)- Wait and return matching messageDeprecated Modules
src/action/once/event.rs: All functions marked as#[deprecated]with migration guidanceonce::messageequivalentssrc/action/wait/event.rs: All functions marked as#[deprecated]with migration guidancewait::messageequivalentsUpdated Files
messageAPImessageAPIMigration Path
The old
eventmodules remain functional but deprecated, allowing gradual migration:Test Results
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]