Skip to content

Commit a5502f9

Browse files
kallentuCommit Queue
authored andcommitted
[tools] Update documentation about experimentalReleaseVersion in experiment flags.
Tweaking the documentation a tad to enforce the new process of: 1. Add an `experimentalReleaseVersion` when you make the flag and set it to the current latest version at the time of creation. 2. Bump the `experimentalReleaseVersion` when you make a relevant change in the allowlist that would allow those libs/packages to use the feature by default. The chat thread context: https://chat.google.com/room/AAAA4GpVqbE/r2QigevCdQo/tP7lLb8I728?cls=10 Change-Id: I8ddad40e0ac82b6deaae9a6671bec4d47ea07fba Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443636 Commit-Queue: Kallen Tu <[email protected]> Reviewed-by: Nate Bosch <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 433231c commit a5502f9

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ class ExperimentalFlag {
3030
final bool isExpired;
3131
final Version enabledVersion;
3232

33-
/// The minimum version that supports this feature.
33+
/// The minimum version that enables the feature by default.
3434
///
3535
/// If the feature is not enabled by default, this is the current language
3636
/// version.
3737
final Version experimentEnabledVersion;
3838

39-
/// The minimum version that supports this feature in allowed libraries.
39+
/// The minimum version that allows this feature to be enabled with a flag and
40+
/// enables the experiment in allowed libraries.
4041
///
4142
/// Allowed libraries are specified in
4243
///

pkg/front_end/tool/generate_experimental_flags.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,16 +278,17 @@ class ExperimentalFlag {
278278
final bool isExpired;
279279
final Version enabledVersion;
280280
281-
/// The minimum version that supports this feature.
281+
/// The minimum version that enables the feature by default.
282282
///
283283
/// If the feature is not enabled by default, this is the current language
284284
/// version.
285285
final Version experimentEnabledVersion;
286286
287-
/// The minimum version that supports this feature in allowed libraries.
287+
/// The minimum version that allows this feature to be enabled with a flag and
288+
/// enables the experiment in allowed libraries.
288289
///
289290
/// Allowed libraries are specified in
290-
///
291+
///
291292
/// sdk/lib/_internal/allowed_experiments.json
292293
final Version experimentReleasedVersion;
293294

tools/experimental_features.yaml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,25 @@
5151
# to disable this feature. For more on library language version override, see
5252
# https://dart.dev/to/language-version-override
5353
#
54-
# 3. expired: (optional boolean)
54+
# 3. experimentalReleaseVersion: (optional #.#)
55+
# The Dart SDK version (<major>.<minor>) in which the experiment can be used
56+
# by enabling the experiment flag.
57+
#
58+
# If this field is specified, then the experiment may be enabled in this
59+
# version or later versions, by specifying the flag on the command line.
60+
# (e.g. --enable-experiment=non-nullable).
61+
#
62+
# If `sdk/lib/_internal/allowed_experiments.json` is updated, this field
63+
# specifies the version that enables this experiment for those libraries
64+
# and packages.
65+
#
66+
# 4. expired: (optional boolean)
5567
# If true, then the experiment can no longer be enabled by specifying the
5668
# flag on the command line, and the corresponding entry is slated for
5769
# eventual removal from this file. If this field is omitted, then 'expired'
5870
# is considered to be false.
5971
#
60-
# 4. validation: (optional string)
72+
# 5. validation: (optional string)
6173
# If provided this should be a program that prints "feature enabled" on
6274
# stdout if the feature is enabled, and throws or fails to compile otherwise.
6375
# The intended use for this is to be able to run generic tests for each
@@ -74,11 +86,11 @@
7486
# the feature as it is being developed.
7587
#
7688
# Experimental release:
77-
# When an experiment is released, then the 'experimentalReleaseVersion' field
78-
# is added indicating which version of the SDK contains this new language
79-
# feature for libraries and packages in mentioned in
80-
# `sdk/lib/_internal/allowed_experiments.json`. For other libraries and
81-
# packages, passing the experiment flag is still required to turn on the
89+
# When we want to allow certain libraries and packages to enable the language
90+
# feature by default, we add an entry to the
91+
# `sdk/lib/_internal/allowed_experiments.json` allow list and then we bump the
92+
# `experimentalReleaseVersion` field to the latest version. For other libraries
93+
# and packages, passing the experiment flag is still required to turn on the
8294
# experiment.
8395
#
8496
# Shipped:

0 commit comments

Comments
 (0)