Skip to content

Extract extract to bevy_extract#22852

Open
Zeophlite wants to merge 22 commits into
bevyengine:mainfrom
Zeophlite:extract-extract
Open

Extract extract to bevy_extract#22852
Zeophlite wants to merge 22 commits into
bevyengine:mainfrom
Zeophlite:extract-extract

Conversation

@Zeophlite
Copy link
Copy Markdown
Contributor

@Zeophlite Zeophlite commented Feb 7, 2026

Objective

Solution

Reviewer notes: changes for this PR are listed below. Other commits are pre-requisties in the preceeding PRs. Please review commit-by-commit:

Testing

  • CI
  • cargo run --example animated_mesh

@Zeophlite Zeophlite requested a review from atlv24 February 7, 2026 12:46
@IQuick143 IQuick143 added the A-Rendering Drawing game state to the screen label Feb 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 7, 2026

You added a new feature but didn't update the readme. Please run cargo run -p build-templated-pages -- update features to update it, and commit the file change.

Comment thread crates/bevy_extract/src/lib.rs Outdated
Copy link
Copy Markdown
Contributor

@atlv24 atlv24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is skipping a few steps but its roughly the goal. We need a few preparatory steps, each of these should be its own PR:

  • The resource marker change to allow orphan rule circumvention on resource impls
  • Making ExtractPlugin take the app label (RenderApp) as generic parameter instead of hardcode
  • Making ExtractPlugin take a schedule to run and having its own internal extract schedule which handles the pre and post actions, running the user provided systemset/schedule in the middle
  • improving the macro situation to hide existing complexity of implementations
  • collapse manual implementations of extract into derive macro call or whatever
  • Introducing an AppLabel marker to Extract impls to specify that they are RenderApp extract impls and tuck it away neatly into the macro
  • Rename test terminology in extract_plugin.rs to not reference rendering
  • finally, this PR

Comment thread crates/bevy_extract/README.md
Comment thread crates/bevy_extract/README.md Outdated
Comment thread crates/bevy_extract/src/extract_component.rs Outdated
Comment thread crates/bevy_extract/src/lib.rs Outdated
Comment thread crates/bevy_extract/src/lib.rs Outdated
@alice-i-cecile alice-i-cecile added C-Code-Quality A section of code that is hard to understand or change X-Contentious There are nontrivial implications that should be thought through S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Feb 8, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Feb 9, 2026
# Objective

- Followup to #22766
- Step towards #22852

## Solution

- Add marker to `ExtractResouce`
- Pass marker to `SyncComponent`

## Testing

- `cargo run --example animated_mesh`
@cart cart added this to Rendering Feb 12, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Feb 12, 2026
@Zeophlite
Copy link
Copy Markdown
Contributor Author

Zeophlite commented Feb 21, 2026

New version, extending https://github.com/atlv24/bevy/tree/ad/extract-label ( #22855 )

cargo run --example animated_mesh works now, but at reduced DX (Need to pass RenderApp around a bunch still)

}

impl ExtractComponent for ContrastAdaptiveSharpening {
impl ExtractBaseComponent<RenderApp> for ContrastAdaptiveSharpening {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping to use the below, but it's an unstable feature

pub trait ExtractComponent<F : 'static + Send + Sync = ()> = ExtractBaseComponent<RenderApp, F>;

Hopefully there is an alternative?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a blanket impl may be able to do something like this, im not sure exactly what you're trying to do though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah so intention was to prevent the <RenderApp> spam e.g. impl ExtractResource<RenderApp> for Foo {

I think its not too bad as most will just #[derive(ExtractResource)]

Comment thread crates/bevy_extract/src/extract_base_component.rs Outdated
@Zeophlite Zeophlite added S-Needs-Help The author needs help finishing this PR. and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Feb 21, 2026
@Zeophlite Zeophlite requested a review from atlv24 February 21, 2026 17:56
@Zeophlite Zeophlite marked this pull request as ready for review February 22, 2026 16:32
Comment thread crates/bevy_render/src/lib.rs Outdated
Comment thread crates/bevy_render/src/lib.rs Outdated
Comment thread crates/bevy_extract/src/extract_instances.rs Outdated
Comment thread crates/bevy_extract/src/extract_param.rs Outdated
@Zeophlite Zeophlite added S-Blocked This cannot move forward until something else changes and removed S-Needs-Help The author needs help finishing this PR. labels May 29, 2026
@Zeophlite Zeophlite marked this pull request as draft May 29, 2026 09:27
@Zeophlite Zeophlite mentioned this pull request May 29, 2026
@Zeophlite Zeophlite marked this pull request as ready for review May 29, 2026 10:12
@Zeophlite Zeophlite added this to the 0.20 milestone May 29, 2026
@Zeophlite Zeophlite added the M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Blocked This cannot move forward until something else changes X-Contentious There are nontrivial implications that should be thought through

Projects

Status: Needs SME Triage
Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants