bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Remove the "bevy_ui_debug" feature gate

Open ickshonpe opened this issue 3 months ago • 5 comments

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.

ickshonpe avatar Sep 16 '25 16:09 ickshonpe

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.

github-actions[bot] avatar Sep 16 '25 16:09 github-actions[bot]

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.

ickshonpe avatar Sep 16 '25 16:09 ickshonpe

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.

The other alternative, to ensure that this doesn't get broken so often, is that we add a module testing debug outlines to the testbed_ui example and enable the "bevy_ui_debug" feature for the screenshot CI.

ickshonpe avatar Sep 16 '25 16:09 ickshonpe

Actually, I guess it should be done either way.

ickshonpe avatar Sep 16 '25 16:09 ickshonpe

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.

I mostly agree, but what I'd say about this change is that, unlike a lot of the other debug features, the UI debug overlay is extremely light weight. It's just a tiny module with one system and a resource. We could add a flag to the UI render plugin to make adding the system to the schedule conditional.

ickshonpe avatar Dec 03 '25 09:12 ickshonpe