-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Anti-feature request: remove WithBundle
#2620
Comments
I feel like expecting bundles to include a marker component to be used in As for adding the marker components, I feel like modifying the derive for Bundle would be the easiest and most friendly way to do this. The auto generated name could be something like Just removing the |
Also, I'd be willing to work on this, I'm not super confident with macros but now's as good a time as any to start :P |
I don't think adding marker components with all bundles would be helpful here. Adding a marker yourself is trivial and in my opinion the cleaner approach to this problem. |
Did you mean adding it automatically to all bundles through the derive, adding our own markers and exporting them alongside bundles manually, or did you mean expecting some form of marker (derived or otherwise) on bundles in general (people always have to make their own for any bundle)? |
I feel like having some sort of standard for providing a marker trait with a bundle, whether it's created through macros or written by hand, is a good idea. (I'm not particularly opposed to doing it either way) |
We'd discussed something similar before: where you effectively need "names" for entity types for editor display. I'm not entirely convinced on which exact strategy we should use; especially at this stage. In general, this style of thing doesn't seem very useful until you have an editor and a prefab workflow, and there are so many unknowns there that I worry we'd be prematurely optimizing.
This feels like it may be the opposite of what's desired: these bundles may be used in very different ways by the two plugins.
I would prefer the second manual option for now, until we have a clearer idea of downstream use cases. |
I do agree, as far as I could tell we don't have a ton of formality around bundles so it does make sense that we want to leave our options open.
In that light, then it does definitely make sense to do it all manually. Would I want to add and export a marker for the bundles that we currently have in bevy repo? |
I think that's probably out of scope; for example there's a need to use marker components with cameras that is along the same lines but really deserves its own PR. For now, I think just make a dead-simple PR cutting the feature @Hoidigan. As Cart was joking about on Discord, we can use this as a "scream test", and see who really needed this functionality, then design a better fitting feature set to meet their needs if and when they emerge <3 |
This should be marked as E-Good-First-Issue just for future reference? |
Yep, I'm happy with that call now. I held off since there was still a little bit of discussion needed, and leading that conversation is often hard for new contributors :) |
What problem does this solve or what need does it fill?
WithBundle
promotes unidiomatic OOP-style code in Bevy that is hard to extend and maintain. It also doesn't behave the way many users would hope it does: it will detect any entities with the set of components within the bundle, rather than only entities spawned with the bundle.It is also particularly odd to have the ability to filter on bundles but not request them (#2252), causing user confusion.
What solution would you like?
Remove
WithBundle
. Existing users can use combinedWith
filters (ideally with marker components), or even write their own query filter types if they desperately need this.What alternative(s) have you considered?
Complain about its usage in code reviews and discourage (or ignore it) in the docs.
Additional context
We should attempt to remove this sooner rather than later to reduce the pain. If and when bundles are properly stored on the entity (perhaps for editor purposes?), we can consider adding this and #2252.
The text was updated successfully, but these errors were encountered: