Skip to content

Commit

Permalink
Update swc_core
Browse files Browse the repository at this point in the history
Closes GH-40.
  • Loading branch information
kdy1 committed Jan 25, 2024
1 parent aaf7fd4 commit d094297
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ serializable = ["serde"]
[dependencies]
markdown = "1.0.0-alpha.16"
serde = { version = "1", optional = true }
swc_core = { version = "0.87.0", features = [
swc_core = { version = "0.89.0", features = [
"ecma_ast",
"ecma_visit",
"ecma_codegen",
Expand Down
5 changes: 3 additions & 2 deletions src/hast_util_to_swc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,8 @@ mod tests {
use crate::swc::serialize;
use pretty_assertions::assert_eq;
use swc_core::ecma::ast::{
Ident, ImportDecl, ImportDefaultSpecifier, ImportSpecifier, JSXAttrName, JSXElementName,
ModuleDecl,
Ident, ImportDecl, ImportDefaultSpecifier, ImportPhase, ImportSpecifier, JSXAttrName,
JSXElementName, ModuleDecl,
};

#[test]
Expand Down Expand Up @@ -1374,6 +1374,7 @@ mod tests {
}),
type_only: false,
with: None,
phase: ImportPhase::default(),
span: swc_core::common::DUMMY_SP,
}))],
span: swc_core::common::DUMMY_SP,
Expand Down
8 changes: 5 additions & 3 deletions src/mdx_plugin_recma_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ use markdown::{
use swc_core::ecma::ast::{
AssignPat, BindingIdent, BlockStmt, Callee, CondExpr, Decl, DefaultDecl, ExportDefaultExpr,
ExportSpecifier, Expr, ExprOrSpread, FnDecl, Function, ImportDecl, ImportDefaultSpecifier,
ImportNamedSpecifier, ImportSpecifier, JSXAttrOrSpread, JSXClosingElement, JSXElement,
JSXElementChild, JSXElementName, JSXOpeningElement, ModuleDecl, ModuleExportName, ModuleItem,
Param, Pat, ReturnStmt, SpreadElement, Stmt, VarDecl, VarDeclKind, VarDeclarator,
ImportNamedSpecifier, ImportPhase, ImportSpecifier, JSXAttrOrSpread, JSXClosingElement,
JSXElement, JSXElementChild, JSXElementName, JSXOpeningElement, ModuleDecl, ModuleExportName,
ModuleItem, Param, Pat, ReturnStmt, SpreadElement, Stmt, VarDecl, VarDeclKind, VarDeclarator,
};
/// JSX runtimes (default: `JsxRuntime::Automatic`).
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
Expand Down Expand Up @@ -161,6 +161,7 @@ pub fn mdx_plugin_recma_document(
)),
type_only: false,
with: None,
phase: ImportPhase::default(),
span: swc_core::common::DUMMY_SP,
})));
}
Expand Down Expand Up @@ -283,6 +284,7 @@ pub fn mdx_plugin_recma_document(
src: source,
type_only: false,
with: None,
phase: ImportPhase::default(),
span: swc_core::common::DUMMY_SP,
})));
}
Expand Down
9 changes: 5 additions & 4 deletions src/mdx_plugin_recma_jsx_rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ use swc_core::ecma::ast::{
ArrowExpr, AssignPatProp, BinaryOp, BindingIdent, BlockStmt, BlockStmtOrExpr, Callee,
CatchClause, ClassDecl, CondExpr, Decl, DoWhileStmt, Expr, ExprOrSpread, ExprStmt, FnDecl,
FnExpr, ForInStmt, ForOfStmt, ForStmt, Function, IfStmt, ImportDecl, ImportNamedSpecifier,
ImportSpecifier, JSXElement, JSXElementName, KeyValuePatProp, KeyValueProp, MemberExpr,
MemberProp, ModuleDecl, ModuleExportName, ModuleItem, NewExpr, ObjectPat, ObjectPatProp, Param,
ParenExpr, Pat, Prop, PropOrSpread, ReturnStmt, Stmt, ThrowStmt, UnaryExpr, UnaryOp, VarDecl,
VarDeclKind, VarDeclarator, WhileStmt,
ImportPhase, ImportSpecifier, JSXElement, JSXElementName, KeyValuePatProp, KeyValueProp,
MemberExpr, MemberProp, ModuleDecl, ModuleExportName, ModuleItem, NewExpr, ObjectPat,
ObjectPatProp, Param, ParenExpr, Pat, Prop, PropOrSpread, ReturnStmt, Stmt, ThrowStmt,
UnaryExpr, UnaryOp, VarDecl, VarDeclKind, VarDeclarator, WhileStmt,
};
use swc_core::ecma::visit::{noop_visit_mut_type, VisitMut, VisitMutWith};

Expand Down Expand Up @@ -870,6 +870,7 @@ fn create_import_provider(source: &str) -> ModuleItem {
src: Box::new(create_str(source)),
type_only: false,
with: None,
phase: ImportPhase::default(),
span: DUMMY_SP,
}))
}
Expand Down
3 changes: 2 additions & 1 deletion src/swc_util_build_jsx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use swc_core::common::{
util::take::Take,
};
use swc_core::ecma::ast::{
ArrayLit, CallExpr, Callee, Expr, ExprOrSpread, ImportDecl, ImportNamedSpecifier,
ArrayLit, CallExpr, Callee, Expr, ExprOrSpread, ImportDecl, ImportNamedSpecifier, ImportPhase,
ImportSpecifier, JSXAttrName, JSXAttrOrSpread, JSXAttrValue, JSXElement, JSXElementChild,
JSXExpr, JSXFragment, KeyValueProp, Lit, ModuleDecl, ModuleExportName, ModuleItem, Prop,
PropName, PropOrSpread, ThisExpr,
Expand Down Expand Up @@ -121,6 +121,7 @@ pub fn swc_util_build_jsx(
))),
type_only: false,
with: None,
phase: ImportPhase::default(),
span: swc_core::common::DUMMY_SP,
})),
);
Expand Down

0 comments on commit d094297

Please sign in to comment.