Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

Reduce friction caused by requiring an explicit 2d/3d feature flag #249

Description

@jcornaz

To use heron, one must enable either the 2d or 3d feature flag: https://docs.rs/heron/3.0.0/heron/index.html#add-the-dependency-and-choose-to-work-with-either-2d-or-3d

This can be friction for new users, who can stumble into unclear error messages: https://discord.com/channels/691052431525675048/966502688751779931/966599689749270558

I think we can improve the situation.

  • Fail faster, with a more explicit compilation error

Maybe something like:

#[cfg(not(any(feature = "2d", feature = "3d")))]
compile_error!("the feature \"2d\" or \"3d\" must be enabled to use heron");
  • Enable 3d by default.

So that a setup would become:

  • For a 3d game: heron = "3.0.0"
  • For a 2d game: heron = { version = "3.0.0", default-features = false, features = ["2d"] }

The rationale behind choosing 3d as the default instead of 2d is that 3d is a "superset" of the 2d capabilities in the sense that one could make a 2d game using the 3d version of heron, but the not the opposite.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions