Skip to content

Conversation

@atlv24
Copy link
Contributor

@atlv24 atlv24 commented Aug 25, 2025

Objective

  • easily switch to bevy without a renderer
  • make it clear which crates/features require rendering still

Solution

  • feature group

Testing

  • building with no-default + default no render and running works

@atlv24 atlv24 force-pushed the ad/default-no-render branch from 3e62651 to 95e17f9 Compare August 25, 2025 02:17
@atlv24 atlv24 force-pushed the ad/default-no-render branch from 95e17f9 to 27207dd Compare August 25, 2025 02:18
@atlv24
Copy link
Contributor Author

atlv24 commented Aug 25, 2025

Hmm, the delineation between default and optional features seems to be really weird and wrong even on main, im not sure why it changed here either. I don't know if this is a good idea anyways, but i'd like something that let me easily build "bevy sans render"

@atlv24 atlv24 added C-Dependencies A change to the crates that Bevy depends on S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 25, 2025
@mockersf
Copy link
Member

Not sure I like having default_no_render as a feature that is enabled by default.

Maybe this is some kind of "meta" feature that we shouldn't document

@alice-i-cecile alice-i-cecile added S-Needs-Design This issue requires design work to think about how it would best be accomplished A-Cross-Cutting Impacts the entire engine X-Contentious There are nontrivial implications that should be thought through and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 25, 2025
@alice-i-cecile
Copy link
Member

I think the naming could use some work, but I like the core idea. This needs to be easy to test, and it's very useful for end users testing their projects.

@mockersf
Copy link
Member

it's very useful for end users testing their projects.

Like we don't recommend users to enable default features, I wouldn't recommend them to enable default_no_render either, there's too much of everything to be tailored to a project

@atlv24
Copy link
Contributor Author

atlv24 commented Aug 26, 2025

we have a default_no_std, a no_render is at least equally useful

github-merge-queue bot pushed a commit that referenced this pull request Aug 26, 2025
# Objective

- We currently specify transitive feature dependencies in two places:
bevy and bevy_internal Cargo.tomls
- This means they get out of sync often, accumulate unnecessary
duplication, and sometimes forget certain transitive deps.

## Solution

- Standardize on bevy_internal. Why: this makes it impossible to use it
incorrectly if you depend on bevy_internal directly for some reason. If
we standardized on bevy Cargo.toml holding these, it would mean that
they could be bypassed by depending on bevy_internal. Not sure why
someone would do that, but this feels right.
- Move the few transitive feature dependency specifications that are
still in bevy to bevy_internal
- clean up a lot of duplicates
- add a few missing dependencies
- add top level bevy_mesh, bevy_camera, bevy_light, and bevy_shader
features.


## Testing

- this stuff is hard to test automatically or comprehensively. #20741
might make it easy to have a no-render test suite we can maintain
coverage for, but other than that its just manual verification.
@github-actions
Copy link
Contributor

You added a new feature but didn't update the readme. Please run cargo run -p build-templated-pages -- update features to update it, and commit the file change.

Zeophlite pushed a commit to Zeophlite/bevy that referenced this pull request Aug 27, 2025
# Objective

- We currently specify transitive feature dependencies in two places:
bevy and bevy_internal Cargo.tomls
- This means they get out of sync often, accumulate unnecessary
duplication, and sometimes forget certain transitive deps.

## Solution

- Standardize on bevy_internal. Why: this makes it impossible to use it
incorrectly if you depend on bevy_internal directly for some reason. If
we standardized on bevy Cargo.toml holding these, it would mean that
they could be bypassed by depending on bevy_internal. Not sure why
someone would do that, but this feels right.
- Move the few transitive feature dependency specifications that are
still in bevy to bevy_internal
- clean up a lot of duplicates
- add a few missing dependencies
- add top level bevy_mesh, bevy_camera, bevy_light, and bevy_shader
features.


## Testing

- this stuff is hard to test automatically or comprehensively. bevyengine#20741
might make it easy to have a no-render test suite we can maintain
coverage for, but other than that its just manual verification.
@cart cart mentioned this pull request Oct 8, 2025
@cart
Copy link
Member

cart commented Oct 8, 2025

#21472 will resolve this in a more complete way, so I'm closing this

@cart cart closed this Oct 8, 2025
github-merge-queue bot pushed a commit that referenced this pull request Oct 10, 2025
## Objective

Users of the `bevy` crate currently live one of two lifestyles:

1. Use all of Bevy's default features, potentially compiling many
features you don't need or don't want. If there is a feature you _cannot
have_ in your app, you must move on to option (2)
2. Disable Bevy's default features, and compose the complete list of
features yourself.

Living in the world of (2) is an exercise in frustration, as the list of
required features to accomplish a given task changes regularly across
releases as we add and change features. This is an _expert level_ task
that requires intimate knowledge of engine internals to get right. Even
I, Bevy's lead developer, would struggle here. To the point that I would
never voluntarily choose to disable Bevy's default features.

