Update to bevy 0.16-dev#428
Merged
Merged
Conversation
We can't use `Transform` in the docs since we don't depend on it.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #428 +/- ##
==========================================
- Coverage 80.30% 79.84% -0.46%
==========================================
Files 53 52 -1
Lines 2797 2774 -23
==========================================
- Hits 2246 2215 -31
- Misses 551 559 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Since we no longer depend on `bevy_log`.
It’s a new catch-all error type. I found `postcard::Result` too limiting - you can’t define clear error messages for custom serialization.
It's clearer this way.
UkoeHB
requested changes
Apr 15, 2025
UkoeHB
approved these changes
Apr 15, 2025
* Use more explicit variable name * Remove `removals_id` into `removal_ids` * Preserve removals even when the component is immediately inserted To avoid inconsistent triggers behavior between the server and client.
Just define directly in main. Doesn't make much sense to create a plugin for an example.
During the migration to 0.16, I added a few workarounds related to `hashbrown` to make the code compile. These issues have been fixed in the latest Bevy RC: bevyengine/bevy#18694 So we can now remove those workarounds.
Just an internal rename. I think it makes the intent clearer. This will better fit the upcoming relationships support.
* Allow markers to be immutable * Add support for immutable components Immutable components were introduced in Bevy via: bevyengine/bevy#16372 These components can only be changed via re-insertion. This allows users to enforce invariants through triggers and hooks. When porting to 0.16, I initially added a `Mutability = Mutable` constraint. To support immutable components, I replaced this constraint with the `MutWrite` trait. It is implemented for both `Mutable` and `Immutable` markers to select the appropriate write function. For `Immutable` components, this function always performs insertion. * Update src/shared/replication/replication_registry/command_fns.rs Co-authored-by: UkoeHB <37489173+UkoeHB@users.noreply.github.com> * Add reinsertion test * Apply clippy suggestions --------- Co-authored-by: UkoeHB <37489173+UkoeHB@users.noreply.github.com>
- Rename into `Updates` and `Mutations`. Shorter and these components aren't messages. We actually create messages from them. - Use shorter methods in `Mutations`. Things like `mutations.add_mutated_entity` looks too redundant. - In `Updates` I made few names more explicit since it accumulates not only changes. - Use the variable name `changes` when referring to `ChangeRanges`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 of changes:
Trigger::entitywithTrigger::target.Componenttrait now requires aMutabilitytype.never_param_warnon systems with an explicit check. The panicking behavior now depends on system params.postcard::Resultwith the newResulttype from Bevy. It's much more flexible; I can define proper error messages in both the library and user code.HookContextinstead of separate arguments.EntityMappertrait is now a bit different:map_entityis now calledget_mappedand contains the newset_mappedmethod. I can't implement it for structs that hold references, so I put anunimplemented!stub. Bevy does the same. It's not really elegant - maybe we'll figure something out later on the Bevy side.replicate_mappedand related functions. Now all components have a method to map entities. Events still require mapping.MappedEventimplementations with the derive macro.parent_sync. It's no longer needed; users can now just replicateChildOf.single, which we use in tests, now returnsResult, so I addedunwraps.no_stdsupport:stdusage withcoreand enable corresponding lints.portable-atomicforbytes, similar to what Bevy does forportable-atomicitself.logdirectly sincebevy_logdoesn't supportno_stdyet. The issue is caused by thetracingdependency. Bevy also useslogdirectly in allno_stdcrates; it's compatible withtracing, so there's no effect for users.Transformin docs since we areno_stdnow. There was only a single place or two. I just rewrote them a bit. Doc-examples are fine since they usedev-dependencies.