🤖 Fix proofreading issues in bevy skills

- Fix `ref` keyword used as variable name in code examples
- Fix "retries next tick" → systems continue on normal schedule
- Fix `State::set()` → `NextState::set()` in upgrade skill
- Fix `SceneRoot` → `WorldAssetRoot` for 0.19 consistency
- Fix Replace lifecycle event description (overwritten, not removed)
- Fix grep patterns (quoting, trailing spaces)
- Remove third-party physics/networking content (not Bevy built-ins)
This commit is contained in:
2026-07-07 17:52:20 +02:00
parent c661027d19
commit 8988b16bee
6 changed files with 12 additions and 23 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ Bevy ships breaking changes every minor release. Upgrades are tractable if run a
## Workflow
1. **Establish current and target versions.** Read `Cargo.toml` (`bevy` plus ecosystem crates: physics, UI, networking — each is pinned to a Bevy minor and must be bumped in lockstep).
1. **Establish current and target versions.** Read `Cargo.toml` (`bevy` plus ecosystem crates — each is pinned to a Bevy minor and must be bumped in lockstep).
2. **Upgrade one minor version at a time.** Skipping versions compounds renames and makes errors unattributable. For each bump:
1. Bump `bevy` and every Bevy-ecosystem crate to versions compatible with the target. If an ecosystem crate has no compatible release, stop and surface it — that blocks the bump.
2. `cargo check`, then apply the **rename table** for the transition (see references) across all errors. These are mechanical.
@@ -43,7 +43,7 @@ When `Cargo.toml` is ambiguous (workspace inheritance, git deps), the code itsel
## The traps of upgrading
- **Renames that compile but misbehave**: some old names still exist with new meaning. `Event` compiles in 0.18+ but means observer-events, not buffered messages — a mechanical `EventWriter → MessageWriter` port is right, but a type left as `#[derive(Event)]` and "written" nowhere fires no observers silently.
- **Behavior shifts need runtime verification**: `State::set()` same-state re-firing (0.18), transform-propagation reads, `Query<Entity>` matching resource entities (0.19). `cargo check` proves nothing here — run it.
- **Behavior shifts need runtime verification**: `NextState::set()` same-state re-firing (0.18), transform-propagation reads, `Query<Entity>` matching resource entities (0.19). `cargo check` proves nothing here — run it.
- **Ecosystem crates lag.** A Bevy bump is only as ready as its slowest dependency. Check compatibility before starting, not after.
- **Don't modernize mid-bump.** During a bump, make the minimal change that satisfies the new API; idiomatic rewrites happen after the chain is complete (with the bevy-0.19 skill). Mixing the two makes regressions unattributable.
@@ -33,7 +33,7 @@ New in 0.18: `#[derive(EntityEvent)]` with `#[event_target]` for entity-targeted
## API shape changes
- **Fallible systems**: systems may return `Result` (= `Result<(), BevyError>`); errors log and the system retries next tick. Adopt during the bump wherever it deletes `unwrap()`s cheaply; systematically during cleanup.
- **Fallible systems**: systems may return `Result` (= `Result<(), BevyError>`); errors are logged and the system continues running on its normal schedule. Adopt during the bump wherever it deletes `unwrap()`s cheaply; systematically during cleanup.
- **Mesh accessors** became `try_*` returning `Result<_, MeshAccessError>`.
- **`MaterialPlugin` fields** `prepass_enabled` / `shadows_enabled` became `Material` trait methods.
- **`LoadContext::path()`** returns `AssetPath`, not `Path`; image `reinterpret_*` methods return `Result`.
@@ -52,6 +52,6 @@ New in 0.18: `#[derive(EntityEvent)]` with `#[event_target]` for entity-targeted
2. `grep -rn "derive(Event)"` — decide per type: buffered (→ `Message`) or observed (stays `Event`, needs a trigger + observer).
3. `grep -rn "remove_child\|clear_children"` — rename to `detach_*`.
4. `grep -rn "next_state.set\|NextState"` — audit same-state re-fire.
5. `grep -rn "@group(2)" --include=*.wgsl` — move material bindings to group 3.
5. `grep -rn "@group(2)" --include="*.wgsl"` — move material bindings to group 3.
6. `grep -rn "AmbientLight"` — split into resource vs camera component usage.
7. Check `Cargo.toml` for `default-features = false` on bevy → add input features.
@@ -14,7 +14,7 @@ Smaller than 0.17→0.18 but with one deep semantic change: resources became com
## API shape changes
- **`Assets::get_mut`** returns `AssetMut<A>` (mutation-tracked), not `&mut A`. Deref for access; code storing the `&mut A` needs restructuring.
- **`Ref<T>.clone()`** returns `Ref<T>`, not the inner value. Old code relying on clone-through must use `ref.deref().clone()`.
- **`Ref<T>.clone()`** returns `Ref<T>`, not the inner value. Old code relying on clone-through must use `val.deref().clone()`.
- **GLTF material loading** returns `GltfMaterial`; request a `StandardMaterial` with the `#Material0/std` label suffix.
- **`EntityComponentsTrigger`** gained archetype fields — exhaustive destructuring breaks; add `..`:
`let EntityComponentsTrigger { components, .. } = e.trigger();`
@@ -28,9 +28,9 @@ Smaller than 0.17→0.18 but with one deep semantic change: resources became com
## Porting checklist
1. `grep -rn "SceneRoot\|Scene>" ` — rename to `WorldAssetRoot`/`WorldAsset`.
1. `grep -rn "SceneRoot\|Scene>"` — rename to `WorldAssetRoot`/`WorldAsset`.
2. `grep -rn "Query<Entity[,>]"` and other broad queries — add `Without<IsResource>` where resources must not appear.
3. `grep -rn "derive(Component" | grep "Resource"` — find dual-derive types; split them.
4. `grep -rn "get_mut" ` on `Assets<...>` — adapt to `AssetMut`.
4. `grep -rn "get_mut"` on `Assets<...>` — adapt to `AssetMut`.
5. `grep -rn "EntityComponentsTrigger {"` — add `..` to destructuring.
6. GLTF material handles — append `/std` labels where `StandardMaterial` is expected.