From 64d23aa2dd5b83640f2070a277df954c640b33aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?=
 <kdy1997.dev@gmail.com>
Date: Wed, 4 Dec 2024 17:11:17 +0900
Subject: [PATCH 1/3] Update swc_core to 8

---
 Cargo.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Cargo.toml b/Cargo.toml
index d3b856d..77a492c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ serializable = ["serde"]
 [dependencies]
 markdown = "=1.0.0-alpha.21"
 serde = { version = "1", optional = true }
-swc_core = { version = "5", features = [
+swc_core = { version = "8", features = [
   "common",
   "ecma_ast",
   "ecma_codegen",

From 7e46b881a3c9141b9d11259baec125bcfd5a5ed9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?=
 <kdy1997.dev@gmail.com>
Date: Mon, 9 Dec 2024 07:57:34 +0900
Subject: [PATCH 2/3] fix clippy issues

---
 src/mdx_plugin_recma_jsx_rewrite.rs | 16 ++++++++--------
 src/swc_util_build_jsx.rs           |  4 ++--
 src/swc_utils.rs                    |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/mdx_plugin_recma_jsx_rewrite.rs b/src/mdx_plugin_recma_jsx_rewrite.rs
index 5140297..ab50db2 100644
--- a/src/mdx_plugin_recma_jsx_rewrite.rs
+++ b/src/mdx_plugin_recma_jsx_rewrite.rs
@@ -160,7 +160,7 @@ struct State<'a> {
     explicit_jsxs: FxHashSet<Span>,
 }
 
-impl<'a> State<'a> {
+impl State<'_> {
     /// Open a new scope.
     fn enter(&mut self, info: Option<Info>) {
         self.scopes.push(Scope {
@@ -202,7 +202,7 @@ impl<'a> State<'a> {
             // ```jsx
             // props.components
             // ```
-            if is_props_receiving_fn(&info.name) {
+            if is_props_receiving_fn(info.name.as_deref()) {
                 let member = MemberExpr {
                     obj: Box::new(create_ident_expression("props")),
                     prop: MemberProp::Ident(create_ident("components")),
@@ -552,7 +552,7 @@ impl<'a> State<'a> {
     }
 
     /// Reference a component or object name.
-    fn ref_dynamic(&mut self, path: &[String], component: bool, position: &Option<Position>) {
+    fn ref_dynamic(&mut self, path: &[String], component: bool, position: Option<&Position>) {
         let scope = self.current_top_level_info().expect("expected scope");
         let name = path.join(".");
         let existing = scope.dynamic.iter_mut().find(|d| d.name == name);
@@ -565,7 +565,7 @@ impl<'a> State<'a> {
             let dynamic = Dynamic {
                 name,
                 component,
-                position: position.clone(),
+                position: position.cloned(),
             };
 
             scope.dynamic.push(dynamic);
@@ -592,7 +592,7 @@ impl<'a> State<'a> {
         // If there is a top-level, non-global, scope which is a function:
         if let Some(info) = self.current_top_level_info() {
             // Rewrite only if we can rewrite.
-            if is_props_receiving_fn(&info.name) || self.provider {
+            if is_props_receiving_fn(info.name.as_deref()) || self.provider {
                 debug_assert!(!ids.is_empty(), "expected non-empty ids");
                 let explicit_jsx = self.explicit_jsxs.contains(&span);
                 let mut path = ids.to_owned();
@@ -611,7 +611,7 @@ impl<'a> State<'a> {
                     // Component or object not in scope.
                     let mut index = 1;
                     while index <= path.len() {
-                        self.ref_dynamic(&path[0..index], index == ids.len(), &position);
+                        self.ref_dynamic(&path[0..index], index == ids.len(), position.as_ref());
                         index += 1;
                     }
                 }
@@ -691,7 +691,7 @@ impl<'a> State<'a> {
     }
 }
 
-impl<'a> VisitMut for State<'a> {
+impl VisitMut for State<'_> {
     noop_visit_mut_type!();
 
     /// Rewrite JSX identifiers.
@@ -999,7 +999,7 @@ fn create_error_helper(development: bool, path: Option<String>) -> ModuleItem {
 }
 
 /// Check if this function is a props receiving component: it’s one of ours.
-fn is_props_receiving_fn(name: &Option<String>) -> bool {
+fn is_props_receiving_fn(name: Option<&str>) -> bool {
     if let Some(name) = name {
         name == "_createMdxContent" || name == "MDXContent"
     } else {
diff --git a/src/swc_util_build_jsx.rs b/src/swc_util_build_jsx.rs
index db61954..bbc63fa 100644
--- a/src/swc_util_build_jsx.rs
+++ b/src/swc_util_build_jsx.rs
@@ -173,7 +173,7 @@ struct State<'a> {
     fragment_expression: Expr,
 }
 
-impl<'a> State<'a> {
+impl State<'_> {
     /// Turn an attribute value into an expression.
     fn jsx_attribute_value_to_expression(
         &mut self,
@@ -590,7 +590,7 @@ impl<'a> State<'a> {
     }
 }
 
-impl<'a> VisitMut for State<'a> {
+impl VisitMut for State<'_> {
     noop_visit_mut_type!();
 
     /// Visit expressions, rewriting JSX, and walking deeper.
diff --git a/src/swc_utils.rs b/src/swc_utils.rs
index 1124b57..37d873e 100644
--- a/src/swc_utils.rs
+++ b/src/swc_utils.rs
@@ -116,7 +116,7 @@ pub struct RewriteStopsContext<'a> {
     pub location: Option<&'a Location>,
 }
 
-impl<'a> VisitMut for RewriteStopsContext<'a> {
+impl VisitMut for RewriteStopsContext<'_> {
     noop_visit_mut_type!();
 
     /// Rewrite spans.

From 21b9657477b75a9342809011089a2c81316ae2bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?=
 <kdy1997.dev@gmail.com>
Date: Mon, 9 Dec 2024 15:36:35 +0900
Subject: [PATCH 3/3] Update swc_core

---
 Cargo.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Cargo.toml b/Cargo.toml
index 77a492c..df2f783 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ serializable = ["serde"]
 [dependencies]
 markdown = "=1.0.0-alpha.21"
 serde = { version = "1", optional = true }
-swc_core = { version = "8", features = [
+swc_core = { version = "9", features = [
   "common",
   "ecma_ast",
   "ecma_codegen",