Skip to content

Specify AppLabel for SyncComponent / ExtractComponent / ExtractResource#24420

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

Specify AppLabel for SyncComponent / ExtractComponent / ExtractResource#24420
Zeophlite wants to merge 10 commits into
bevyengine:mainfrom
Zeophlite:extract-extractb

Conversation

@Zeophlite
Copy link
Copy Markdown
Contributor

@Zeophlite Zeophlite commented May 24, 2026

Objective

  • Step towards making the extract infra is reusable for non-rendering crates (see bevy_extract tracking #24483 )
  • There is two ways to set a component as extractable from the main world to the render world, #[derive(ExtractComponent)] (preferentially) , or impl ExtractComponent for Foo {} (similarly for ExtractResource and SyncComponent ) . To make extraction possible to different sub-apps, we need to mark all these as explicitly for RenderApp

Solution

  • Allow ExtractComponent , ExtractResource and SyncComponent to specify the AppLabel the trait is implemented for. The corresponding plugin is only implemented for RenderApp .
  • For each explicit impl, specify RenderApp , e.g. impl ExtractComponent<RenderApp> for Foo {}
  • For each derive ExtractComponent and ExtractResource , specify the AppLabel with the attribute #[extract_app(RenderApp)]

Reviewer Notes

Wow 64 files changed! But it's really just 7 files, the rest is mechanical

I suggest first reading the ExtractResource changes as a starting point

Testing

  • CI
  • cargo run --example animated_mesh

@Zeophlite Zeophlite changed the title Specify AppLabel for SyncComponent / ExtractComponent / ExtractResource Specify AppLabel for SyncComponent / ExtractComponent / ExtractResource May 24, 2026
@Zeophlite Zeophlite added A-Rendering Drawing game state to the screen D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels May 24, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering May 24, 2026
@Zeophlite Zeophlite added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels May 24, 2026
@Zeophlite Zeophlite marked this pull request as ready for review May 24, 2026 14:20
@Zeophlite Zeophlite requested a review from atlv24 May 24, 2026 14:20
@Zeophlite Zeophlite added this to the 0.20 milestone May 24, 2026
Copy link
Copy Markdown
Contributor

@kfc35 kfc35 left a comment

Choose a reason for hiding this comment

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

looks good to me

Comment thread _release-content/migration-guides/extract-extract-b.md Outdated
@Zeophlite Zeophlite force-pushed the extract-extractb branch 3 times, most recently from 8314bbd to d60f1c8 Compare May 25, 2026 05:17
@Zeophlite Zeophlite requested a review from kfc35 May 25, 2026 05:54
Copy link
Copy Markdown
Contributor

@kfc35 kfc35 left a comment

Choose a reason for hiding this comment

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

Approving but trusting you’ll clean up some of the docs that might be outdated for the affected structs

Comment thread crates/bevy_render/src/sync_component.rs
Comment thread _release-content/migration-guides/extract-extract-b.md Outdated
@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 D-Straightforward Simple bug fixes and API improvements, docs, test and examples M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

3 participants