Most games/apps are 2D-only, 3D-only, or UI-only and don't require the
full set of features. We cannot currently in good conscience recommend
that those developers live in the "no default features" world. That is a
fast track to pain, suffering, and perhaps a quick exit from the Bevy
ecosystem.

The same problem exists for developers that want to build their own Bevy
renderer or replace Bevy UI with their own framework. Once again, we
_cannot_ recommend that those developers manage every Bevy feature
themselves.

Fixes: #21369
Alternative to: #20741 #21236

## Solution

Define a "standalone" set of features that enable Bevy developers to
disable default features, then opt in to the funtionality they want. The
"default" `bevy` feature set is now just:

```toml
default = ["2d", "3d", "ui"]
```

This enables developers to select only the features they need. For
example, a UI-only app would look like this:

```toml
bevy = { version = "0.17", default-features = false, features = [ "ui" ] }
```

"2d", "3d", and "ui" each contain the "full" Bevy experience for that
domain. This also includes:
- `default_platform`: the default "platform support" features (see docs)
- `default_app`: the default "app framework" features (see docs)

For developers that do not want the default bevy render / platform / app
functionality, this breaks down further into:

- `common_api`: common / core backend-less user-facing Bevy render api
- `2d_api`: common / core backend-less user-facing Bevy 2d api
- `3d_api`: common / core backend-less user-facing Bevy 3d api
- `ui_api`: common / core backend-less user-facing Bevy ui api

(and many others)

I've also added the `dev` feature to this PR, which enables the
recommended "dev only" features like dynamic linking, asset watching /
hot reloading, and dev / debug tools. Including dynamic linking is a bit
controversial here given that it doesn't work everywhere. But I'd like
to aggressively push people into the dynamic linking workflow wherever
possible, as developing without it is signficantly worse. And removing a
single `dev` feature is a much simpler release workflow.

---------

Co-authored-by: atlv <[email protected]>
mate-h pushed a commit to mate-h/bevy that referenced this pull request Oct 22, 2025
## Objective

Users of the `bevy` crate currently live one of two lifestyles:

1. Use all of Bevy's default features, potentially compiling many
features you don't need or don't want. If there is a feature you _cannot
have_ in your app, you must move on to option (2)
2. Disable Bevy's default features, and compose the complete list of
features yourself.

Living in the world of (2) is an exercise in frustration, as the list of
required features to accomplish a given task changes regularly across
releases as we add and change features. This is an _expert level_ task
that requires intimate knowledge of engine internals to get right. Even
I, Bevy's lead developer, would struggle here. To the point that I would
never voluntarily choose to disable Bevy's default features.

Most games/apps are 2D-only, 3D-only, or UI-only and don't require the
full set of features. We cannot currently in good conscience recommend
that those developers live in the "no default features" world. That is a
fast track to pain, suffering, and perhaps a quick exit from the Bevy
ecosystem.

The same problem exists for developers that want to build their own Bevy
renderer or replace Bevy UI with their own framework. Once again, we
_cannot_ recommend that those developers manage every Bevy feature
themselves.

Fixes: bevyengine#21369
Alternative to: bevyengine#20741 bevyengine#21236

## Solution

Define a "standalone" set of features that enable Bevy developers to
disable default features, then opt in to the funtionality they want. The
"default" `bevy` feature set is now just:

```toml
default = ["2d", "3d", "ui"]
```

This enables developers to select only the features they need. For
example, a UI-only app would look like this:

```toml
bevy = { version = "0.17", default-features = false, features = [ "ui" ] }
```

"2d", "3d", and "ui" each contain the "full" Bevy experience for that
domain. This also includes:
- `default_platform`: the default "platform support" features (see docs)
- `default_app`: the default "app framework" features (see docs)

For developers that do not want the default bevy render / platform / app
functionality, this breaks down further into:

- `common_api`: common / core backend-less user-facing Bevy render api
- `2d_api`: common / core backend-less user-facing Bevy 2d api
- `3d_api`: common / core backend-less user-facing Bevy 3d api
- `ui_api`: common / core backend-less user-facing Bevy ui api

(and many others)

I've also added the `dev` feature to this PR, which enables the
recommended "dev only" features like dynamic linking, asset watching /
hot reloading, and dev / debug tools. Including dynamic linking is a bit
controversial here given that it doesn't work everywhere. But I'd like
to aggressively push people into the dynamic linking workflow wherever
possible, as developing without it is signficantly worse. And removing a
single `dev` feature is a much simpler release workflow.

---------

Co-authored-by: atlv <[email protected]>
@atlv24 atlv24 deleted the ad/default-no-render branch December 17, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Cross-Cutting Impacts the entire engine C-Dependencies A change to the crates that Bevy depends on S-Needs-Design This issue requires design work to think about how it would best be accomplished X-Contentious There are nontrivial implications that should be thought through

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants