Skip to content

Commit c4d2831

Browse files
authored
Merge branch 'main' into 396_add_accesibility_lints_to_ci
2 parents e59cf23 + 49a2397 commit c4d2831

File tree

26 files changed

+132
-49
lines changed

26 files changed

+132
-49
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,22 @@ jobs:
107107
npx wait-on http://127.0.0.1:1111
108108
npx pa11y-ci --sitemap http://127.0.0.1:1111/sitemap.xml
109109
110+
typos:
111+
runs-on: ubuntu-latest
112+
timeout-minutes: 30
113+
steps:
114+
- uses: actions/checkout@v4
115+
- name: Check for typos
116+
uses: crate-ci/[email protected]
117+
- name: Typos info
118+
if: failure()
119+
run: |
120+
echo 'To fix typos, please run `typos -w`'
121+
echo 'To check for a diff, run `typos`'
122+
echo 'You can find typos here: https://crates.io/crates/typos'
123+
echo 'if you use VSCode, you can also install `Typos Spell Checker'
124+
echo 'You can find the extension here: https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode'
125+
110126
generate-assets:
111127
needs: [super-linter, test-code-examples, lint-tools, check-hide-lines]
112128
runs-on: ubuntu-latest

code-validation/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! This crate is used to validate the rust code of the `bevy` website.
22
//!
3-
//! It is currently used to validate the rust code of the offical `bevy` book.
3+
//! It is currently used to validate the rust code of the official `bevy` book.
44
//! The modules represents the folder structure of the website.
55
66
mod learn {

content/learn/book/ecs/entities-components.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ status = 'hidden'
77
+++
88

99
**Entities** are the fundamental objects of your game world, whizzing around, storing cameras, being controlled by the player or tracking the state of a button.
10-
On its own, the [`Entity`] type is a simple identifer: it has neither behavior nor data.
10+
On its own, the [`Entity`] type is a simple identifier: it has neither behavior nor data.
1111
Components store this data, and define the overlapping categories that the entity belongs to.
1212

1313
Informally, we use the term "entity" to refer to the conceptual entry in our [`World`]: all of the component data with the correct identifier, although it's very rare to use all of the data for a single entity at once.
@@ -44,7 +44,7 @@ fn spawning_system(mut commands: Commands){
4444
## Working With Components
4545

4646
Spawning an entity doesn't add any behavior or create a "physical object" in our game like it might in other engines.
47-
Instead, all it does is provide us an [`Entity`] identifer for a collection of component data.
47+
Instead, all it does is provide us an [`Entity`] identifier for a collection of component data.
4848

4949
In order to make this useful, we need to be able to add, remove and modify component data for each entity.
5050

@@ -354,7 +354,7 @@ Over time, the Bevy community has converged on a few standard pieces of advice f
354354
- not as useful as you might hope for upholding invariants; components will be able to be accidentally modified independently later
355355
- use [struct update syntax] to modify component bundles
356356
- [`..default()`] is a particularly common idiom, to modify a struct from its default values
357-
- consider definining traits for related components
357+
- consider defining traits for related components
358358
- this allows you to ensure a consistent interface
359359
- this can be very powerful in combination with generic systems that use trait bounds
360360

content/learn/migration-guides/0.10-to-0.11.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ use bevy::ecs::reflect::AppTypeRegistry
725725
<div class="migration-guide-area-tag">Scenes</div>
726726
</div>
727727

728-
In `bevy_ecs`, `ReflectMapEntities::map_entites` now requires an additional `entities` parameter to specify which entities it applies to. To keep the old behavior, use the new `ReflectMapEntities::map_all_entities`, but consider if passing the entities in specifically might be better for your use case to avoid bugs.
728+
In `bevy_ecs`, `ReflectMapEntities::map_entities` now requires an additional `entities` parameter to specify which entities it applies to. To keep the old behavior, use the new `ReflectMapEntities::map_all_entities`, but consider if passing the entities in specifically might be better for your use case to avoid bugs.
729729

730730
### [Require `#[derive(Event)]` on all Events](https://github.com/bevyengine/bevy/pull/7086)
731731

content/learn/migration-guides/0.11-to-0.12.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,3 +1550,23 @@ App::new()
15501550
```
15511551

15521552
</div>
1553+
1554+
### [View Transformations](https://github.com/bevyengine/bevy/pull/9726)
1555+
1556+
`mesh_functions::mesh_position_world_to_clip` was moved and renamed to `view_transformations::position_world_to_clip`. It now also takes a `vec3` instead of a `vec4` so you will need to use `vec4.xyz` to get a `vec3`.
1557+
1558+
```rust
1559+
// 0.11
1560+
#import bevy_pbr::mesh_functions::mesh_position_world_to_clip
1561+
fn mesh_position_local_to_clip(model: mat4x4<f32>, vertex_position: vec4<f32>) -> vec4<f32> {
1562+
let world_position = mesh_position_local_to_world(model, vertex_position);
1563+
return mesh_position_world_to_clip(world_position);
1564+
}
1565+
1566+
// 0.12
1567+
#import bevy_pbr::view_transformations::position_world_to_clip;
1568+
fn mesh_position_local_to_clip(model: mat4x4<f32>, vertex_position: vec4<f32>) -> vec4<f32> {
1569+
let world_position = mesh_position_local_to_world(model, vertex_position);
1570+
return position_world_to_clip(world_position.xyz);
1571+
}
1572+
```

content/learn/migration-guides/0.12-to-0.13.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The `ReadAssetBytesError::Io` variant now contains two named fields instead of c
6262
<div class="migration-guide-area-tag">Assets</div>
6363
</div>
6464

65-
If you relied on any of the panicing `From<Untyped...>` implementations, simply call the existing `typed` methods instead. Alternatively, use the new `TryFrom` implementation instead to directly expose possible mistakes.
65+
If you relied on any of the panicking `From<Untyped...>` implementations, simply call the existing `typed` methods instead. Alternatively, use the new `TryFrom` implementation instead to directly expose possible mistakes.
6666

6767
### [Use `impl Into<A>` for `Assets::add`](https://github.com/bevyengine/bevy/pull/10878)
6868

@@ -577,7 +577,7 @@ Calls to `fn map_entities(&mut self, entity_mapper: &mut EntityMapper)` need to
577577
The `PipelinedRendering` plugin is no longer exported on wasm. If you are including it in your wasm builds you should remove it.
578578

579579
```rust
580-
#[cfg(all(not(target_arch = "wasm32"))]
580+
#[cfg(not(target_arch = "wasm32"))]
581581
app.add_plugins(bevy_render::pipelined_rendering::PipelinedRenderingPlugin);
582582
```
583583

@@ -1115,11 +1115,11 @@ pub struct MyDynamicLabel(&'static str);
11151115
#### Nodes
11161116

11171117
- `bevy_core_pipeline::core_2d::graph`:
1118-
- `node::MSAA_WRITEBACK -> Node2d::MsaaWriteback` `node::MAIN_PASS ->Node2d::MainPass` `node::BLOOM -> Node2d::Bloom` `node::TONEMAPPING -> Node2d::Tonemapping` `node::FXAA -> Node2d::Fxaa` `node::UPSCALING -> Node2d::Upscaling` `node::CONTRAST_ADAPTIVE_SHARPENING -> Node2d::ConstrastAdaptiveSharpening` `node::END_MAIN_PASS_POST_PROCESSING -> Node2d::EndMainPassPostProcessing`
1118+
- `node::MSAA_WRITEBACK -> Node2d::MsaaWriteback` `node::MAIN_PASS ->Node2d::MainPass` `node::BLOOM -> Node2d::Bloom` `node::TONEMAPPING -> Node2d::Tonemapping` `node::FXAA -> Node2d::Fxaa` `node::UPSCALING -> Node2d::Upscaling` `node::CONTRAST_ADAPTIVE_SHARPENING -> Node2d::ContrastAdaptiveSharpening` `node::END_MAIN_PASS_POST_PROCESSING -> Node2d::EndMainPassPostProcessing`
11191119
- `bevy_core_pipeline::core_3d::graph`:
11201120
- `node::MSAA_WRITEBACK -> Node3d::MsaaWriteback` `node::PREPASS -> Node3d::Prepass` `node::DEFERRED_PREPASS -> Node3d::DeferredPrepass` `node::COPY_DEFERRED_LIGHTING_ID -> Node3d::CopyDeferredLightingId` `node::END_PREPASSES -> Node3d::EndPrepasses` `node::START_MAIN_PASS -> Node3d::StartMainPass` `node::MAIN_OPAQUE_PASS -> Node3d::MainOpaquePass` `node::MAIN_TRANSMISSIVE_PASS -> Node3d::MainTransmissivePass` `node::MAIN_TRANSPARENT_PASS -> Node3d::MainTransparentPass` `node::END_MAIN_PASS -> Node3d::EndMainPass` `node::BLOOM -> Node3d::Bloom` `node::TONEMAPPING -> Node3d::Tonemapping` `node::FXAA -> Node3d::Fxaa` `node::UPSCALING -> Node3d::Upscaling` `node::CONTRAST_ADAPTIVE_SHARPENING -> Node3d::ContrastAdaptiveSharpening` `node::END_MAIN_PASS_POST_PROCESSING -> Node3d::EndMainPassPostProcessing`
11211121
- `bevy_core_pipeline`: `taa::draw_3d_graph::node::TAA -> Node3d::Taa`
1122-
- `bevy_pbr`: `draw_3d_graph::node::SHADOW_PASS -> NodePbr::ShadowPass` `ssao::draw_3d_graph::node::SCREEN_SPACE_AMBIENT_OCCLUSION -> NodePbr::ScreenSpaceAmbientOcclusion` `deferred::DEFFERED_LIGHTING_PASS -> NodePbr::DeferredLightingPass`
1122+
- `bevy_pbr`: `draw_3d_graph::node::SHADOW_PASS -> NodePbr::ShadowPass` `ssao::draw_3d_graph::node::SCREEN_SPACE_AMBIENT_OCCLUSION -> NodePbr::ScreenSpaceAmbientOcclusion` `deferred::DEFERRED_LIGHTING_PASS -> NodePbr::DeferredLightingPass`
11231123
- `bevy_render`: `main_graph::node::CAMERA_DRIVER -> graph::CameraDriverLabel`
11241124
- `bevy_ui::render`: `draw_ui_graph::node::UI_PASS -> graph::Nodeui::UiPass`
11251125

@@ -1386,7 +1386,7 @@ Callers of `Transform::up()` and similar functions may have to dereference the r
13861386

13871387
The clipped areas of UI nodes are no longer interactive.
13881388

1389-
`RelativeCursorPostion` is now calculated relative to the whole node’s position and size, not only the visible part. Its `mouse_over` method only returns true when the cursor is over an unclipped part of the node.
1389+
`RelativeCursorPosition` is now calculated relative to the whole node’s position and size, not only the visible part. Its `mouse_over` method only returns true when the cursor is over an unclipped part of the node.
13901390

13911391
`RelativeCursorPosition` no longer implements `Deref` and `DerefMut`.
13921392

@@ -1450,6 +1450,19 @@ Common examples of the updated variants are as follows:
14501450

14511451
See the relevant [documentation](https://docs.rs/bevy/0.13.0/bevy/input/keyboard/enum.KeyCode.html) for more information.
14521452

1453+
#### ReceivedCharacter changes
1454+
1455+
The `char` field of [`ReceivedCharacter`] is now a [`SmolStr`], and _could_ contain multiple characters. See these [winit docs] for details.
1456+
1457+
A simple workaround if you need a `char` is to call `.chars().last()`.
1458+
1459+
It's now possible to use [`KeyEvent::logical_key`]'s `Character` variant instead if you need consistent cross-platform behavior and/or a unified event stream with non-character events.
1460+
1461+
[winit docs]: https://docs.rs/winit/0.29.10/winit/event/struct.KeyEvent.html#structfield.text
1462+
[`SmolStr`]: https://docs.rs/smol_str/0.2.1/smol_str/struct.SmolStr.html
1463+
[`ReceivedCharacter`]: https://docs.rs/bevy/latest/bevy/prelude/struct.ReceivedCharacter.html
1464+
[`KeyEvent::logical_key`]: https://docs.rs/bevy/latest/bevy/input/keyboard/struct.KeyboardInput.html#structfield.logical_key
1465+
14531466
### [Remove CanvasParentResizePlugin](https://github.com/bevyengine/bevy/pull/11057)
14541467

14551468
<div class="migration-guide-area-tags">
@@ -1488,14 +1501,6 @@ Consider changing usage:
14881501

14891502
`Window` has a new [`name`](https://docs.rs/bevy/latest/bevy/prelude/struct.Window.html#structfield.name) field for specifying the "window class name." If you don't need this, set it to `None`.
14901503

1491-
### [ReceivedCharacter.char is now SmolStr instead of char]
1492-
1493-
<div class="migration-guide-area-tags">
1494-
<div class="migration-guide-area-tag">Windowing</div>
1495-
</div>
1496-
1497-
To restore the previous behavior, use `.chars().nth(0)`
1498-
14991504
### [delete methods deprecated in 0.12](https://github.com/bevyengine/bevy/pull/10693)
15001505

15011506
<div class="migration-guide-area-tags">

content/learn/migration-guides/0.4-to-0.5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ It is still possible to register the driver manually using
247247

248248
## ChangedRes removed
249249

250-
This change was made to allow for more flexiblity and more consistent behavior with change detection for components.
250+
This change was made to allow for more flexibility and more consistent behavior with change detection for components.
251251

252252
```rust
253253
// 0.4

content/learn/migration-guides/0.5-to-0.6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl Plugin for SomePlugin {
6969
### The "Component" trait now needs to be derived
7070

7171
Bevy no longer has a blanket implementation for the [`Component`] trait.
72-
Instead you need to derive (or manualy implement) the trait for every Type that needs it.
72+
Instead you need to derive (or manually implement) the trait for every Type that needs it.
7373

7474
```rust
7575
// 0.5

content/learn/migration-guides/0.7-to-0.8.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ camera.world_to_viewport(transform, world_position);
7272

7373
### [Visibilty Inheritance, universal ComputedVisibility and RenderLayers support](https://github.com/bevyengine/bevy/pull/5310)
7474

75-
[`Visibility`] is now propagated into children in a similar way to `Transform`. Root elements of a hierarchy must now contain [`Visibility`] and [`ComputedVisiblity`] for visibility propagation to work.
75+
[`Visibility`] is now propagated into children in a similar way to `Transform`. Root elements of a hierarchy must now contain [`Visibility`] and [`ComputedVisibility`] for visibility propagation to work.
7676

7777
[`SpatialBundle`] and [`VisibilityBundle`] have been added for convenience. If you were using a `TransformBundle` you should probably be using a [`SpatialBundle`] now.
7878

79-
If you were previously reading `Visibility::is_visible` as the "actual visibility" for sprites or lights, use `ComputedVisibilty::is_visible()` instead:
79+
If you were previously reading `Visibility::is_visible` as the "actual visibility" for sprites or lights, use `ComputedVisibility::is_visible()` instead:
8080

8181
```rust
8282
// 0.7
@@ -99,7 +99,7 @@ fn system(query: Query<&ComputedVisibility>) {
9999
```
100100

101101
[`Visibility`]: https://docs.rs/bevy/0.8.0/bevy/render/view/struct.Visibility.html
102-
[`ComputedVisiblity`]: https://docs.rs/bevy/0.8.0/bevy/render/view/struct.ComputedVisibility.html
102+
[`ComputedVisibility`]: https://docs.rs/bevy/0.8.0/bevy/render/view/struct.ComputedVisibility.html
103103
[`SpatialBundle`]: https://docs.rs/bevy/0.8.0/bevy/prelude/struct.SpatialBundle.html
104104
[`VisibilityBundle`]: https://docs.rs/bevy/0.8.0/bevy/prelude/struct.VisibilityBundle.html
105105

content/learn/migration-guides/0.9-to-0.10.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ app.configure_sets(
103103
#### Label types
104104

105105
System labels have been renamed to systems sets and unified with stage labels.
106-
The `StageLabel` trait should be replaced by a system set, using the `SystemSet` trait as dicussed immediately below.
106+
The `StageLabel` trait should be replaced by a system set, using the `SystemSet` trait as discussed immediately below.
107107

108108
Before:
109109

0 commit comments

Comments
 (0)