From 9b38e17cc3cd398d3ddbd090efc227a8003a380f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Sun, 26 Jan 2025 17:04:30 +0900 Subject: [PATCH] Lrc --- crates/swc_ecma_transforms_react/src/jsx/mod.rs | 2 +- crates/swc_ecma_transforms_typescript/src/config.rs | 7 +++---- crates/swc_ecma_transforms_typescript/src/typescript.rs | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/swc_ecma_transforms_react/src/jsx/mod.rs b/crates/swc_ecma_transforms_react/src/jsx/mod.rs index 9e9f2981e805..bd71f39725c9 100644 --- a/crates/swc_ecma_transforms_react/src/jsx/mod.rs +++ b/crates/swc_ecma_transforms_react/src/jsx/mod.rs @@ -101,7 +101,7 @@ pub struct Options { macro_rules! static_str { ($s:expr) => {{ - static VAL: Lazy> = Lazy::new(|| Arc::new($s.into())); + static VAL: Lazy> = Lazy::new(|| Lrc::new($s.into())); VAL.clone() }}; } diff --git a/crates/swc_ecma_transforms_typescript/src/config.rs b/crates/swc_ecma_transforms_typescript/src/config.rs index af5be63a7537..9dffd77f8201 100644 --- a/crates/swc_ecma_transforms_typescript/src/config.rs +++ b/crates/swc_ecma_transforms_typescript/src/config.rs @@ -1,6 +1,5 @@ -use std::sync::Arc; - use serde::{Deserialize, Serialize}; +use swc_common::sync::Lrc; #[derive(Debug, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -41,11 +40,11 @@ pub struct Config { pub struct TsxConfig { /// Note: this pass handle jsx directives in comments #[serde(default)] - pub pragma: Option>, + pub pragma: Option>, /// Note: this pass handle jsx directives in comments #[serde(default)] - pub pragma_frag: Option>, + pub pragma_frag: Option>, } #[derive(Default, Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/swc_ecma_transforms_typescript/src/typescript.rs b/crates/swc_ecma_transforms_typescript/src/typescript.rs index bef683fb3d3d..7644213a62c5 100644 --- a/crates/swc_ecma_transforms_typescript/src/typescript.rs +++ b/crates/swc_ecma_transforms_typescript/src/typescript.rs @@ -1,4 +1,4 @@ -use std::{mem, sync::Arc}; +use std::mem; use once_cell::sync::Lazy; use swc_common::{ @@ -14,7 +14,7 @@ use crate::{strip_import_export::StripImportExport, strip_type::StripType, trans macro_rules! static_str { ($s:expr) => {{ - static VAL: Lazy> = Lazy::new(|| Arc::new($s.into())); + static VAL: Lazy> = Lazy::new(|| Lrc::new($s.into())); VAL.clone() }}; }