Skip to content

Commit

Permalink
feat(trace): add trace for emotion transform
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Mar 31, 2022
1 parent c13c702 commit d0aee96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/next-swc/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/next-swc/crates/core/Cargo.toml
Expand Up @@ -31,6 +31,7 @@ swc_cached = "0.1.1"
swc_css_prefixer = "0.99.3"
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
handlebars = "4.2.1"
swc_trace_macro = "0.1.1"

[dev-dependencies]
swc_ecma_transforms_testing = "0.75.0"
Expand Down
2 changes: 2 additions & 0 deletions packages/next-swc/crates/core/src/emotion/mod.rs
Expand Up @@ -15,6 +15,7 @@ use swc_ecmascript::ast::{
ArrayLit, JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXAttrValue, JSXElementName, JSXExpr,
JSXExprContainer, JSXObject,
};
use swc_trace_macro::swc_trace;
use swc_ecmascript::utils::ident::IdentLike;
use swc_ecmascript::utils::{ExprFactory, Id};
use swc_ecmascript::{
Expand Down Expand Up @@ -164,6 +165,7 @@ pub struct EmotionTransformer<C: Comments> {
in_jsx_element: bool,
}

#[swc_trace]
impl<C: Comments> EmotionTransformer<C> {
pub fn new(options: EmotionOptions, path: &Path, cm: Arc<SourceMap>, comments: C) -> Self {
EmotionTransformer {
Expand Down

0 comments on commit d0aee96

Please sign in to comment.