Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typescriptExcludeUndefinedFromNullableUnion to SingleProjectConfigFile #4482

Closed
Closed
Changes from all commits
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
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
Loading