diff --git a/Cargo.lock b/Cargo.lock index bc06e6cce..3fc7ece70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3197,7 +3197,7 @@ dependencies = [ [[package]] name = "swc_relay" -version = "0.44.18" +version = "0.44.19" dependencies = [ "once_cell", "regex", diff --git a/packages/relay/CHANGELOG.md b/packages/relay/CHANGELOG.md index d539aab7b..d9d4ed617 100644 --- a/packages/relay/CHANGELOG.md +++ b/packages/relay/CHANGELOG.md @@ -1,5 +1,11 @@ # @swc/plugin-relay +## 2.0.11 + +### Patch Changes + +- 7984823: Use Arc instead of Config + ## 2.0.10 ### Patch Changes diff --git a/packages/relay/README.md b/packages/relay/README.md index 0bb2d0e08..a4f6f7111 100644 --- a/packages/relay/README.md +++ b/packages/relay/README.md @@ -104,6 +104,12 @@ In this example typescript graphql files will output transpiled import path of ` # @swc/plugin-relay +## 2.0.11 + +### Patch Changes + +- 7984823: Use Arc instead of Config + ## 2.0.10 ### Patch Changes diff --git a/packages/relay/package.json b/packages/relay/package.json index 335641c94..8ea999467 100644 --- a/packages/relay/package.json +++ b/packages/relay/package.json @@ -1,6 +1,6 @@ { "name": "@swc/plugin-relay", - "version": "2.0.10", + "version": "2.0.11", "description": "SWC plugin for relay", "main": "swc_plugin_relay.wasm", "types": "./types.d.ts", diff --git a/packages/relay/src/lib.rs b/packages/relay/src/lib.rs index 530c3205a..e556ee5e0 100644 --- a/packages/relay/src/lib.rs +++ b/packages/relay/src/lib.rs @@ -61,7 +61,7 @@ fn relay_plugin_transform(program: Program, metadata: TransformPluginProgramMeta }; let mut relay = relay( - config, + config.into(), filename, root_dir, None, diff --git a/packages/relay/transform/Cargo.toml b/packages/relay/transform/Cargo.toml index ec1a8b875..ec3501142 100644 --- a/packages/relay/transform/Cargo.toml +++ b/packages/relay/transform/Cargo.toml @@ -11,7 +11,7 @@ homepage = { workspace = true } license = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } -version = "0.44.18" +version = "0.44.19" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/relay/transform/src/lib.rs b/packages/relay/transform/src/lib.rs index aaf9ab35d..99553308e 100644 --- a/packages/relay/transform/src/lib.rs +++ b/packages/relay/transform/src/lib.rs @@ -2,7 +2,10 @@ //! TODO: Once refactoring next-swc is done, remove duplicated codes and import //! packages directly -use std::path::{Path, PathBuf}; +use std::{ + path::{Path, PathBuf}, + sync::Arc, +}; use once_cell::sync::Lazy; use regex::Regex; @@ -102,7 +105,7 @@ struct Relay { root_dir: PathBuf, pages_dir: Option, file_name: FileName, - config: Config, + config: Arc, imports: Vec, unresolved_mark: Option, } @@ -330,7 +333,7 @@ impl Relay { } pub fn relay( - config: Config, + config: Arc, file_name: FileName, root_dir: PathBuf, pages_dir: Option, diff --git a/packages/relay/transform/tests/fixture.rs b/packages/relay/transform/tests/fixture.rs index 11361d574..354b7fcb6 100644 --- a/packages/relay/transform/tests/fixture.rs +++ b/packages/relay/transform/tests/fixture.rs @@ -18,7 +18,8 @@ fn fixture(input: PathBuf) { language: RelayLanguageConfig::TypeScript, eager_es_modules: false, output_file_extension: OutputFileExtension::Undefined, - }, + } + .into(), FileName::Real("file.js".parse().unwrap()), Default::default(), None, @@ -45,7 +46,8 @@ fn fixture_es_modules(input: PathBuf) { language: RelayLanguageConfig::TypeScript, eager_es_modules: true, output_file_extension: OutputFileExtension::Undefined, - }, + } + .into(), FileName::Real("file.js".parse().unwrap()), Default::default(), None, @@ -72,7 +74,8 @@ fn fixture_output_file_extension_javascript(input: PathBuf) { language: RelayLanguageConfig::TypeScript, eager_es_modules: true, output_file_extension: OutputFileExtension::JavaScript, - }, + } + .into(), FileName::Real("file.js".parse().unwrap()), Default::default(), None, @@ -99,7 +102,8 @@ fn fixture_output_file_extension_typescript(input: PathBuf) { language: RelayLanguageConfig::JavaScript, eager_es_modules: true, output_file_extension: OutputFileExtension::TypeScript, - }, + } + .into(), FileName::Real("file.js".parse().unwrap()), Default::default(), None, @@ -146,7 +150,8 @@ fn fixture_multi_projects(input: PathBuf) { language: RelayLanguageConfig::JavaScript, eager_es_modules: true, output_file_extension: OutputFileExtension::TypeScript, - }, + } + .into(), FileName::Real(input.clone()), Default::default(), None,