Upgrade to Bevy 0.19 and adopt 0.19 idioms (required components, BSN, validation parity) - #77
Open
rozgo wants to merge 3 commits into
Open
Upgrade to Bevy 0.19 and adopt 0.19 idioms (required components, BSN, validation parity)#77rozgo wants to merge 3 commits into
rozgo wants to merge 3 commits into
Conversation
- Replace component bundles with required components: BigSpace requires Grid + GlobalTransform (+ Visibility with the camera feature), FloatingOrigin requires CellCoord, and CellCoord now also requires Visibility. BigSpatialBundle, BigGridBundle, and BigSpaceRootBundle are removed. - Update dependency pins from 0.19.0-rc.3 to the final 0.19.0 release. - Add BSN support: all components are Default + Clone, making them bsn!-authorable with no extra dependency; add examples/bsn.rs. - Install ValidateParentHasComponentPlugin::<GlobalTransform> in BigSpacePropagationPlugin, restoring the hierarchy validation apps lose by disabling TransformPlugin on bevy 0.19. - Add a multi_threaded passthrough feature mirroring bevy_transform 0.19's explicit multi_threaded opt-in. - Add BigSpaceDebugSettings::label_cells, drawing occupied-cell coordinates with bevy 0.19 text gizmos. - Fix new clippy 1.97 lints (some_filter, while_let_loop).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Upgrade
big_spaceto Bevy 0.19.0 — and adopt Bevy 0.19's idioms end to end rather than doing the minimum to compile, positioning the crate for where Bevy is heading (required components everywhere, BSN / editor era).Baseline migration
The mechanical migration largely matches #73 (done independently — thanks @m-edlund): pins bumped to
0.19.0,SceneRoot→WorldAssetRoot,FontSize::Px,TextLayout::justify,shadow_maps_enabled,Hdrfrombevy::camera, optionalSkybox::image, fallibleSystemState::get_mut, README compat table, version bump to0.13.0.Beyond the baseline
BigSpatialBundle,BigGridBundle, andBigSpaceRootBundleare removed.BigSpacerequiresGrid+GlobalTransform(+Visibilitywith thecamerafeature) — a root is now justcommands.spawn(BigSpace::default()).FloatingOriginrequiresCellCoord, sospawn(FloatingOrigin)is a complete, valid origin.CellCoordadditionally requiresVisibility(camera feature), so visibility hierarchies can no longer silently break on intermediate spatial nodes.spawn_spatial/spawn_gridnow spawn a single component and let requires fill in the rest.big_spacecomponents areDefault + Clone, which makes thembsn!-authorable with zero new dependencies (BSN templates are blanket-implemented forDefault + Clone). A newbsnexample declares an entire floating-origin world — root grid, floating-origin camera, a constellation of cells — as data. This addresses thebsn!integration gap noted in the update to bevy 0.19 #73 discussion.TransformPlugininstallsValidateParentHasComponentPlugin::<GlobalTransform>— which everybig_spaceapp silently loses, sinceTransformPluginmust be disabled.BigSpacePropagationPluginnow installs it itself.multi_threadedfeature: Bevy 0.19 no longer implies parallel transform propagation viastd; it's an explicit opt-in.big_spacenow mirrors that with amulti_threadedpassthrough (bevy_ecs / bevy_tasks / bevy_transform), so subcrate-only consumers can opt in; full-bevyusers get it via feature unification as before.BigSpaceDebugSettings::label_cellsdraws occupied-cell coordinates with 0.19's new text gizmos.some_filterandwhile_let_loop, which fire on pre-existing code infloating_origins.rsandstationary.rsand fail the-D warningsCI job. Fixed here.Design note for reviewers
Griddeliberately does not requireTransformorCellCoord: aBigSpaceroot must never have aTransform— its absence is the invariant that keeps the low-precision compat propagation (bevy_compat::propagate_parent_transforms) disjoint from the high-precision propagation. This invariant is now documented at theBigSpacedefinition.Relationship to #73
This PR is a superset of #73's migration, so feel free to treat them as alternatives. Two small notes on #73 in case it's preferred as the base: it accidentally renames
GLTF_SceneRootNode→GLTF_WorldAssetRootNodeinsideassets/models/low_poly_spaceship/scene.gltf(that string is Blender's exporter node naming, unrelated to the Bevy API), and its CI ran before Rust 1.97, so the new clippy lints above will fail its next re-run. If maintainers prefer merging #73 first, the modernization commits here rebase cleanly on top.Testing
check --all-features --all-targets,check --no-default-features --features=libm,clippy -D warnings,doc -D warnings, 40/40 tests + doctests, wasm32 check.minimaland newbsnexamples against Bevy 0.19.0 — no warnings, panics, or hierarchy-validation errors.