Skip to content

Commit

Permalink
Add feature flag to allow opt-out
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-tengler committed Sep 17, 2024
1 parent 75a82ee commit 97221cb
Show file tree
Hide file tree
Showing 4 changed files with 301 additions and 4 deletions.
6 changes: 6 additions & 0 deletions compiler/crates/common/src/feature_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,15 @@ pub struct FeatureFlags {
/// This flag will be removed in a future version of Relay.
#[serde(default)]
pub disable_full_argument_type_validation: FeatureFlag,

/// Enable a custom path for artifacts
#[serde(default)]
pub enable_custom_artifacts_path: FeatureFlag,

/// Disable the generation of a more precise raw response type
/// for selections on abstract types.
#[serde(default)]
pub disable_more_precise_abstract_selection_raw_response_type: FeatureFlag,
}

#[derive(Debug, Deserialize, Clone, Serialize, Default, JsonSchema)]
Expand Down
261 changes: 261 additions & 0 deletions compiler/crates/relay-compiler/relay-compiler-config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,92 @@
}
]
},
"disable_more_precise_abstract_selection_raw_response_type": {
"description": "Disable the generation of a more precise raw response type for selections on abstract types.",
"default": {
"kind": "disabled"
},
"oneOf": [
{
"description": "Fully disabled: developers may not use this feature",
"type": "object",
"required": [
"kind"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"disabled"
]
}
}
},
{
"description": "Fully enabled: developers may use this feature",
"type": "object",
"required": [
"kind"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"enabled"
]
}
}
},
{
"description": "Partially enabled: developers may only use this feature on the listed items (fragments, fields, types).",
"type": "object",
"required": [
"allowlist",
"kind"
],
"properties": {
"allowlist": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"kind": {
"type": "string",
"enum": [
"limited"
]
}
}
},
{
"description": "Partially enabled: used for gradual rollout of the feature",
"type": "object",
"required": [
"kind",
"rollout"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"rollout"
]
},
"rollout": {
"description": "A utility to enable gradual rollout of large codegen changes. Can be constructed as the Default which passes or a percentage between 0 and 100.",
"type": [
"integer",
"null"
],
"format": "uint8",
"minimum": 0.0
}
}
}
]
},
"disable_resolver_reader_ast": {
"description": "Mirror of `enable_resolver_normalization_ast` excludes resolver metadata from reader ast",
"default": false,
Expand Down Expand Up @@ -1808,6 +1894,9 @@
"disable_full_argument_type_validation": {
"kind": "disabled"
},
"disable_more_precise_abstract_selection_raw_response_type": {
"kind": "disabled"
},
"disable_resolver_reader_ast": false,
"disable_schema_validation": false,
"enable_3d_branch_arg_generation": false,
Expand Down Expand Up @@ -2440,6 +2529,92 @@
}
]
},
"disable_more_precise_abstract_selection_raw_response_type": {
"description": "Disable the generation of a more precise raw response type for selections on abstract types.",
"default": {
"kind": "disabled"
},
"oneOf": [
{
"description": "Fully disabled: developers may not use this feature",
"type": "object",
"required": [
"kind"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"disabled"
]
}
}
},
{
"description": "Fully enabled: developers may use this feature",
"type": "object",
"required": [
"kind"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"enabled"
]
}
}
},
{
"description": "Partially enabled: developers may only use this feature on the listed items (fragments, fields, types).",
"type": "object",
"required": [
"allowlist",
"kind"
],
"properties": {
"allowlist": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"kind": {
"type": "string",
"enum": [
"limited"
]
}
}
},
{
"description": "Partially enabled: used for gradual rollout of the feature",
"type": "object",
"required": [
"kind",
"rollout"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"rollout"
]
},
"rollout": {
"description": "A utility to enable gradual rollout of large codegen changes. Can be constructed as the Default which passes or a percentage between 0 and 100.",
"type": [
"integer",
"null"
],
"format": "uint8",
"minimum": 0.0
}
}
}
]
},
"disable_resolver_reader_ast": {
"description": "Mirror of `enable_resolver_normalization_ast` excludes resolver metadata from reader ast",
"default": false,
Expand Down Expand Up @@ -3821,6 +3996,92 @@
}
]
},
"disable_more_precise_abstract_selection_raw_response_type": {
"description": "Disable the generation of a more precise raw response type for selections on abstract types.",
"default": {
"kind": "disabled"
},
"oneOf": [
{
"description": "Fully disabled: developers may not use this feature",
"type": "object",
"required": [
"kind"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"disabled"
]
}
}
},
{
"description": "Fully enabled: developers may use this feature",
"type": "object",
"required": [
"kind"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"enabled"
]
}
}
},
{
"description": "Partially enabled: developers may only use this feature on the listed items (fragments, fields, types).",
"type": "object",
"required": [
"allowlist",
"kind"
],
"properties": {
"allowlist": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"kind": {
"type": "string",
"enum": [
"limited"
]
}
}
},
{
"description": "Partially enabled: used for gradual rollout of the feature",
"type": "object",
"required": [
"kind",
"rollout"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"rollout"
]
},
"rollout": {
"description": "A utility to enable gradual rollout of large codegen changes. Can be constructed as the Default which passes or a percentage between 0 and 100.",
"type": [
"integer",
"null"
],
"format": "uint8",
"minimum": 0.0
}
}
}
]
},
"disable_resolver_reader_ast": {
"description": "Mirror of `enable_resolver_normalization_ast` excludes resolver metadata from reader ast",
"default": false,
Expand Down
Loading

0 comments on commit 97221cb

Please sign in to comment.