Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,44 @@ export interface FeatureFlag {
readonly explanation?: string;

/**
* The value of the flag if it is unconfigured
* The value of the flag that produces the same behavior as when the flag is not configured at all
*
* @default - No value
*The structure of this field is a historical accident. The type of this field
*should have been boolean, which should have contained the default value for
*the flag appropriate for the *current* version of the CDK library. We are
*not rectifying this accident because doing so
*
* Instead, the canonical way to access this value is by evaluating
* `unconfiguredBehavesLike?.v2 ?? false`.
*
* @default false
*/
readonly unconfiguredBehavesLike?: UnconfiguredBehavesLike;
}

export interface UnconfiguredBehavesLike {
/**
* Historical accident, don't use.
*
* This value may be present, but it should never be used. The actual value is
* in the `v2` field, regardless of the version of the CDK library.
*
* @default - ignore
*/
readonly v1?: any;

/**
* The value of the flag that produces the same behavior as when the flag is not configured at all
*
* Even though it is called 'v2', this is the official name of this field. In
* any future versions of CDK (v3, v4, ...), this field will still be called 'v2'.
*
* The structure of this field is a historical accident. See the comment on
* `unconfiguredBehavesLike` for more information.
*
* @default false
*/
readonly unconfiguredBehavesLike?: { [key: string]: any };
readonly v2?: any;
}

/**
Expand Down
Loading