Commit Graph

255 Commits

Author SHA1 Message Date
laund e30b5013b4 fix all clippy lints (#24475)
# Objective

Resolve all clippy lints currently warning in one way or another. They
were annoying me while contributing, especially having to find the lints
i caused in the ~50 of them which this PR resolves.

## Solution

Most of them were fixes that were reasonable to apply.

`std_instead_of_core` currently has false hits on `std::io`: because
`core::io` is unstable we don't want to apply those. So ive decided to
disable this lint for now. This was already "allow" in `[lints.clippy]`,
i made it "allow" in `[workspace.lints.clippy]` as well.

## Testing

- [x] `cargo test --all` passes, except for
`error::bevy_error::tests::filtered_backtrace_test` which fails on
`main` in the same way for me
- [x] `bevy_city` example works

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Mike <mike.hsu@gmail.com>
Co-authored-by: Mira <specificprotagonist@posteo.org>
2026-06-02 01:35:04 +00:00
DavidCrossman 7c77ecd576 Fix documentation typos (#24446)
# Objective

Fix typos and other small issues in the documentation. I can drop the
changes to `bevy_reflect`'s and `bevy_anti_alias`'s crate descriptions
if it's a problem.
2026-06-02 00:52:42 +00:00
Richard Braakman c94471dcac update ratatui dependency to 0.30 (#24504)
# Objective

Ratatui is used by the `tools/export-content` crate. Update it to its
latest stable version.

This PR supersedes #22351 which is a dependabot PR that got stuck on
some breaking changes in ratatui 0.30.

## Solution

Ratatui's `Backend` type now has an associated `Error` type that does
not specify `Send + Sync`,
which is a bit awkward because `miette` requires those. Fixed by adding
the requirements locally,
and changing `init_terminal()` to return its specific backend type so
that the compiler can verify its `Error` type.

## Testing

Ran the tool before and after and it looked the same.
2026-05-31 18:40:39 +00:00
Raphael Larsen 153d752f37 Don't leave root during bench-check. (#24248)
## Error

During `$ cargo run -p ci -- compile`
 
```text
$ cargo check --benches --target-dir ../target --manifest-path ./benches/Cargo.toml
error: failed to create directory `D:\bevy\..`

Caused by:
  Access is denied. (os error 5)

thread 'main' (16628) panicked at tools\ci\src\ci.rs:62:13:
One or more CI commands failed:
bench-check: Failed to check the benches.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

## Solution

- Instead of accessing ../target access ./target

## Testing

- Now the command works on my device.
2026-05-21 10:20:42 +00:00
Dea 9ee0573ebd Push window resize and scale factor messages to bevy_window_events (#24046)
I was initially using `MessageReader<WindowResized>` in my system for my
app but once my system grew to use more and more window events, I
refactored to using `MessageReader<WindowEvent>` and matching on its
variants. This is where I ran into the issue of the
`WindowEvent::WindowResized` case never matching.

When making this PR, I noticed
`WindowEvent::WindowBackendScaleFactorChanged` and
`WindowEvent::WindowScaleFactorChanged` had the same issue.

# Objective

Fixes #15268

## Solution

Instead of writing into `MessageWriter<WindowResized>`,
`MessageWriter<WindowBackendScaleFactorChanged>` and
`MessageWriter<WindowScaleFactorChanged>`, push into
`bevy_window_events` where it gets sent to the `forward_bevy_events`
function for syncing the messages.

## Testing

I made local modifications to the `window_resizing` example to use a
`MessageReader<WindowEvent>` instead of `MessageReader<WindowResized>`
like so:
```rs
fn on_resize_system(
    mut text: Single<&mut Text, With<ResolutionText>>,
    mut resize_reader: MessageReader<WindowEvent>,
) {
    for e in resize_reader.read() {
        if let WindowEvent::WindowResized(e) = e {
            // When resolution is being changed
            text.0 = format!("{:.1} x {:.1}", e.width, e.height);
        }
    }
}
```
I ran this example on linux wayland.
2026-05-04 16:15:20 -07:00
loreball a5cbc9e6a3 Add new and severity based constructors to BevyError (#23684)
# Objective

Add constructors for making `BevyError`s with a specific severity.
Closes #23676.

## Solution

Add a `new` constructor plus 1 constructor for every possible
`Severity`.

## Testing

My eyes and a simple test case that constructs an error and tests if the
downcasting works.

---

## Showcase

A `BevyError` now has multiple constructor to create one with an
expected severity

```rust
use bevy::ecs::error::{BevyError, Severity};

let debug_error = BevyError::new(Severity::Debug, "This works with strings");

let warn_error = BevyError::warn("There's a constructor for each severity level");
```

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Ben Frankel <ben.frankel7@gmail.com>
2026-04-08 05:16:40 +00:00
François Mockers 17a1b081cb enable tracing for rodio (#23557)
# Objective

- All Bevy programs with bevy_audio print a line to stderr when they
exit:
```
Dropping DeviceSink, audio playing through this sink will stop, to prevent this message from appearing use tracing or call `.log_on_drop(false)` on this DeviceSink
```
- This is an expected print by rodio:

https://github.com/RustAudio/rodio/blob/7e9ba6dd017abb88a1de8c287849c89c3624437d/src/stream.rs#L99-L108

## Solution

- Enable the tracing feature so that it's logged instead of printed
- set `log_on_drop(false)` on the audio sink created by Bevy. It's
expected to stop playing sound when it's dropped
2026-03-29 16:12:33 +00:00
Martín Maita a80470f5ec Update Rodio to 0.22 (#20323)
# Objective

- Closes #19672 

## Solution

- Updated both `cpal` and `rodio` to their latest versions.
- Updated code to address `rodio`'s breaking changes.
- Reworked audio related feature flags. NOTE: `symphonia` will only be
the default backend for formats with no alternative fallback.
- Added `audio-all-formats` feature collection to easily enable all the
available audio formats using their default backends.
- Replaced `aarch64-apple-ios-sim` target with
`arm64-apple-ios-simulator`.

## Testing

- Tested audio related examples.
- CI checks passing.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Parrett <robparrett@gmail.com>
2026-03-24 23:31:06 +00:00
dependabot[bot] 582c074ede Update toml_edit requirement from 0.24.0 to 0.25.1 (#23068)
Updates the requirements on [toml_edit](https://github.com/toml-rs/toml)
to permit the latest version.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/toml-rs/toml/commit/767747fe1afad1236d60b0db3fe4c90bf17c14eb"><code>767747f</code></a>
chore: Release</li>
<li><a
href="https://github.com/toml-rs/toml/commit/c68aa8705c188f35c3910e4878127c160bcb6d89"><code>c68aa87</code></a>
fix(parser): Plug another whole in synthetic events (<a
href="https://redirect.github.com/toml-rs/toml/issues/1102">#1102</a>)</li>
<li><a
href="https://github.com/toml-rs/toml/commit/17dc3ddbc57573762e8afd2b9d8945dc572615ab"><code>17dc3dd</code></a>
fix(parser): Plug another whole in synthetic events</li>
<li><a
href="https://github.com/toml-rs/toml/commit/0f32a02fc8271779384cf73233ff6d1b8151b822"><code>0f32a02</code></a>
test(parse): Add another test case</li>
<li><a
href="https://github.com/toml-rs/toml/commit/9fef741aa76295a58a1f48c1a06a701a6eadf4e7"><code>9fef741</code></a>
docs: Update changelog</li>
<li><a
href="https://github.com/toml-rs/toml/commit/3c596112ef1f96d3dded28150d43ab3cb772ca4c"><code>3c59611</code></a>
fix(edit): Remove panics on bad input (<a
href="https://redirect.github.com/toml-rs/toml/issues/1101">#1101</a>)</li>
<li><a
href="https://github.com/toml-rs/toml/commit/796812017df0f118130423e5109803a1742b62c5"><code>7968120</code></a>
fix(edit): On missing value, ensure a span is used</li>
<li><a
href="https://github.com/toml-rs/toml/commit/b91d460cc8584110c95d8eb7fcb2f45f86b6b14a"><code>b91d460</code></a>
fix(edit): Don't panic on inline table keys without values</li>
<li><a
href="https://github.com/toml-rs/toml/commit/c8087a6bc6ff1464c5731fca0f70404ec200226f"><code>c8087a6</code></a>
fix(parser): Improve unclosed array messages</li>
<li><a
href="https://github.com/toml-rs/toml/commit/f0a47d4a1f1243b78cc3c8c2263bf63f9df4c720"><code>f0a47d4</code></a>
fix(parser): Improve unclosed inline table messages</li>
<li>Additional commits viewable in <a
href="https://github.com/toml-rs/toml/compare/v0.24.0...v0.25.1">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-23 07:35:38 +00:00
Miles Silberling-Cook b61a924fbe Make release content show up first in reviews (#23469)
# Objective

Make release notes and migration guides show up first when viewing PRs
in github.

## Solution

Prefix the release-content directory with `_` so it sorts first.

## Testing

See for yourself.
2026-03-22 21:29:51 +00:00
charlotte 🌸 f3f3078736 Rust 1.94 (#23241)
https://blog.rust-lang.org/2026/03/05/Rust-1.94.0/
2026-03-06 06:38:27 +00:00
Luo Zhihao 73facce3f1 Fix build-wasm-example with --debug arg (#22543)
cargo profile is `dev` in debug build
2026-02-18 12:18:08 +00:00
Martín Maita f478cb3e5b Detailed Feature List for Collections (#22506)
# Objective

- Make it easier to understand what each feature collection is enabling.

## Solution

- Added the list of features that a collection will enable on its
description. These are located in the "cargo_features" templated doc
page.

## Testing

- Running the templated page generator for "features" and checking the
resulting markdown.

---

## Showcase

<img width="996" height="373" alt="image"
src="https://github.com/user-attachments/assets/9b31de60-ef33-4291-bd5f-2d1583467447"
/>
2026-01-14 18:25:09 +00:00
dependabot[bot] 83c6802a80 Update toml_edit requirement from 0.23.2 to 0.24.0 (#22232)
Updates the requirements on [toml_edit](https://github.com/toml-rs/toml)
to permit the latest version.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/toml-rs/toml/commit/2e094015675c23c868512590c84df0b6ce68e4ad"><code>2e09401</code></a>
chore: Release</li>
<li><a
href="https://github.com/toml-rs/toml/commit/e32c7a2f9b126d42fab0705e9783fec42b88e861"><code>e32c7a2</code></a>
chore: Release</li>
<li><a
href="https://github.com/toml-rs/toml/commit/df1c3286de0c7d3d8b77f417fb97f2413cb71807"><code>df1c328</code></a>
docs: Update changelog</li>
<li><a
href="https://github.com/toml-rs/toml/commit/b826cf4914de08adc437d948c3ff40fdfc2bb7ec"><code>b826cf4</code></a>
feat(edit)!: Allow <code>set_position(None)</code> (<a
href="https://redirect.github.com/toml-rs/toml/issues/1080">#1080</a>)</li>
<li><a
href="https://github.com/toml-rs/toml/commit/8043f20af7fe175c00d07e7965809001bd18bd88"><code>8043f20</code></a>
feat(edit)!: Allow <code>set_position(None)</code></li>
<li><a
href="https://github.com/toml-rs/toml/commit/a02c0db59fc7a68257d754759bb558602ba7e96d"><code>a02c0db</code></a>
feat: Support TOML 1.1 (<a
href="https://redirect.github.com/toml-rs/toml/issues/1079">#1079</a>)</li>
<li><a
href="https://github.com/toml-rs/toml/commit/5cfb838b15c4490a22b056c9f8a5bc9df2273a2a"><code>5cfb838</code></a>
feat(edit): Support TOML 1.1</li>
<li><a
href="https://github.com/toml-rs/toml/commit/1eb4d606d3a75bb87e3ee362fd89e5819fecad87"><code>1eb4d60</code></a>
feat(toml): Support TOML 1.1</li>
<li><a
href="https://github.com/toml-rs/toml/commit/695d7883d88745960225e873a62572567a8d570c"><code>695d788</code></a>
feat(edit)!: Multi-line inline tables with trailing commas</li>
<li><a
href="https://github.com/toml-rs/toml/commit/cc4f7acd94d214f4ea66254a97809711a712b895"><code>cc4f7ac</code></a>
feat(toml): Multi-line inline tables with trailing commas</li>
<li>Additional commits viewable in <a
href="https://github.com/toml-rs/toml/compare/v0.23.2...v0.24.0">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-22 19:41:04 +00:00
Kristoffer Søholm 16409b8a02 Fix lints after Rust 1.92 (#22092)
# Objective

CI is currently failing

## Solution

Fix the lints (and work around all the rustc lint bugs that are
apparently included)

---------

Co-authored-by: MichiRecRoom <1008889+LikeLakers2@users.noreply.github.com>
2025-12-12 09:10:29 +00:00
Sigma-dev e8520c1faf Added required features data to docs export (#21975)
# Objective

This PR is a sister PR necessary for the website to have
`required_features` data.
You will find more information on the motivations there:
https://github.com/bevyengine/bevy-website/pull/2313

## Solution

- Add the required_features data to the examples docs export

## Testing

I tested both together and it worked fine
2025-12-04 06:19:30 +00:00
Carter Anderson f3ec3c070e Cargo Feature Collections (#21472)
## 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@atlasdostal.com>
2025-10-10 02:42:54 +00:00
andriyDev 2146899cb8 Add a few basic tests for asset processing. (#21409)
# Objective

- `bevy_asset` needs more tests! This adds three related to asset
processing.

## Solution

- Create a new `MemoryAssetWriter` to pair with `MemoryAssetReader`.
- Adds a way to override whether the asset processor is created or not.
- Make `Data::value` and `Data::path` `pub` so that we can actually see
what is written to the processed dir. Note: `Dir::get_asset` returns
`Data` already, but it isn't usable.
- Add three tests: one to test that assets are copied to the processed
dir for no-processing assets, one to test that using a default processor
works, and one to test that an asset meta file works.

## Testing

- This adds testing! :D
2025-10-07 01:23:58 +00:00
Janis 20f6262c7a set spawn_despawn on the correct entity when despawning (#21364)
# Objective

Fixes #21293
Fixes #17314 to ensure that this is tested correctly.

## Solution
when despawning an entity, previously the swapped in (archetype) or
moved in entity (table) (which both require extra bookkeeping to update
archetype or table rows) were marked as `spawned_or_despawned` by the
location and tick that the to-be-removed entity was meant to be marked,
while the to-be-removed entity wasn't marked.
As pointed out by @akimakinai in
[#19047](https://github.com/bevyengine/bevy/pull/19047), I've re-added
the correct `mark_spawn_despawn` call to `despawn_with_caller`.

## Testing

I've added a test `spawned_after_swap_remove` that ensures that
despawning an entity by swapping doesn't effect other entities
`spawned_or_despawned` location, and that it does effect the despawned
entity's index's `spawned_or_despawned` location.

Co-Authored By: waterwhisperer24@qq.com

---------

Co-authored-by: WaterWhisperer <waterwhisperer24@qq.com>
2025-10-04 00:16:12 +00:00
Carter Anderson 5611bb4f41 Fix release content heading metadata syntax (#21178)
# Objective

The current exported release content syntax / formatting is slightly
wrong.

## Solution

Fix it!
2025-09-23 01:22:05 +00:00
François Mockers cdbc1a0499 Run release exporter in ci (#21067)
# Objective

- Fail PRs that add a release content that fails parsing

## Solution

- Add a check mode to the exporter tool
- Run it in CI

## Testing

- Should fail on this PR before
https://github.com/bevyengine/bevy/pull/21065 is merged
2025-09-15 22:02:27 +00:00
François Mockers 78db74d1a7 remove publish script (#21064)
# Objective

- the publish script didn't actually work, it was just a vague
instruction on how to get something working
- it needed manual adaptation for each version to have the correct crate
order
- it was not fun to do

## Solution

- `cargo +nightly publish --workspace` now works, use that instead
2025-09-15 20:52:42 +00:00
François Mockers ab8d7e353b Disable publishing for internal crates (#20986)
# Objective

- set `publish = false` for crates that won't be published
2025-09-12 18:06:32 +00:00
François Mockers a68d0022b6 sort examples categories on the website (#20839)
# Objective

- We should stop this madness
<img width="125" height="100" alt="Screenshot 2025-09-03 at 01 36 56"
src="https://github.com/user-attachments/assets/85bc38a8-b062-4692-9f22-a1021cc41ad2"
/>

## Solution

- Sort
2025-09-03 00:01:26 +00:00
Lucas f4de1ad088 Bump hashbrown to 0.16.0 (#20807)
# Objective

use the latest hashbrown, and foldhash version (foldhash went from 0.1.5
to 0.2.0)
small performance improvement in foldhash.

# Notes

`FoldHasher` now takes a lifetime, had to specify it.
2025-09-02 08:41:48 +00:00
charlotte 🌸 1c10a425d3 Use web assets for meshlet example (#20795)
We have web assets now, let's use them!

---------

Co-authored-by: François Mockers <francois.mockers@vleue.com>
2025-08-31 07:39:59 +00:00
Miles Silberling-Cook d2d6289a54 Release content export tool (#20500)
# Objective

Adds a simple tool to order and merge release notes and migration
guides.

To use, go to `tools/export-content` and use `cargo run`. 

The output formatting may need to be tweaked, and we will probably want
to add/change the zola shortcodes a bit.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: DAA <42379074+DaAlbrecht@users.noreply.github.com>
2025-08-15 16:24:27 +00:00
Gonçalo Rica Pais da Silva ef845e0cea Update rand, glam and encase to latest versions (#18047)
# Objective

New `rand` version, which means updating `glam` and `encase` to support
the newer ecosystem update. Does mean that this changes how WASM builds
need to be done in order to configure `getrandom` correctly, but this
can be remedied with updated docs.

## Solution

Updating all needed dependencies to their compatible versions. ~~This PR
is currently blocked by `encase`, which is waiting on [this
PR](https://github.com/teoxoy/encase/pull/88) to be merged and then a
new version published.~~ ~~This PR is no longer blocked~~,
~~`hexasphere` is blocking this PR now due to not yet having a new
release with the latest `glam` version support~~, The PR is all good to
go now, everything in order across glam/rand deps.

## Testing

- Must pass CI for all checks, tests, not introduce breaking changes.

---

## Migration Guide

With newer versions of `glam` & `encase`, the updated versions don't
seem to have introduced breakages, though as always, best to consult
their docs [1](https://docs.rs/glam/latest/glam/)
[2](https://docs.rs/encase/0.11.0/encase/) for any changes.

`rand` changes are more extensive, with changes such as `thread_rng()`
-> `rng()`, `from_entropy()` -> `from_os_rng()`, and so forth. `RngCore`
is now split into infallible `RngCore` and fallible `TryRngCore`, and
the `distributions` module has been renamed to `distr`. Most of this
affects only internals, and doesn't directly affect Bevy's APIs. For the
full set of changes, see `rand` [migration
notes](https://rust-random.github.io/book/update-0.9.html).

`getrandom` is also updated, and will require additional configuration
when building Bevy for WASM/Web (if also using `rand`). The full details
of how to do this is in the `getrandom` docs
[1](https://github.com/rust-random/getrandom?tab=readme-ov-file#opt-in-backends)
[2](https://github.com/rust-random/getrandom?tab=readme-ov-file#webassembly-support).

---------

Co-authored-by: François Mockers <francois.mockers@vleue.com>
2025-08-09 02:09:10 +00:00
Martín Maita e2ba37fcb2 Update toml_edit requirement from 0.22.7 to 0.23.2 (#20441)
# Objective

- Closes #20410

## Solution

- Updated a deprecated type alias name (`ImDocument` -> `Document`).

## Testing

- CI checks

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Liu <contact@jamessliu.com>
2025-08-09 01:19:51 +00:00
James Liu 8e52194d70 CI fixes for Rust 1.89 (#20462)
Adopted from #20456

Notes:

* The origin of the `dead_code` lints were coming from the `ShaderType `
derive macro. This has been reported as
https://github.com/teoxoy/encase/issues/102, and a temporary
workspace-wide `allow` added to the top level Cargo.toml.
* One of the lints pointed out that `PartialEq` and `Eq` may not work as
expected for function pointers, so `CloneBehavior` no longer implements
either trait, and pattern matching is used in instead.

Original PR Description:
># Objective
>
>Unbreak CI.
>
> ## Solution
>
> Fix the lints.
>
>I've opted for anonymous lifetimes in every revealed case so far;
please let me know if you think I should used named lifetimes in
specific cases and why.
>
>## Testing
>
>Is CI green?
>
>## Context
>
> This lint originally had a much larger splash damage, with fairly
negative effects on Bevy. See
https://github.com/rust-lang/rust/issues/131725.
>
> The more restricted former is much more helpful, despite the large
diff in this PR. Bevy is a large code base!
>
>## TODO
>
>- [x] discuss proposed lifetime lint fixes
>,- [x] use cargo clippy --fix to fix newly uncovered docs misformatting
>- [x] fix newly revealed dead code issues
>- [x] ensure CI is green

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Mike <mike.hsu@gmail.com>
2025-08-08 21:14:36 +00:00
Nicholas Nethercote 0fc17e9bc1 Trim dependencies. (#20426)
# Objective

Remove unneeded dependencies.

## Solution

Found using `cargo-shear`, `cargo-machete`, and `cargo-udeps`. They all
do the same thing (identify unused dependencies), they are all so-so at
it (with lots of false negatives and positives) but the combination of
all three is enough to get a useful outcome.

## Testing

- I double-checked all the removals by grepping for each removed
dependency's name within the affected crate, to make sure there weren't
any uses remaining. I think they're all ok.
- `cargo run -p ci`

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: James Liu <contact@jamessliu.com>
2025-08-06 08:44:47 +00:00
François Mockers 50a0ceb059 use the wasm-release profile for smaller bins and longer builds (#20419)
# Objective

- `cargo run -p build-wasm-example -- --api webgl2 breakout
--optimize-size` produces files that are too big for the website

## Solution

- Use the `wasm-release` profile which reduce the file size at the cost
of compile time


https://github.com/bevyengine/bevy/blob/e11a9e1167764235819b1803f629b40f9ac5131c/Cargo.toml#L4380-L4384
2025-08-05 18:51:12 +00:00
Lucas Franca 04cc4bb556 Side: Fix ci tool when running with --test-threads (#20346)
# Objective

`ci` tool fails if you run with `--test-threads` because `cargo test
--benches` does not take `--test-threads`

## Solution

Split the command that call `cargo test` into one for `--benches` and
other for `--lib --bins --tests`.

## Testing

Ran `cargo run -p ci -- --build-jobs 4 --test-threads 4`

## Note

This is a cherry-pick of a commit that was added to #19011 but was
unrelated to the PR
2025-08-02 17:54:57 +00:00
atlv 537adcc3f7 bevy_light (#19991)
# Objective

- make lights usable without bevy_render

## Solution

- make a new crate for lights to live in

## Testing

- 3d_scene, lighting, volumetric_fog, ssr, transmission, pcss,
light_textures

Note: no breaking changes because of re-exports, except for light
textures, which were introduced this cycle so it doesn't matter anyways
2025-07-07 00:07:38 +00:00
Martín Maita d7ce35234f Update ui_test requirement from 0.29.1 to 0.30.1 (#19799)
# Objective

- Fixes #19670

## Solution

- Updated breaking code to be able to upgrade `ui_test` to the latest
version.

## Testing

- CI checks.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 18:19:46 +00:00
François Mockers 97dcb279fb CI tests can exit directly after taking a screenshot (#19806)
# Objective

- Currently, CI tests take a screenshot at frame X and exits at frame Y
with X < Y, and both number fixed
- This means tests can take longer than they actually need when taking
the screenshot is fast, and can fail to take the screenshot when it's
taking too long

## Solution

- Add a new event `ScreenshotAndExit` that exit directly after the
screenshot is saved
2025-06-24 22:44:30 +00:00
Jan Hohenheim a750cfe4a1 Split CursorOptions off of Window (#19668)
# Objective

- Fixes #19627 
- Tackles part of #19644 
- Supersedes #19629
- `Window` has become a very very very big component
- As such, our change detection does not *really* work on it, as e.g.
moving the mouse will cause a change for the entire window
- We circumvented this with a cache
- But, some things *shouldn't* be cached as they can be changed from
outside the user's control, notably the cursor grab mode on web
- So, we need to disable the cache for that
- But because change detection is broken, that would result in the
cursor grab mode being set every frame the mouse is moved
- That is usually *not* what a dev wants, as it forces the cursor to be
locked even when the end-user is trying to free the cursor on the
browser
  - the cache in this situation is invalid due to #8949

## Solution

- Split `Window` into multiple components, each with working change
detection
- Disable caching of the cursor grab mode
- This will only attempt to force the grab mode when the `CursorOptions`
were touched by the user, which is *much* rarer than simply moving the
mouse.
- If this PR is merged, I'll do the exact same for the other
constituents of `Window` as a follow-up

## Testing

- Ran all the changed examples
2025-06-17 20:20:13 +00:00
Lucas Franca c8cb7bdf57 Allow passing number of thread for building and testing to CI (#19359)
# Objective

Fixes #16051
Closes #16145

## Solution

Allow passing `--build-jobs` and `--test-threads` to `ci`
i.e.
```
cargo run -p ci -- --build-jobs 4 --test-threads 4
```

## Testing

running ci locally

---------

Co-authored-by: Benjamin Brienen <Benjamin.Brienen@outlook.com>
2025-06-16 21:19:47 +00:00
andriyDev f47b1c00ee Bump ron version to 0.10. (#19631)
# Objective

- Update ron to the latest version.
- This is blocking changes to AnimationGraph (as some valid structs are
not capable of being deserialized).

## Solution

- Bump ron!

## Testing

- The particular issue I was blocked by seems to be resolved!
2025-06-13 19:54:31 +00:00
Carter Anderson 7e9d6d852b bevyengine.org -> bevy.org (#19503)
We have acquired [bevy.org](https://bevy.org) and the migration has
finished! Meaning we can now update all of the references in this repo.
2025-06-05 23:09:28 +00:00
SpecificProtagonist a266e7e642 More uninlined_format_args fixes (#19396)
# Objective

There are several uninlined format args (seems to be in more formatting
macros and in more crates) that are not detected on stable, but are on
nightly.

## Solution

Fix them.
2025-05-28 02:35:18 +00:00
Stepan Urazov 53f1c06e63 Added support for .wesl files to the regex pattern for examples (#19178)
## Objective

[Shaders / Material -
WESL](https://bevyengine.org/examples-webgpu/shaders/shader-material-wesl/)
example doesn't have a WESL file tab


## Solution

 Added wesl to regex

---------

Co-authored-by: Stepan Urazov <110625288+hg127@users.noreply.github.com>
2025-05-26 17:52:59 +00:00
oracle58 d7cab93495 Add debug build option to build-wasm-example (#19312)
## Objective

- Add a `--debug` flag to `build-wasm-example` to support debug builds
for WebGL2/WebGPU targets.
- Fixes #18464

## Solution
- Added `--debug` flag to build Wasm examples in debug mode.
- Default remains release mode if `--debug` is not specified.
- Updated documentation to describe the new flag and usage.

## Testing
- Verified debug and release builds for WebGL2 and WebGPU respectively.
- Confirmed wasm artifacts are placed in the correct target dir for each
build profile:
  - Debug: `target/wasm32-unknown-unknown/debug/examples/`
  - Release: `target/wasm32-unknown-unknown/release/examples/`
- Confirmed wasm-bindgen output is written to:
`examples/wasm/target/debug` , `examples/wasm/target/release`
- Haven't actually tested running the example

| Backend | Profile | Artifacts written | Build success    |
|---------|---------|-------------------|------------------|
| webgl2 | debug | ✓ | ✓ |
| webgl2 | release | ✓ | ✓ |
| webpgu | debug | ✓ | ✓ |
| webpgu | release | ✓ | ✓ |

### Examples

**Debug**
```
$ cargo run -p build-wasm-example -- --api webgl2 --debug load_gltf
```
```
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 02s
wasm-bindgen --out-dir examples/wasm/target/debug --out-name wasm_example --target web target/wasm32-unknown-unknown/debug/examples/load_gltf.wasm
```

**Release**
```
$ cargo run -p build-wasm-example -- --api webgl2 load_gltf`
```
```
Finished `release` profile [optimized] target(s) in 1m 08s
wasm-bindgen --out-dir examples/wasm/target/release --out-name wasm_example --target web target/wasm32-unknown-unknown/release/examples/load_gltf.wasm
```

---------

Co-authored-by: Rob Parrett <robparrett@gmail.com>
2025-05-24 01:43:57 +00:00
Kristoffer Søholm 9214fd649d Fix compilation of compile_fail_utils when not using rustup (#18394)
# Objective

Currently the `compile_fail_utils` crate fails to compile (ironic) when
the `RUSTUP_HOME` env var isn't set. This has been the case for a long
time, but I only noticed it recently due to rust-analyzer starting to
show the error.

## Solution

Only filter the logs for the `RUSTUP_HOME` variable if it's set.
2025-03-30 02:33:03 +00:00
François Mockers 0d90da896b don't wait during publishing (#18563)
# Objective

- Publishing takes a long time
- There's a 20 second wait between crates to not hit the rate limit on
crates.io

## Solution

- Our rate limit has been increased by the crates.io team, don't wait
anymore!
2025-03-26 21:27:29 +00:00
Asier Illarramendi faef6d18e2 Split example file docblock and code when generating web examples markdown (#18191)
# Objective

Separate example explanation (file docblock) and the code so they can be
layout differently in the website and we can give a higher importance to
the explanation on the [website search
tool](https://github.com/bevyengine/bevy-website/pull/1935). This would
also allow us to improve the examples so they become even more like a
cookbook.

## Solution

Update the `example-showcase` tool to extract the example file docblock
and write it as the example markdown content. This allows us to access
the explanation via `page.content` in Zola.

## Testing

I've checked that the output is correct after running the tool and it
doesn't throw any error. I've also validated that the approach will work
on the website.

## Showcase

This is a quick and dirty example of what we could do in the web
examples after the change. When we implement the real thing we can put
the explanation on a sidebar or explore other layout options.

<img width="1362" alt="image"
src="https://github.com/user-attachments/assets/6738542e-31c3-41cd-972a-7fa2e942e85d"
/>
2025-03-19 20:01:37 +00:00
François Mockers ac53e4c482 only handle bin examples in showcase (#18374)
# Objective

- Some examples are now build as lib to be usable in other examples
since https://github.com/bevyengine/bevy/pull/18288
- Those examples are not correctly handled in the showcase as it tries
to run them

## Solution

- Ignore lib examples in showcase when taking screenshots or building
for the website
2025-03-18 00:52:42 +00:00
Martín Maita d70c469483 Update ui_test requirement from 0.23.0 to 0.29.1 (#18289)
# Objective

- Fixes #18223.

## Solution

- Updated ui_test requirement from 0.23.0 to 0.29.1.
- Updated code to use the new APIs.

## Testing

- Ran CI locally.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 16:34:33 +00:00
Cyrill Schenkel 8570af1d96 Add print_stdout and print_stderr lints (#17446) (#18233)
# Objective

- Prevent usage of `println!`, `eprintln!` and the like because they
require `std`
- Fixes #17446

## Solution

- Enable the `print_stdout` and `print_stderr` clippy lints
- Replace all `println!` and `eprintln!` occurrences with `log::*` where
applicable or alternatively ignore the warnings

## Testing

- Run `cargo clippy --workspace` to ensure that there are no warnings
relating to printing to `stdout` or `stderr`
2025-03-11 19:35:48 +00:00
Benjamin Brienen c3ff6d4136 Fix non-crate typos (#18219)
# Objective

Correct spelling

## Solution

Fix typos, specifically ones that I found in folders other than /crates

## Testing

CI

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2025-03-11 06:17:48 +00:00