-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Remove everything except Instant
from bevy_utils::time
#17158
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
Merged
alice-i-cecile
merged 2 commits into
bevyengine:main
from
bushrat011899:ReduceBevyUtilsTimeModule
Jan 5, 2025
Merged
Remove everything except Instant
from bevy_utils::time
#17158
alice-i-cecile
merged 2 commits into
bevyengine:main
from
bushrat011899:ReduceBevyUtilsTimeModule
Jan 5, 2025
Conversation
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
BenjaminBrienen
approved these changes
Jan 5, 2025
alice-i-cecile
approved these changes
Jan 5, 2025
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.
I agree with this. I was skeptical at first, because the split web_time imports suck, but you're right about us not using them and not having an immediate use for it. As I'm sure you know, moving this into bevy_platform_compat
is the next step here.
mrchantey
pushed a commit
to mrchantey/bevy
that referenced
this pull request
Feb 4, 2025
…e#17158) # Objective - Contributes to bevyengine#11478 - Contributes to bevyengine#16877 ## Solution - Removed everything except `Instant` from `bevy_utils::time` ## Testing - CI --- ## Migration Guide If you relied on any of the following from `bevy_utils::time`: - `Duration` - `TryFromFloatSecsError` Import these directly from `core::time` regardless of platform target (WASM, mobile, etc.) If you relied on any of the following from `bevy_utils::time`: - `SystemTime` - `SystemTimeError` Instead import these directly from either `std::time` or `web_time` as appropriate for your target platform. ## Notes `Duration` and `TryFromFloatSecsError` are both re-exports from `core::time` regardless of whether they are used from `web_time` or `std::time`, so there is no value gained from re-exporting them from `bevy_utils::time` as well. As for `SystemTime` and `SystemTimeError`, no Bevy internal crates or examples rely on these types. Since Bevy doesn't have a `Time<Wall>` resource for interacting with wall-time (and likely shouldn't need one), I think removing these from `bevy_utils` entirely and waiting for a use-case to justify inclusion is a reasonable path forward.
rcorre
added a commit
to rcorre/matchbox
that referenced
this pull request
Apr 27, 2025
Bevy 0.16 was released a few days ago, update `bevy_matchbox` to use that. There weren't any major changes affecting matchbox that I could see. The only things I had to adjust to were: - `utils::Duration` was removed in favor of `core::Duration`: bevyengine/bevy#17158 - Logging now requires a feature - `ecs::world::Command` moved to `prelude::Command` See: https://bevyengine.org/news/bevy-0-16/.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Utils
Utility functions and types
C-Code-Quality
A section of code that is hard to understand or change
D-Trivial
Nice and easy! A great choice to get started with Bevy
M-Needs-Migration-Guide
A breaking change to Bevy's public API that needs to be noted in a migration guide
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
X-Contentious
There are nontrivial implications that should be thought through
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.
Objective
Solution
Instant
frombevy_utils::time
Testing
Migration Guide
If you relied on any of the following from
bevy_utils::time
:Duration
TryFromFloatSecsError
Import these directly from
core::time
regardless of platform target (WASM, mobile, etc.)If you relied on any of the following from
bevy_utils::time
:SystemTime
SystemTimeError
Instead import these directly from either
std::time
orweb_time
as appropriate for your target platform.Notes
Duration
andTryFromFloatSecsError
are both re-exports fromcore::time
regardless of whether they are used fromweb_time
orstd::time
, so there is no value gained from re-exporting them frombevy_utils::time
as well. As forSystemTime
andSystemTimeError
, no Bevy internal crates or examples rely on these types. Since Bevy doesn't have aTime<Wall>
resource for interacting with wall-time (and likely shouldn't need one), I think removing these frombevy_utils
entirely and waiting for a use-case to justify inclusion is a reasonable path forward.