Skip to content

Commit

Permalink
Don't remove deprecated config options. Do that in separate PR
Browse files Browse the repository at this point in the history
  • Loading branch information
captbaritone committed Jun 24, 2024
1 parent 6ccccc9 commit e7e0561
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
24 changes: 24 additions & 0 deletions compiler/crates/relay-compiler/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use graphql_syntax::ExecutableDefinition;
use indexmap::IndexMap;
use intern::string_key::StringKey;
use js_config_loader::LoaderSource;
use log::warn;
use persist_query::PersistError;
use rayon::prelude::*;
use regex::Regex;
Expand Down Expand Up @@ -729,6 +730,14 @@ pub struct SingleProjectConfigFile {
/// the babel plugin needs `artifactDirectory` set as well.
pub artifact_directory: Option<PathBuf>,

/// \[DEPRECATED\] This is deprecated field, we're not using it in the V13.
/// Adding to the config, to show the warning, and not a parse error.
pub include: Vec<String>,

/// \[DEPRECATED\] This is deprecated field, we're not using it in the V13.
/// Adding to the config, to show the warning, and not a parse error.
pub extensions: Vec<String>,

/// Directories to ignore under src
/// default: ['**/node_modules/**', '**/__mocks__/**', '**/__generated__/**'],
#[serde(alias = "exclude")]
Expand Down Expand Up @@ -782,6 +791,8 @@ impl Default for SingleProjectConfigFile {
schema: Default::default(),
src: Default::default(),
artifact_directory: Default::default(),
include: vec![],
extensions: vec![],
excludes: get_default_excludes(),
schema_extensions: vec![],
schema_config: Default::default(),
Expand Down Expand Up @@ -841,6 +852,19 @@ impl SingleProjectConfigFile {
}

fn create_multi_project_config(self, config_path: &Path) -> Result<MultiProjectConfigFile> {
if !self.include.is_empty() {
warn!(
r#"The configuration contains `include: {:#?}` section. This configuration option is no longer supported. Consider removing it."#,
&self.include
);
}
if !self.extensions.is_empty() {
warn!(
r#"The configuration contains `extensions: {:#?}` section. This configuration option is no longer supported. Consider removing it."#,
&self.extensions
);
}

if self.typegen_phase.is_some() {
return Err(Error::ConfigFileValidation {
config_path: config_path.into(),
Expand Down
16 changes: 16 additions & 0 deletions compiler/relay-compiler-config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@
"default": false,
"type": "boolean"
},
"extensions": {
"description": "\\[DEPRECATED\\] This is deprecated field, we're not using it in the V13. Adding to the config, to show the warning, and not a parse error.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"featureFlags": {
"default": null,
"type": [
Expand Down Expand Up @@ -1181,6 +1189,14 @@
},
"additionalProperties": false
},
"include": {
"description": "\\[DEPRECATED\\] This is deprecated field, we're not using it in the V13. Adding to the config, to show the warning, and not a parse error.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"isDevVariableName": {
"description": "We may generate some content in the artifacts that's stripped in production if __DEV__ variable is set This config option is here to define the name of that special variable",
"default": null,
Expand Down

0 comments on commit e7e0561

Please sign in to comment.