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

Duration and Instant should live in bevy_time, not bevy_utils #6027

Closed
alice-i-cecile opened this issue Sep 19, 2022 · 5 comments
Closed

Duration and Instant should live in bevy_time, not bevy_utils #6027

alice-i-cecile opened this issue Sep 19, 2022 · 5 comments
Labels
A-Time Involves time keeping and reporting 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

Comments

@alice-i-cecile
Copy link
Member

These are obviously part of our time-like functionality, and should be stored with those functions.

@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy C-Code-Quality A section of code that is hard to understand or change A-Utils Utility functions and types A-Time Involves time keeping and reporting labels Sep 19, 2022
@DJMcNab
Copy link
Member

DJMcNab commented Sep 19, 2022

The docs page at https://docs.rs/bevy/latest/bevy/utils/struct.Duration.html is terrible.

For context, this is because of #895, which means we re-export Instant and Duration from instant.
However, on native platforms (which docs.rs uses), that Instant is just a type alias for std instant.

This seems like a significant footgun, whether or not we put lipstick on it by moving crates.

@mockersf
Copy link
Member

mockersf commented Sep 19, 2022

A few teams actually got their foot gunned during Bevy Jam #2 by using Instant from std and discovering at the last instant that they need to use the one reexported by Bevy to work in wasm

@DJMcNab
Copy link
Member

DJMcNab commented Sep 20, 2022

at the last instant

Surely you mean the last Instant?

I'm not surprised. It's really haphazard. I certainly didn't know about this.

@mockersf
Copy link
Member

at the last instant

Surely you mean the last Instant?

Indeed. And don't call me Shirley.

@alice-i-cecile
Copy link
Member Author

There's too much headache for the benefits here due to circular dependencies. See #6034 for what this change would entail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Time Involves time keeping and reporting 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
Projects
None yet
3 participants