Today, Flutter has a globally-scoped1 list of enabled feature flags, utilized by flutter config:
flutter config --enable-swift-package-manager
Swift Package Manager work has needed package-by-package opt-in/out support, implementing a 1-off:
|
disable-swift-package-manager: true |
It's come up with discussions with various teams (I certainly felt this with explicit-package-dependencies) that there is a good user (end-user) and developer (contributor to Flutter) need to be able to enable or disable these feature flags on a per-project basis:
flutter:
# Could also be called "flags", just using existing terminology for now.
config:
swift-package-manager: true
explicit-package-dependencies: false
I'd like to propose the following:
- We generalize the work done for
disable-swift-package-manager (see above) or
- We implement something with similar capabilities
My thoughts on the V1 specification:
A feature flag can be used to conditionally allow or disallow some set of functionality in the Flutter tool, which in turn could be used to inform how _other_ tools (such as Gradle, Xcode) or runtimes (such as the Flutter framework, engine, Impeller) behave or what capabilities they support.
Feature flags are derived from one of two locations:
1. The currently executing app (where a `flutter` command is being run)'s `pubspec.yaml` _or_
2. Globally, as specified by `flutter config --enable-x` (or `flutter config --disable-x`)
Feature flags that are defined in an app's `pubspec.yaml` take precedence.
Feature flags only support simple boolean (`true` or `false`) values, which default based on the
current channel being used (`master`, `beta`, or stable`), which matches the current implementation
done in [`flutter_tools/lib/src/features.dart`][1].
[1]: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/features.dart#L51-L55
/cc @Piinks @justinmc @jtmcdole
Today, Flutter has a globally-scoped1 list of enabled feature flags, utilized by
flutter config:Swift Package Manager work has needed package-by-package opt-in/out support, implementing a 1-off:
flutter/packages/flutter_tools/test/general.shard/flutter_manifest_test.dart
Line 1412 in b73450f
It's come up with discussions with various teams (I certainly felt this with
explicit-package-dependencies) that there is a good user (end-user) and developer (contributor to Flutter) need to be able to enable or disable these feature flags on a per-project basis:I'd like to propose the following:
disable-swift-package-manager(see above) orMy thoughts on the V1 specification:
/cc @Piinks @justinmc @jtmcdole
Footnotes
Well, to the
%HOMEdirectory. ↩