Skip to content

Be explicit that extraction is to RenderApp for SyncComponent / ExtractComponent / ExtractResource#24420

Merged
alice-i-cecile merged 11 commits into
bevyengine:mainfrom
Zeophlite:extract-extractb
Jul 7, 2026
Merged

Be explicit that extraction is to RenderApp for SyncComponent / ExtractComponent / ExtractResource#24420
alice-i-cecile merged 11 commits into
bevyengine:mainfrom
Zeophlite:extract-extractb

Conversation

@Zeophlite

@Zeophlite Zeophlite commented May 24, 2026

Copy link
Copy Markdown
Contributor

Objective

  • Bevy's extraction process is implicitly for copying data from the main sub-app to the RenderApp sub-app
  • There is two user facing ways to set a component as extractable from the main world to the render world, #[derive(ExtractComponent)] (this is preferential) , 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
  • Step towards making the extract infra is reusable for non-rendering crates (see bevy_extract tracking #24483 )

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)]
  • This PR has no functionality change, that comes in the followup PRs (see above issue, next PR is Make ExtractComponentPlugin etc. generic on AppLabel #24423 )

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
  • Follow up PRs (see tracking issue) extend this all the way to multiple extraction

@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

@kfc35 kfc35 left a comment

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.

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

@kfc35 kfc35 left a comment

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.

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
@Zeophlite

Copy link
Copy Markdown
Contributor Author

https://pixel-eagle.com/project/b25a040a-a980-4602-b90c-d480ab84076d/run/18220/compare/18213
So Pixel eagle is being weird, there's some changes due to entity number changes, and that's fine, but then there's weird things like pcss and tonemapping rendering incorrectly in pixel eagle (renders correctly on my mac).

@Zeophlite Zeophlite changed the title Specify AppLabel for SyncComponent / ExtractComponent / ExtractResource Specify RenderApp for SyncComponent / ExtractComponent / ExtractResource Jun 14, 2026
@Zeophlite Zeophlite changed the title Specify RenderApp for SyncComponent / ExtractComponent / ExtractResource Be explicit that extraction is to RenderApp for SyncComponent / ExtractComponent / ExtractResource Jun 14, 2026
Comment thread _release-content/migration-guides/extract-extract-b.md

@IceSentry IceSentry left a comment

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.

LGTM

@IceSentry IceSentry added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 24, 2026
@kristoff3r

Copy link
Copy Markdown
Contributor

I got distracted by other stuff, I'll take a look at this soon

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jul 7, 2026
Merged via the queue into bevyengine:main with commit f6c6e6e Jul 7, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering Jul 7, 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-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants