Closed joshuajbouw closed 3 years ago
Hi! I'm not sure how bevy_rapier
itself would do this. Basically the bevy_rapier
crate would have to optionally depend on both bevy_rapier2d
and bevy_rapier3d
, and it will end up having the exact same problem as you regarding transitively enabling features.
Also I'm not sure why you need to have these transitive features in the first place. The end-user can do this for example:
[dependencies]
your_crate = { version = "...", features = [ "dim2" ] }
bevy_rapier2d = { version = "...", features = ["parallel", "simd-nightly"] }
Which would achieve the same effect as the transitive features.
Oh hey, good to know. That I wasn't too sure about, great to hear that Rust handles that.
Only two flavours are available for
bevy_rapier
as 2D and 3D which is fine however, if a library is depending on the crate and also has an optional 2D or 3D varient, it becomes awkward to forward the features.Which ends up looking like the below:
A solution would be simply just to publish
bevy_rapier
which allows people to conditionally feature gate it as they wish given context. Its just so much cleaner.Then simply would end up looking like: