mirror of
https://github.com/bevyengine/bevy.git
synced 2026-05-06 06:06:42 -04:00
cb02e96b6d
Related: Cargo Feature Collections
https://github.com/bevyengine/bevy/pull/21472
## Context:
> If `default_app` is meant to be
> > The core pieces that most apps need. This serves as a baseline
feature set for other higher level feature collections (such as "2d" and
"3d"). It is also useful as a baseline feature set for scenarios like
headless apps that require no rendering (ex: command line tools,
servers, etc).
>
> why should `bevy_window` / `custom_cursor` be there? I would expect
these to be in `common_api`.
\- Me,
https://discord.com/channels/691052431525675048/692572690833473578/1460424003486224517
> Imo this is a mistake. Can you open a PR with a migration guide
please?
\- Alice,
https://discord.com/channels/691052431525675048/692572690833473578/1460429142376845404
## Solution
- <strike>Move `bevy_window`, `bevy_input_focus`, `custom_cursor`
features from `default_app` collection to `common_api`</strike>
- From `default_app` collection move: `bevy_window` to `common_api`,
`bevy_input_focus` to `ui_api`, and `custom_cursor` to
`default_platform`.
## Testing
- Did you test these changes? If so, how?
Confirmed that `default_app` collection no longer introduces the crates
to the dependency tree:
```sh
$ git checkout bevy/main -q
$ cargo tree --no-default-features -Fdefault_app -e normal | grep -e bevy_window -e bevy_input_focus -e custom_cursor
├── bevy_input_focus v0.18.0-dev
│ ├── bevy_window v0.18.0-dev
├── bevy_window v0.18.0-dev (*)
├── bevy_input_focus v0.18.0-dev (*)
├── bevy_window v0.18.0-dev (*)
$ git checkout reduced-feature-group
Previous HEAD position was f8ea30965 Add support for reflected math operations ➕➖✖️➗ (#22478)
Switched to branch 'reduced-feature-group'
$ cargo tree --no-default-features -Fdefault_app -e normal | grep -e bevy_window -e bevy_input_focus -e custom_cursor
$
```
- How can other people (reviewers) test your changes? Is there anything
specific they need to know?
I'm not sure how cross-cutting changes to features have to be since I
haven't worked with such a complicated feature set before, so it's
possible I've omitted a change to some place that needs to be updated.
Please point it out to me, thank you.
---------
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
1.5 KiB
1.5 KiB
title, pull_requests
| title | pull_requests | |
|---|---|---|
| `bevy_window`, `bevy_input_focus`, `custom_cursor` features moved to alternate feature collections |
|
In Bevy 0.18, feature collections were introduced. The bevy_window, bevy_input_focus, & custom_cursor features were included in the default_app collection.
In Bevy 0.19, these have been moved from default_app:
| Feature | is included in... |
|---|---|
bevy_window |
common_api |
bevy_input_focus |
ui_api |
custom_cursor |
default_platform |
This change was made because:
- the
default_appcollection is for core functionality that most apps will need. Scene definition for windowing is not usually required, and - apps that don't use windowing (ex: command line tools, servers, etc) can compile fewer dependencies.
If you were relying on these being included in default_app, you can cherry-pick them into your Cargo.toml feature list:
# 0.18
bevy = { version = "0.18", default-features = false, features = [ "default_app" ] }
# 0.19
bevy = { version = "0.19", default-features = false, features = [
"default_app",
"bevy_window",
"bevy_input_focus",
"custom_cursor"
] }
If you already depend on a high-level profile (2d, 3d, ui), or a mid-level collection ending in '_render' or '_api', then you do not need to make any changes.
I've erred on the side of hopefully-longer-than-it-needs-to-be.