Skip to content

Commit d6d09d5

Browse files
captbaritonemeta-codesync[bot]
authored andcommitted
Remove legacy_include_path_in_required_reader_nodes feature flag
Summary: The `path` field on `required` Reader AST nodes has been unused by the runtime for a long time. `ReaderRequiredField.path` is commented "This field is not used any more". `legacy_include_path_in_required_reader_nodes` existed so the field could be removed from generated artifacts gradually. The diffs below roll every www and xplat project to 0%, after which nothing sets the flag. This diff deletes the flag, and the compiler stops emitting `path` on `RequiredField` Reader nodes. LAND ORDER: land after the www ramp stack (ends at D124273444) and the xplat ramp stack (ends at D124281529). `FeatureFlags` uses `deny_unknown_fields`, so a config that still sets the flag would fail to parse. OSS: configs that set `legacy_include_path_in_required_reader_nodes` must drop it. The flag has defaulted to disabled, so artifacts don't change for anyone who never set it. Reviewed By: voideanvalue Differential Revision: D124284113 fbshipit-source-id: 4dd86be08b7c6b7ddc6cb6b424c8425d7735dc2f
1 parent 5479346 commit d6d09d5

3 files changed

Lines changed: 2 additions & 34 deletions

File tree

‎compiler/crates/common/src/feature_flags.rs‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,6 @@ pub struct FeatureFlags {
215215
#[serde(default)]
216216
pub disable_deduping_common_structures_in_raw_response_types: FeatureFlag,
217217

218-
/// The `path` field in `@required` Reader AST nodes is no longer used. But
219-
/// removing them in one diff is too large of a change to ship at once.
220-
///
221-
/// This flag will allow us to use the rollout FeatureFlag to remove them
222-
/// across a number of diffs.
223-
#[serde(default)]
224-
pub legacy_include_path_in_required_reader_nodes: FeatureFlag,
225-
226218
/// Disallow @required action THROW on semantically nullable fields.
227219
/// When enabled, this will prevent the use of THROW action on fields
228220
/// that are semantically nullable (e.g., fields that can legitimately
@@ -337,7 +329,6 @@ impl Default for FeatureFlags {
337329
disable_deduping_common_structures_in_artifacts: Default::default(),
338330
dedupe_common_structures_in_raw_response_types: Default::default(),
339331
disable_deduping_common_structures_in_raw_response_types: Default::default(),
340-
legacy_include_path_in_required_reader_nodes: Default::default(),
341332
disallow_required_action_throw_on_semantically_nullable_fields: Default::default(),
342333
enable_shadow_resolvers: Default::default(),
343334
allow_legacy_relay_resolver_tag: Default::default(),

‎compiler/crates/relay-codegen/src/build_ast.rs‎

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,24 +1320,11 @@ impl<'schema, 'builder, 'config> CodegenBuilder<'schema, 'builder, 'config> {
13201320
required_metadata: &RequiredMetadataDirective,
13211321
primitive: Primitive,
13221322
) -> Primitive {
1323-
let mut obj = object! {
1323+
Primitive::Key(self.object(object! {
13241324
kind: Primitive::String(CODEGEN_CONSTANTS.required_field),
13251325
field: primitive,
13261326
action: Primitive::String(required_metadata.action.into()),
1327-
};
1328-
1329-
if self
1330-
.project_config
1331-
.feature_flags
1332-
.legacy_include_path_in_required_reader_nodes
1333-
.is_enabled_for(self.definition_source_location.item)
1334-
{
1335-
obj.push(ObjectEntry {
1336-
key: CODEGEN_CONSTANTS.path,
1337-
value: Primitive::String(required_metadata.path),
1338-
});
1339-
}
1340-
Primitive::Key(self.object(obj))
1327+
}))
13411328
}
13421329

13431330
fn build_catch_node(

‎compiler/crates/relay-compiler/relay-compiler-config-schema.json‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -780,13 +780,6 @@
780780
"type": "boolean",
781781
"default": false
782782
},
783-
"legacy_include_path_in_required_reader_nodes": {
784-
"description": "The `path` field in `@required` Reader AST nodes is no longer used. But\nremoving them in one diff is too large of a change to ship at once.\n\nThis flag will allow us to use the rollout FeatureFlag to remove them\nacross a number of diffs.",
785-
"$ref": "#/$defs/FeatureFlag",
786-
"default": {
787-
"kind": "disabled"
788-
}
789-
},
790783
"no_inline": {
791784
"description": "For now, this also disallows fragments with variable definitions\nThis also makes @module to opt in using @no_inline internally\nNOTE that the presence of a fragment in this list only controls whether a fragment is *allowed* to\nuse @no_inline: whether the fragment is inlined or not depends on whether it actually uses that\ndirective.",
792785
"$ref": "#/$defs/FeatureFlag",
@@ -1074,9 +1067,6 @@
10741067
"kind": "enabled"
10751068
},
10761069
"enforce_module_name_prefix_for_non_haste": false,
1077-
"legacy_include_path_in_required_reader_nodes": {
1078-
"kind": "disabled"
1079-
},
10801070
"no_inline": {
10811071
"kind": "disabled"
10821072
},

0 commit comments

Comments
 (0)