Skip to content

Conversation

@atlv24
Copy link
Contributor

@atlv24 atlv24 commented Jan 18, 2026

Objective

  • mgi388 pointed out on discord that gizmos depending on lights makes no sense
  • i agree, this is purely an artifact of how tangled our deps used to be. but now its mostly untangled and this can be trivially fixed

Solution

  • invert the dep

Testing

3d_gizmos runs and looks fine

@atlv24 atlv24 added A-Rendering Drawing game state to the screen A-Gizmos Visual editor and debug gizmos D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 18, 2026
@alice-i-cecile alice-i-cecile added this to the 0.19 milestone Jan 18, 2026
@alice-i-cecile alice-i-cecile added C-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Jan 18, 2026
@github-actions
Copy link
Contributor

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Please review the instructions for writing migration guides, then expand or revise the content in the migration guides directory to reflect your changes.

@alice-i-cecile
Copy link
Member

Very good, but needs a migration guide for the moved code.

@mgi388 mgi388 self-requested a review January 18, 2026 22:00
Copy link
Contributor

@mgi388 mgi388 left a comment

Choose a reason for hiding this comment

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

Also tested the 3d_gizmos example. My comment is just food for thought, I don't think there's anything blocking there unless you think otherwise @atlv24.

);

#[cfg(feature = "bevy_gizmos")]
app.add_plugins(gizmos::LightGizmoPlugin);
Copy link
Contributor

@mgi388 mgi388 Jan 18, 2026

Choose a reason for hiding this comment

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

Just want to note that previously the order of plugins being added was:

  • DefaultPlugins
    • adds LightPlugin
    • adds GizmoPlugin
      • adds LightGizmoPlugin

Now it is:

  • DefaultPlugins
    • adds LightPlugin
      • adds LightGizmoPlugin
    • adds GizmoPlugin

From looking at the plugins I cannot see any dependency that would cause an issue so I think this is fine, just wanted to note.

I suppose technically if GizmoPlugin is more of a "provides gizmo functionality and primitives", I'd probably expect that it be registered before LightPlugin (and before an imaginary AudioPlugin that also provides gizmos via AudioGizmoPlugin), but again, not sure that there's any issue right now so probably fine to leave as is.

Alternatively, inside LightGizmoPlugin you could add the GizmoPlugin if it's not already added. This comment speaks to a user who is using bevy_light directly but not bevy (and therefore not bevy_internal)—will their light gizmos work if they don't add GizmoPlugin themselves?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a case we don't cater for in general; there are many many crates that depend on other crates but dont add the plugins. This is because plugin ordering gets very gnarly if you do this - its not actually the case that if plugin A depends on another plugin B that means B must be added before A, look at the web assets plugin for example, among others.

If a user is not using DefaultPlugins, they're doing something highly custom and are a fringe user, and "doing stuff for them" is not something they care about, especially if it can get in their way imo. They can add the plugin manually and order them however they like manually, and test to make sure it works for them in whatever they're doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other half of it is its just hard to do that, you'd need to be checking if a plugin is already added before adding it in every place and also have gates for this in the DefaultPlugins, and you'll need to have the crates somehow know that both are being used without having a parent crate (bevy_internal) to propagate features between them so they know.

Copy link
Contributor

Choose a reason for hiding this comment

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

That all makes sense. Thanks for the consideration and thoughts. Mostly just wanted to call out the plug-in order was different just in case, but seems a non issue.

@alice-i-cecile alice-i-cecile 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 Jan 19, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 20, 2026
Merged via the queue into bevyengine:main with commit 2406303 Jan 20, 2026
44 checks passed
@atlv24 atlv24 deleted the ad/gizmos-lights branch January 26, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Gizmos Visual editor and debug gizmos A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use 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.

4 participants