Skip to content

Initialize Window by observer instead of by plugin fields #20018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

janhohenheim
Copy link
Member

@janhohenheim janhohenheim commented Jul 7, 2025

Objective

  • Part of Split the Window component for more granular change detection #19644
  • Window is biiiiig, so we want to split it
  • However, to split it, we need a blessed pattern for how to initialize all these new components
  • The old way was to have a field on WindowPlugin
  • But if we split Window into 10 components, we'd have 10 new optional initializer fields on WindowPlugin
  • That's just a worse version of required components

Solution

  • Use required components to build up the Window instead
  • Tell users through the examples to use an observer instead of the plugin field
  • While I was on it anyways, I removed the window titles of many examples, as even pre-PR they were mostly boilerplate that didn't add much didactic value

Testing

  • TODO: need to still test this some more

@janhohenheim janhohenheim added A-Windowing Platform-agnostic interface layer to run your app in M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged C-Examples An addition or correction to our examples labels Jul 7, 2025
@janhohenheim janhohenheim changed the title Initialized Window by observer instead of by plugin fields Initialize Window by observer instead of by plugin fields Jul 7, 2025
@janhohenheim
Copy link
Member Author

Blocked by #20019

@janhohenheim janhohenheim added the S-Blocked This cannot move forward until something else changes label Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Examples An addition or correction to our examples D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes M-Needs-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 S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant