-
Notifications
You must be signed in to change notification settings - Fork 29k
Closed
Copy link
Labels
c: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterteam-toolOwned by Flutter Tool teamOwned by Flutter Tool team
Description
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
Footnotes
-
Well, to the
%HOME
directory. ↩
loic-sharma, jonasbark, orestesgaolin, KristijanZic, koodimetsa and 7 more
Metadata
Metadata
Assignees
Labels
c: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterteam-toolOwned by Flutter Tool teamOwned by Flutter Tool team