forked from slint-ui/slint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compatibility feature to our public crates
We want to be able to put existing functionality behind a feature flag while keeping the semver compatibility. This is only possible if that new feature flag is enabled by default, but this is not working if the users have done `default-features = false` in their Cargo.toml. So we add new `compat-x-y-z` feature that is mandatory to have and which is enforced with a `compile_error!` Now, users that whishes to not have the default features must enable it explicitly. Say we want only x11 but not qt and wayland, the user will do ```toml sixtyfps = { version = "0.2", default-features = false, features = ["x11", "compat-0-2-0"] } ``` Now, imagine that in the version 0.2.3, we put the SVG support behind a feature flag. we will do this in out Cargo.toml: ```toml [features] default = ["compat-0-2-0", "x11", "wayland"] compat-0-2-0 = ["compat-0-2-3", "svg"] compat-0-2-3 = [] svg = [...] ... ``` That way, the svg feature will be enabled by default for all the users who used previous version of SixtyFPS, and people that want to disable "svg" can just change from compat-0-2-0 to compat-0-2-3 in their Cargo.toml
- Loading branch information
Showing
10 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters