-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Remove the "bevy_ui_debug" feature gate #21091
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
base: main
Are you sure you want to change the base?
Remove the "bevy_ui_debug" feature gate #21091
Conversation
There isn't doesn't seem to be much point to this feature gate, the implementation is just a resource and a single extraction function that early returns if the debug overlay is disabled.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I agree with this, but we should leave a quick migration guide for the removed feature. Just explain that it's always enabled.
I left the resource optional, not sure if it should be added automatically or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM now, but I'm currently on the fence over whether or not this is the design that we should be using for these debug features in general.
On the one hand, features suck, and they're annoying to test and make it harder for users to discover these dev tools.
On the other hand, this really is a dev tool, and we should have a way to ensure that users aren't paying for them in their production apps.
@mockersf, I'm sure you have opinions.
The other alternative, to ensure that this doesn't get broken so often, is that we add a module testing debug outlines to the |
Actually, I guess it should be done either way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we remove this feature gate doesn’t this mean I can’t compile out this dev/debug feature in my release builds?
Edit: For my own part I'd prefer more debug gates than less gates, so I'd want to keep the gate in rather than removing it per this PR. I understand gates come with complexity but I think Bevy being lean and modular is the better direction.
Objective
The "bevy_ui_debug" feature gate doesn't achieve much, the UI debug overlay implementation consists of just a resource and an extraction system that early returns if the overlay is disabled. But it does make the debug overlay harder to discover and use, and it's often broken by changes to the UI rendering systems that forget to update it.
Solution
Remove the "bevy_ui_debug" feature gate.