Skip to content

Commit

Permalink
Add typescriptExcludeUndefinedFromNullableUnion to SingleProjectConfi…
Browse files Browse the repository at this point in the history
…gFile (#4482)

Summary:
A little oversight from #4380

Pull Request resolved: #4482

Reviewed By: captbaritone

Differential Revision: D50299594

Pulled By: alunyov

fbshipit-source-id: a7d99cd0a7d6497a3ff5ff71fa5be0a1d4114324
  • Loading branch information
tobias-tengler authored and facebook-github-bot committed Oct 16, 2023
1 parent 998fd49 commit 4ffd869
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions compiler/crates/relay-compiler/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,12 @@ pub struct SingleProjectConfigFile {

#[serde(default)]
pub feature_flags: Option<FeatureFlags>,

/// Keep the previous compiler behavior by outputting an union
/// of the raw type and null, and not the **correct** behavior
/// of an union with the raw type, null and undefined.
#[serde(default)]
pub typescript_exclude_undefined_from_nullable_union: bool,
}

impl Default for SingleProjectConfigFile {
Expand All @@ -758,6 +764,7 @@ impl Default for SingleProjectConfigFile {
js_module_format: JsModuleFormat::CommonJS,
typegen_phase: None,
feature_flags: None,
typescript_exclude_undefined_from_nullable_union: false,
module_import_config: Default::default(),
}
}
Expand Down Expand Up @@ -879,6 +886,8 @@ impl SingleProjectConfigFile {
no_future_proof_enums: self.no_future_proof_enums,
..Default::default()
},
typescript_exclude_undefined_from_nullable_union: self
.typescript_exclude_undefined_from_nullable_union,
..Default::default()
},
js_module_format: self.js_module_format,
Expand Down

0 comments on commit 4ffd869

Please sign in to comment.