Files
reliquary/plugins/bevy/skills/bevy-upgrade/references/0.18-to-0.19.md
T
g4borg 8988b16bee 🤖 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)
2026-07-07 17:52:20 +02:00

37 lines
2.3 KiB
Markdown

# 0.18 → 0.19
Smaller than 0.17→0.18 but with one deep semantic change: resources became components. Official guide for the long tail: `https://bevy.org/learn/migration-guides/0-18-to-0-19/`.
## Renames & moves (mechanical)
| Old (0.18) | New (0.19) |
|------------|-----------|
| `Scene` / `SceneRoot` | `WorldAsset` / `WorldAssetRoot` |
| `AssetPath::resolve(&str)` / `resolve_embed(&str)` | `resolve_str()` / `resolve_embed_str()` (`resolve()`/`resolve_embed()` now take `&AssetPath`) |
| `Hdr` in `bevy_render` | `bevy_camera` |
| `Camera` screen-space specular transmission fields | `ScreenSpaceTransmission` component |
## 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 `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();`
## Semantic shifts (audit, don't just compile)
- **Resources are components on abstract entities.** Consequences:
- `Query<Entity>` and other very broad queries now match resource entities. Any "iterate all entities" logic (cleanup sweeps, entity counts, serialization, debug overlays) silently includes resources — filter with `Without<IsResource>`.
- A type can no longer derive both `Component` and `Resource`. Split such types or pick one role.
- **Scene rename is semantic-adjacent**: `WorldAsset` naming reflects the same data model, but grep for the old names in strings/reflection paths, not just types.
## Porting checklist
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`.
5. `grep -rn "EntityComponentsTrigger {"` — add `..` to destructuring.
6. GLTF material handles — append `/std` labels where `StandardMaterial` is expected.