bevy/examples/app
Ben Frankel 7cb97852a5
Remove second generic from .add_before, .add_after (#14285)
# Objective

```rust
// Currently:
builder.add_after::<FooPlugin, _>(BarPlugin);
// After this PR:
builder.add_after::<FooPlugin>(BarPlugin);
```

This removes some weirdness and better parallels the rest of the
`PluginGroupBuilder` API.

## Solution

Define a helper method `type_id_of_val` to use in `.add_before` and
`.add_after` instead of `TypeId::of::<T>` (which requires the plugin
type to be nameable, preventing `impl Plugin` from being used).

## Testing

Ran `cargo run -p ci lints` successfully.

## Migration Guide

Removed second generic from `PluginGroupBuilder` methods: `add_before`
and `add_after`.

```rust
// Before:
DefaultPlugins
    .build()
    .add_before::<WindowPlugin, _>(FooPlugin)
    .add_after::<WindowPlugin, _>(BarPlugin)

// After:
DefaultPlugins
    .build()
    .add_before::<WindowPlugin>(FooPlugin)
    .add_after::<WindowPlugin>(BarPlugin)
```

---------

Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
2024-07-15 15:58:14 +00:00
..
custom_loop.rs Fix custom_loop example to include plugin finalization (#13215) 2024-05-03 20:12:27 +00:00
drag_and_drop.rs Refactor EventReader::iter to read (#9631) 2023-08-30 14:20:03 +00:00
empty.rs Doc/module style doc blocks for examples (#4438) 2022-05-16 13:53:20 +00:00
empty_defaults.rs Doc/module style doc blocks for examples (#4438) 2022-05-16 13:53:20 +00:00
headless.rs Fix intra-doc link warnings (#10445) 2023-11-08 14:33:46 +00:00
headless_renderer.rs Fixed incorrect behaviour of headless_renderer depending on image dimensions (#13388) 2024-05-19 00:15:15 +00:00
log_layers.rs Improve tracing layer customization (#13159) 2024-05-12 21:16:56 +00:00
log_layers_ecs.rs Improve tracing layer customization (#13159) 2024-05-12 21:16:56 +00:00
logs.rs Updates default Text font size to 24px (#13603) 2024-05-31 16:41:27 +00:00
no_renderer.rs Add configuration for async pipeline creation on RenderPlugin (#11847) 2024-02-16 13:35:47 +00:00
plugin.rs Inverse missing_docs logic (#11676) 2024-02-03 21:40:55 +00:00
plugin_group.rs Remove second generic from .add_before, .add_after (#14285) 2024-07-15 15:58:14 +00:00
return_after_run.rs Remove redundant imports (#12817) 2024-04-01 19:59:08 +00:00
thread_pool_resources.rs Break CorePlugin into TaskPoolPlugin, TypeRegistrationPlugin, FrameCountPlugin. (#7083) 2023-01-05 11:42:35 +00:00
without_winit.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00