Skip to content

Split up bevy_core #16892

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

Closed
ItsDoot opened this issue Dec 19, 2024 · 3 comments · Fixed by #16897
Closed

Split up bevy_core #16892

ItsDoot opened this issue Dec 19, 2024 · 3 comments · Fixed by #16897
Labels
C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! X-Contentious There are nontrivial implications that should be thought through

Comments

@ItsDoot
Copy link
Contributor

ItsDoot commented Dec 19, 2024

What problem does this solve or what need does it fill?

Title. This crate is basically a utilities crate, which we would like to avoid (bevy_utils is slowly being split up, for example). See here for its current API surface: https://docs.rs/bevy_core/latest/bevy_core/

What solution would you like?

We should:

  • Move FrameCount and its plugin to bevy_diagnostics or bevy_window
  • Move other plugins to bevy_app
  • Move everything else to bevy_ecs

What alternative(s) have you considered?

Leave it as-is.

Additional context

Related to #11478 and #16877.

Originally brought up on the Bevy Discord.

@ItsDoot ItsDoot added A-Core C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! labels Dec 19, 2024
@alice-i-cecile
Copy link
Member

Related to #11478.

@alice-i-cecile alice-i-cecile added the X-Contentious There are nontrivial implications that should be thought through label Dec 19, 2024
@bushrat011899
Copy link
Contributor

Recording here for visibility:

My list of little restructures I'd like:

  • Move bevy_core::Name into bevy_ecs
  • Move bevy_core::TypeRegistrationPlugin and bevy_core::TaskPoolPlugin into bevy_app
  • Move bevy_core::FrameCountPlugin into bevy_diagnostic
  • Merge bevy_log into bevy_diagnostic (significant overlap between the two crates conceptually IMO)
  • Move platform compatibility stuff out of bevy_utils and out of being inlined in crates and into its own new crate, bevy_platform_support (portable-atomic-util, hashbrown, web_time, etc.)
  • Take all the Future and parallel stuff out of bevy_utils and put it in bevy_tasks
  • Remove all the tracing/log stuff out of bevy_utils entirely, maybe putting some of it into bevy_diagnostic.
  • Put things like bevy_utils::default and bevy_utils::assert_object_safe in a pair of micro-crates that'll never be updated ever again.

That'd remove bevy_utils, bevy_log, and bevy_core and replace them with 2 micro crates that can be moved out of the repo, and 1 more targeted crate bevy_platform_support

Originally posted on Discord

@bushrat011899
Copy link
Contributor

Also related to #16877

github-merge-queue bot pushed a commit that referenced this issue Dec 19, 2024
# Objective

- Contributes to #16892

## Solution

- Moved `Name` and `NameOrEntity` into `bevy_ecs::name`, and added them
to the prelude.

## Testing

- CI

## Migration Guide

If you were importing `Name` or `NameOrEntity` from `bevy_core`, instead
import from `bevy_ecs::name`.

---------

Co-authored-by: Christian Hughes <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Dec 19, 2024
# Objective

- Fixes #16892

## Solution

- Removed `TypeRegistryPlugin` (`Name` is now automatically registered
with a default `App`)
- Moved `TaskPoolPlugin` to `bevy_app`
- Moved `FrameCountPlugin` to `bevy_diagnostic`
- Deleted now-empty `bevy_core`

## Testing

- CI

## Migration Guide

- `TypeRegistryPlugin` no longer exists. If you can't use a default
`App` but still need `Name` registered, do so manually with
`app.register_type::<Name>()`.
- References to `TaskPoolPlugin` and associated types will need to
import it from `bevy_app` instead of `bevy_core`
- References to `FrameCountPlugin` and associated types will need to
import it from `bevy_diagnostic` instead of `bevy_core`

## Notes

This strategy was agreed upon by Cart and several other members in
[Discord](https://discord.com/channels/691052431525675048/692572690833473578/1319137218312278077).
ecoskey pushed a commit to ecoskey/bevy that referenced this issue Jan 6, 2025
# Objective

- Contributes to bevyengine#16892

## Solution

- Moved `Name` and `NameOrEntity` into `bevy_ecs::name`, and added them
to the prelude.

## Testing

- CI

## Migration Guide

If you were importing `Name` or `NameOrEntity` from `bevy_core`, instead
import from `bevy_ecs::name`.

---------

Co-authored-by: Christian Hughes <[email protected]>
ecoskey pushed a commit to ecoskey/bevy that referenced this issue Jan 6, 2025
# Objective

- Fixes bevyengine#16892

## Solution

- Removed `TypeRegistryPlugin` (`Name` is now automatically registered
with a default `App`)
- Moved `TaskPoolPlugin` to `bevy_app`
- Moved `FrameCountPlugin` to `bevy_diagnostic`
- Deleted now-empty `bevy_core`

## Testing

- CI

## Migration Guide

- `TypeRegistryPlugin` no longer exists. If you can't use a default
`App` but still need `Name` registered, do so manually with
`app.register_type::<Name>()`.
- References to `TaskPoolPlugin` and associated types will need to
import it from `bevy_app` instead of `bevy_core`
- References to `FrameCountPlugin` and associated types will need to
import it from `bevy_diagnostic` instead of `bevy_core`

## Notes

This strategy was agreed upon by Cart and several other members in
[Discord](https://discord.com/channels/691052431525675048/692572690833473578/1319137218312278077).
mrchantey pushed a commit to mrchantey/bevy that referenced this issue Feb 4, 2025
# Objective

- Contributes to bevyengine#16892

## Solution

- Moved `Name` and `NameOrEntity` into `bevy_ecs::name`, and added them
to the prelude.

## Testing

- CI

## Migration Guide

If you were importing `Name` or `NameOrEntity` from `bevy_core`, instead
import from `bevy_ecs::name`.

---------

Co-authored-by: Christian Hughes <[email protected]>
mrchantey pushed a commit to mrchantey/bevy that referenced this issue Feb 4, 2025
# Objective

- Fixes bevyengine#16892

## Solution

- Removed `TypeRegistryPlugin` (`Name` is now automatically registered
with a default `App`)
- Moved `TaskPoolPlugin` to `bevy_app`
- Moved `FrameCountPlugin` to `bevy_diagnostic`
- Deleted now-empty `bevy_core`

## Testing

- CI

## Migration Guide

- `TypeRegistryPlugin` no longer exists. If you can't use a default
`App` but still need `Name` registered, do so manually with
`app.register_type::<Name>()`.
- References to `TaskPoolPlugin` and associated types will need to
import it from `bevy_app` instead of `bevy_core`
- References to `FrameCountPlugin` and associated types will need to
import it from `bevy_diagnostic` instead of `bevy_core`

## Notes

This strategy was agreed upon by Cart and several other members in
[Discord](https://discord.com/channels/691052431525675048/692572690833473578/1319137218312278077).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! X-Contentious There are nontrivial implications that should be thought through
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants