Skip to content

Commit 40b6940

Browse files
authored
Remove Manual Type Registrations (#20435)
# Objective Thanks to #15030, we no longer need manual type registrations. This should only be merged after #15030. ## Solution Remove all manual (non generic) type registrations.
1 parent 1bd9c46 commit 40b6940

File tree

71 files changed

+115
-470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+115
-470
lines changed

crates/bevy_animation/src/lib.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use bevy_reflect::{prelude::ReflectDefault, Reflect, TypePath};
4040
use bevy_time::Time;
4141
use bevy_transform::TransformSystems;
4242
use bevy_utils::{PreHashMap, PreHashMapExt, TypeIdMap};
43-
use petgraph::graph::NodeIndex;
4443
use serde::{Deserialize, Serialize};
4544
use thread_local::ThreadLocal;
4645
use tracing::{trace, warn};
@@ -60,7 +59,7 @@ pub mod prelude {
6059
use crate::{
6160
animation_curves::AnimationCurve,
6261
graph::{AnimationGraph, AnimationGraphAssetLoader, AnimationNodeIndex},
63-
transition::{advance_transitions, expire_completed_transitions, AnimationTransitions},
62+
transition::{advance_transitions, expire_completed_transitions},
6463
};
6564
use alloc::sync::Arc;
6665

@@ -1234,12 +1233,6 @@ impl Plugin for AnimationPlugin {
12341233
.init_asset_loader::<AnimationGraphAssetLoader>()
12351234
.register_asset_reflect::<AnimationClip>()
12361235
.register_asset_reflect::<AnimationGraph>()
1237-
.register_type::<AnimationPlayer>()
1238-
.register_type::<AnimationTarget>()
1239-
.register_type::<AnimationTransitions>()
1240-
.register_type::<AnimationGraphHandle>()
1241-
.register_type::<NodeIndex>()
1242-
.register_type::<ThreadedAnimationGraphs>()
12431236
.init_resource::<ThreadedAnimationGraphs>()
12441237
.add_systems(
12451238
PostUpdate,

crates/bevy_anti_aliasing/src/contrast_adaptive_sharpening/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ impl Plugin for CasPlugin {
103103
fn build(&self, app: &mut App) {
104104
embedded_asset!(app, "robust_contrast_adaptive_sharpening.wgsl");
105105

106-
app.register_type::<ContrastAdaptiveSharpening>();
107106
app.add_plugins((
108107
ExtractComponentPlugin::<ContrastAdaptiveSharpening>::default(),
109108
UniformComponentPlugin::<CasUniform>::default(),

crates/bevy_anti_aliasing/src/fxaa/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ impl Plugin for FxaaPlugin {
8686
fn build(&self, app: &mut App) {
8787
embedded_asset!(app, "fxaa.wgsl");
8888

89-
app.register_type::<Fxaa>();
9089
app.add_plugins(ExtractComponentPlugin::<Fxaa>::default());
9190

9291
let Some(render_app) = app.get_sub_app_mut(RenderApp) else {

crates/bevy_anti_aliasing/src/smaa/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@ impl Plugin for SmaaPlugin {
313313
}
314314
};
315315

316-
app.add_plugins(ExtractComponentPlugin::<Smaa>::default())
317-
.register_type::<Smaa>();
316+
app.add_plugins(ExtractComponentPlugin::<Smaa>::default());
318317

319318
let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
320319
return;

crates/bevy_anti_aliasing/src/taa/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ impl Plugin for TemporalAntiAliasPlugin {
5151
fn build(&self, app: &mut App) {
5252
embedded_asset!(app, "taa.wgsl");
5353

54-
app.register_type::<TemporalAntiAliasing>();
55-
5654
app.add_plugins(SyncComponentPlugin::<TemporalAntiAliasing>::default());
5755

5856
let Some(render_app) = app.get_sub_app_mut(RenderApp) else {

crates/bevy_app/src/app.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,11 @@ impl Default for App {
106106

107107
#[cfg(feature = "bevy_reflect")]
108108
{
109-
use bevy_ecs::observer::ObservedBy;
110-
111109
#[cfg(not(feature = "reflect_auto_register"))]
112110
app.init_resource::<AppTypeRegistry>();
113111

114112
#[cfg(feature = "reflect_auto_register")]
115113
app.insert_resource(AppTypeRegistry::new_with_derived_types());
116-
117-
app.register_type::<Name>();
118-
app.register_type::<ChildOf>();
119-
app.register_type::<Children>();
120-
app.register_type::<ObservedBy>();
121114
}
122115

123116
#[cfg(feature = "reflect_functions")]

crates/bevy_asset/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,7 @@ impl Plugin for AssetPlugin {
422422
// and as a result has ambiguous system ordering with all other systems in `PreUpdate`.
423423
// This is virtually never a real problem: asset loading is async and so anything that interacts directly with it
424424
// needs to be robust to stochastic delays anyways.
425-
.add_systems(PreUpdate, handle_internal_asset_events.ambiguous_with_all())
426-
.register_type::<AssetPath>();
425+
.add_systems(PreUpdate, handle_internal_asset_events.ambiguous_with_all());
427426
}
428427
}
429428

crates/bevy_audio/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,7 @@ pub struct AudioPlugin {
8080

8181
impl Plugin for AudioPlugin {
8282
fn build(&self, app: &mut App) {
83-
app.register_type::<Volume>()
84-
.register_type::<GlobalVolume>()
85-
.register_type::<SpatialListener>()
86-
.register_type::<DefaultSpatialScale>()
87-
.register_type::<PlaybackMode>()
88-
.register_type::<PlaybackSettings>()
89-
.insert_resource(self.global_volume)
83+
app.insert_resource(self.global_volume)
9084
.insert_resource(DefaultSpatialScale(self.default_spatial_scale))
9185
.configure_sets(
9286
PostUpdate,

crates/bevy_camera/src/lib.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,10 @@ pub struct CameraPlugin;
1818

1919
impl Plugin for CameraPlugin {
2020
fn build(&self, app: &mut App) {
21-
app.register_type::<Camera>()
22-
.register_type::<ClearColor>()
23-
.register_type::<CameraMainTextureUsages>()
24-
.register_type::<Exposure>()
25-
.register_type::<MainPassResolutionOverride>()
26-
.register_type::<primitives::Aabb>()
27-
.register_type::<primitives::CascadesFrusta>()
28-
.register_type::<primitives::CubemapFrusta>()
29-
.register_type::<primitives::Frustum>()
30-
.init_resource::<ClearColor>()
31-
.add_plugins((
32-
CameraProjectionPlugin,
33-
visibility::VisibilityPlugin,
34-
visibility::VisibilityRangePlugin,
35-
));
21+
app.init_resource::<ClearColor>().add_plugins((
22+
CameraProjectionPlugin,
23+
visibility::VisibilityPlugin,
24+
visibility::VisibilityRangePlugin,
25+
));
3626
}
3727
}

crates/bevy_camera/src/projection.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@ pub struct CameraProjectionPlugin;
1818

1919
impl Plugin for CameraProjectionPlugin {
2020
fn build(&self, app: &mut App) {
21-
app.register_type::<Projection>()
22-
.register_type::<PerspectiveProjection>()
23-
.register_type::<OrthographicProjection>()
24-
.register_type::<CustomProjection>()
25-
.add_systems(
26-
PostUpdate,
27-
crate::visibility::update_frusta
28-
.in_set(VisibilitySystems::UpdateFrusta)
29-
.after(TransformSystems::Propagate),
30-
);
21+
app.add_systems(
22+
PostUpdate,
23+
crate::visibility::update_frusta
24+
.in_set(VisibilitySystems::UpdateFrusta)
25+
.after(TransformSystems::Propagate),
26+
);
3127
}
3228
}
3329

0 commit comments

Comments
 (0)