The atlas feature is a compatibility hazard. The easiest way to see this is to enable the feature on bevy_ecs_tilemap and also use bevy_ecs_tiled, without setting its corresponding atlas flag. This causes a compilation error, which is understandably not how features are supposed to work.
A hypothetical other example would be a different 3rd-party library built for bevy_ecs_tilemap that attempts to be compatible with all options in the most Rust-y way possible: not enabling any features. It is designed around not using atlas, so it uses the alternative array texture types instead. Then, a game that uses this new library decides to enable atlas on the bevy_ecs_tilemap crate, as it has a special case not covered by the other library for which it wants direct tilemap access. Lo and behold, a cryptic compile error, as the library assumed the features it used wouldn't be taken away!
Link to the relevant Cargo guidelines: https://doc.rust-lang.org/cargo/reference/features.html#semver-compatibility
Proposed fix: do not disable enum variants, structures, or re-exports when atlas is enabled. Features should be additive. An alternative that would warn the user about performance concerns but not break libraries could be something like this:
#[cfg_attr(feature = "atlas", deprecated = "These enum variants should not be used with the `atlas` feature, as they create a compatibility and performance hazard with certain render backends.")]
The
atlasfeature is a compatibility hazard. The easiest way to see this is to enable the feature onbevy_ecs_tilemapand also usebevy_ecs_tiled, without setting its correspondingatlasflag. This causes a compilation error, which is understandably not how features are supposed to work.A hypothetical other example would be a different 3rd-party library built for
bevy_ecs_tilemapthat attempts to be compatible with all options in the most Rust-y way possible: not enabling any features. It is designed around not usingatlas, so it uses the alternative array texture types instead. Then, a game that uses this new library decides to enableatlason thebevy_ecs_tilemapcrate, as it has a special case not covered by the other library for which it wants direct tilemap access. Lo and behold, a cryptic compile error, as the library assumed the features it used wouldn't be taken away!Link to the relevant Cargo guidelines: https://doc.rust-lang.org/cargo/reference/features.html#semver-compatibility
Proposed fix: do not disable enum variants, structures, or re-exports when
atlasis enabled. Features should be additive. An alternative that would warn the user about performance concerns but not break libraries could be something like this:#[cfg_attr(feature = "atlas", deprecated = "These enum variants should not be used with the `atlas` feature, as they create a compatibility and performance hazard with certain render backends.")]