Unverified Commit fd231a68 authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

Update swc (#33201)

This PR is a bit big because AST definitions are modified recently because previous AST defs were too error-prone.
It will prevent plugin authors from making some common mistakes.


 - Closes #33088
 - Closes #31084
 - Closes #33283
parent 7db6aa2f
This diff is collapsed.
...@@ -14,21 +14,21 @@ fxhash = "0.2.1" ...@@ -14,21 +14,21 @@ fxhash = "0.2.1"
pathdiff = "0.2.0" pathdiff = "0.2.0"
serde = "1" serde = "1"
serde_json = "1" serde_json = "1"
styled_components = "0.9.0" styled_components = "0.11.0"
swc = "0.110.0" swc = "0.114.0"
swc_atoms = "0.2.7" swc_atoms = "0.2.7"
swc_common = { version = "0.16.0", features = ["concurrent", "sourcemap"] } swc_common = { version = "0.17.0", features = ["concurrent", "sourcemap"] }
swc_css = "0.45.0" swc_css = "0.46.0"
swc_ecma_loader = { version = "0.26.0", features = ["node", "lru"] } swc_ecma_loader = { version = "0.27.0", features = ["node", "lru"] }
swc_ecmascript = { version = "0.105.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_ecmascript = { version = "0.108.1", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_node_base = "0.5.1" swc_node_base = "0.5.1"
swc_stylis = "0.42.0" swc_stylis = "0.43.0"
tracing = {version = "0.1.28", features = ["release_max_level_off"]} tracing = {version = "0.1.28", features = ["release_max_level_off"]}
regex = "1.5" regex = "1.5"
[dev-dependencies] [dev-dependencies]
swc_ecma_transforms_testing = "0.56.0" swc_ecma_transforms_testing = "0.58.0"
testing = "0.17.0" testing = "0.18.0"
walkdir = "2.3.2" walkdir = "2.3.2"
...@@ -18,12 +18,9 @@ struct CjsFinder { ...@@ -18,12 +18,9 @@ struct CjsFinder {
/// does not support changing configuration based on content of the file. /// does not support changing configuration based on content of the file.
impl Visit for CjsFinder { impl Visit for CjsFinder {
fn visit_member_expr(&mut self, e: &MemberExpr) { fn visit_member_expr(&mut self, e: &MemberExpr) {
if !e.computed { match &*e.obj {
match &e.obj { Expr::Ident(obj) => match &e.prop {
ExprOrSuper::Super(_) => {} MemberProp::Ident(prop) => {
ExprOrSuper::Expr(obj) => match &**obj {
Expr::Ident(obj) => match &*e.prop {
Expr::Ident(prop) => {
if &*obj.sym == "module" && &*prop.sym == "exports" { if &*obj.sym == "module" && &*prop.sym == "exports" {
self.found = true; self.found = true;
return; return;
...@@ -32,14 +29,9 @@ impl Visit for CjsFinder { ...@@ -32,14 +29,9 @@ impl Visit for CjsFinder {
_ => {} _ => {}
}, },
_ => {} _ => {}
},
}
} }
e.obj.visit_with(self); e.obj.visit_with(self);
if e.computed {
e.prop.visit_with(self); e.prop.visit_with(self);
} }
}
} }
use swc_atoms::JsWord; use swc_atoms::JsWord;
use swc_common::DUMMY_SP; use swc_common::DUMMY_SP;
use swc_ecmascript::ast::{ use swc_ecmascript::ast::{
ArrayPat, Decl, Expr, ExprOrSuper, Ident, ImportDecl, ImportSpecifier, KeyValuePatProp, Number, ArrayPat, Callee, Decl, Expr, Ident, ImportDecl, ImportSpecifier, KeyValuePatProp, Number,
ObjectPat, ObjectPatProp, Pat, PropName, VarDecl, VarDeclarator, ObjectPat, ObjectPatProp, Pat, PropName, VarDecl, VarDeclarator,
}; };
use swc_ecmascript::visit::{Fold, FoldWith}; use swc_ecmascript::visit::{Fold, FoldWith};
...@@ -73,7 +73,7 @@ impl HookOptimizer { ...@@ -73,7 +73,7 @@ impl HookOptimizer {
let init_clone = init.clone(); let init_clone = init.clone();
if let Pat::Array(a) = name { if let Pat::Array(a) = name {
if let Expr::Call(c) = &*init.as_deref().unwrap() { if let Expr::Call(c) = &*init.as_deref().unwrap() {
if let ExprOrSuper::Expr(i) = &c.callee { if let Callee::Expr(i) = &c.callee {
if let Expr::Ident(Ident { sym, .. }) = &**i { if let Expr::Ident(Ident { sym, .. }) = &**i {
if self.hooks.contains(&sym) { if self.hooks.contains(&sym) {
let name = get_object_pattern(&a); let name = get_object_pattern(&a);
......
...@@ -4,9 +4,9 @@ use pathdiff::diff_paths; ...@@ -4,9 +4,9 @@ use pathdiff::diff_paths;
use swc_atoms::js_word; use swc_atoms::js_word;
use swc_common::{FileName, DUMMY_SP}; use swc_common::{FileName, DUMMY_SP};
use swc_ecmascript::ast::{ use swc_ecmascript::ast::{
ArrayLit, ArrowExpr, BinExpr, BinaryOp, BlockStmtOrExpr, Bool, CallExpr, Expr, ExprOrSpread, ArrayLit, ArrowExpr, BinExpr, BinaryOp, BlockStmtOrExpr, Bool, CallExpr, Callee, Expr,
ExprOrSuper, Ident, ImportDecl, ImportSpecifier, KeyValueProp, Lit, MemberExpr, Null, ExprOrSpread, Ident, ImportDecl, ImportSpecifier, KeyValueProp, Lit, MemberExpr, MemberProp,
ObjectLit, Prop, PropName, PropOrSpread, Str, StrKind, Null, ObjectLit, Prop, PropName, PropOrSpread, Str, StrKind,
}; };
use swc_ecmascript::utils::ExprFactory; use swc_ecmascript::utils::ExprFactory;
use swc_ecmascript::utils::{ use swc_ecmascript::utils::{
...@@ -63,19 +63,15 @@ impl Fold for NextDynamicPatcher { ...@@ -63,19 +63,15 @@ impl Fold for NextDynamicPatcher {
fn fold_call_expr(&mut self, expr: CallExpr) -> CallExpr { fn fold_call_expr(&mut self, expr: CallExpr) -> CallExpr {
if self.is_next_dynamic_first_arg { if self.is_next_dynamic_first_arg {
if let ExprOrSuper::Expr(e) = &expr.callee { if let Callee::Import(..) = &expr.callee {
if let Expr::Ident(Ident { sym, .. }) = &**e {
if sym == "import" {
if let Expr::Lit(Lit::Str(Str { value, .. })) = &*expr.args[0].expr { if let Expr::Lit(Lit::Str(Str { value, .. })) = &*expr.args[0].expr {
self.dynamically_imported_specifier = Some(value.to_string()); self.dynamically_imported_specifier = Some(value.to_string());
} }
} }
}
}
return expr.fold_children_with(self); return expr.fold_children_with(self);
} }
let mut expr = expr.fold_children_with(self); let mut expr = expr.fold_children_with(self);
if let ExprOrSuper::Expr(i) = &expr.callee { if let Callee::Expr(i) = &expr.callee {
if let Expr::Ident(identifier) = &**i { if let Expr::Ident(identifier) = &**i {
if self.dynamic_bindings.contains(&identifier.to_id()) { if self.dynamic_bindings.contains(&identifier.to_id()) {
if expr.args.len() == 0 { if expr.args.len() == 0 {
...@@ -182,21 +178,18 @@ impl Fold for NextDynamicPatcher { ...@@ -182,21 +178,18 @@ impl Fold for NextDynamicPatcher {
body: BlockStmtOrExpr::Expr(Box::new(Expr::Array(ArrayLit { body: BlockStmtOrExpr::Expr(Box::new(Expr::Array(ArrayLit {
elems: vec![Some(ExprOrSpread { elems: vec![Some(ExprOrSpread {
expr: Box::new(Expr::Call(CallExpr { expr: Box::new(Expr::Call(CallExpr {
callee: ExprOrSuper::Expr(Box::new(Expr::Member( callee: Callee::Expr(Box::new(Expr::Member(
MemberExpr { MemberExpr {
obj: ExprOrSuper::Expr(Box::new( obj: Box::new(Expr::Ident(Ident {
Expr::Ident(Ident {
sym: js_word!("require"), sym: js_word!("require"),
span: DUMMY_SP, span: DUMMY_SP,
optional: false, optional: false,
}), })),
)), prop: MemberProp::Ident(Ident {
prop: Box::new(Expr::Ident(Ident {
sym: "resolveWeak".into(), sym: "resolveWeak".into(),
span: DUMMY_SP, span: DUMMY_SP,
optional: false, optional: false,
})), }),
computed: false,
span: DUMMY_SP, span: DUMMY_SP,
}, },
))), ))),
......
...@@ -144,12 +144,8 @@ impl Fold for Analyzer<'_> { ...@@ -144,12 +144,8 @@ impl Fold for Analyzer<'_> {
fn fold_jsx_element(&mut self, jsx: JSXElement) -> JSXElement { fn fold_jsx_element(&mut self, jsx: JSXElement) -> JSXElement {
fn get_leftmost_id_member_expr(e: &JSXMemberExpr) -> Id { fn get_leftmost_id_member_expr(e: &JSXMemberExpr) -> Id {
match &e.obj { match &e.obj {
JSXObject::Ident(i) => { JSXObject::Ident(i) => i.to_id(),
i.to_id() JSXObject::JSXMemberExpr(e) => get_leftmost_id_member_expr(e),
}
JSXObject::JSXMemberExpr(e) => {
get_leftmost_id_member_expr(e)
}
} }
} }
...@@ -202,16 +198,6 @@ impl Fold for Analyzer<'_> { ...@@ -202,16 +198,6 @@ impl Fold for Analyzer<'_> {
f f
} }
fn fold_member_expr(&mut self, mut e: MemberExpr) -> MemberExpr {
e.obj = e.obj.fold_with(self);
if e.computed {
e.prop = e.prop.fold_with(self);
}
e
}
/// Drops [ExportDecl] if all specifiers are removed. /// Drops [ExportDecl] if all specifiers are removed.
fn fold_module_item(&mut self, s: ModuleItem) -> ModuleItem { fn fold_module_item(&mut self, s: ModuleItem) -> ModuleItem {
match s { match s {
......
...@@ -50,7 +50,7 @@ impl RemoveConsole { ...@@ -50,7 +50,7 @@ impl RemoveConsole {
fn should_remove_call(&mut self, n: &CallExpr) -> bool { fn should_remove_call(&mut self, n: &CallExpr) -> bool {
let callee = &n.callee; let callee = &n.callee;
let member_expr = match callee { let member_expr = match callee {
ExprOrSuper::Expr(e) => match &**e { Callee::Expr(e) => match &**e {
Expr::Member(m) => m, Expr::Member(m) => m,
_ => return false, _ => return false,
}, },
...@@ -58,24 +58,22 @@ impl RemoveConsole { ...@@ -58,24 +58,22 @@ impl RemoveConsole {
}; };
// Don't attempt to evaluate computed properties. // Don't attempt to evaluate computed properties.
if member_expr.computed {
if matches!(&member_expr.prop, MemberProp::Computed(..)) {
return false; return false;
} }
// Only proceed if the object is the global `console` object. // Only proceed if the object is the global `console` object.
match &member_expr.obj { match &*member_expr.obj {
ExprOrSuper::Expr(e) => match &**e {
Expr::Ident(i) if self.is_global_console(i) => {} Expr::Ident(i) if self.is_global_console(i) => {}
_ => return false, _ => return false,
},
_ => return false,
} }
// Check if the property is requested to be excluded. // Check if the property is requested to be excluded.
// Here we do an O(n) search on the list of excluded properties because the size // Here we do an O(n) search on the list of excluded properties because the size
// should be small. // should be small.
match &*member_expr.prop { match &member_expr.prop {
Expr::Ident(i) if self.exclude.iter().find(|x| **x == i.sym).is_none() => {} MemberProp::Ident(i) if self.exclude.iter().find(|x| **x == i.sym).is_none() => {}
_ => return false, _ => return false,
} }
......
...@@ -227,8 +227,7 @@ impl Fold for StyledJSXTransformer { ...@@ -227,8 +227,7 @@ impl Fold for StyledJSXTransformer {
} }
} }
Expr::Member(MemberExpr { Expr::Member(MemberExpr {
obj: ExprOrSuper::Expr(boxed_ident), obj: boxed_ident, ..
..
}) => { }) => {
if let Expr::Ident(identifier) = &**boxed_ident { if let Expr::Ident(identifier) = &**boxed_ident {
if self.external_bindings.contains(&identifier.to_id()) { if self.external_bindings.contains(&identifier.to_id()) {
...@@ -284,7 +283,7 @@ impl Fold for StyledJSXTransformer { ...@@ -284,7 +283,7 @@ impl Fold for StyledJSXTransformer {
for stmt in block.stmts { for stmt in block.stmts {
new_stmts.push(stmt.fold_children_with(self)); new_stmts.push(stmt.fold_children_with(self));
if let Some(add_hash) = self.add_hash.take() { if let Some(add_hash) = self.add_hash.take() {
new_stmts.push(add_hash_statment(add_hash)); new_stmts.push(add_hash_statement(add_hash));
} }
} }
...@@ -317,14 +316,14 @@ impl Fold for StyledJSXTransformer { ...@@ -317,14 +316,14 @@ impl Fold for StyledJSXTransformer {
})))); }))));
self.add_default_decl = None; self.add_default_decl = None;
if let Some(add_hash) = self.add_hash.take() { if let Some(add_hash) = self.add_hash.take() {
new_items.push(ModuleItem::Stmt(add_hash_statment(add_hash))); new_items.push(ModuleItem::Stmt(add_hash_statement(add_hash)));
} }
} }
if !is_styled_css_import(&new_item) { if !is_styled_css_import(&new_item) {
new_items.push(new_item); new_items.push(new_item);
} }
if let Some(add_hash) = self.add_hash.take() { if let Some(add_hash) = self.add_hash.take() {
new_items.push(ModuleItem::Stmt(add_hash_statment(add_hash))); new_items.push(ModuleItem::Stmt(add_hash_statement(add_hash)));
} }
} }
...@@ -489,13 +488,12 @@ impl StyledJSXTransformer { ...@@ -489,13 +488,12 @@ impl StyledJSXTransformer {
StyleExpr::Ident(ident) => { StyleExpr::Ident(ident) => {
return JSXStyle::External(ExternalStyle { return JSXStyle::External(ExternalStyle {
expr: Expr::Member(MemberExpr { expr: Expr::Member(MemberExpr {
obj: ExprOrSuper::Expr(Box::new(Expr::Ident(ident.clone()))), obj: Box::new(Expr::Ident(ident.clone())),
prop: Box::new(Expr::Ident(Ident { prop: MemberProp::Ident(Ident {
sym: "__hash".into(), sym: "__hash".into(),
span: DUMMY_SP, span: DUMMY_SP,
optional: false, optional: false,
})), }),
computed: false,
span: DUMMY_SP, span: DUMMY_SP,
}), }),
identifier: ident.clone(), identifier: ident.clone(),
...@@ -571,13 +569,10 @@ impl StyledJSXTransformer { ...@@ -571,13 +569,10 @@ impl StyledJSXTransformer {
compute_class_names(&styles, &self.style_import_name.as_ref().unwrap()); compute_class_names(&styles, &self.style_import_name.as_ref().unwrap());
let tag = match &*tagged_tpl.tag { let tag = match &*tagged_tpl.tag {
Expr::Ident(Ident { sym, .. }) => sym.to_string(), Expr::Ident(Ident { sym, .. }) => sym.to_string(),
Expr::Member(MemberExpr { prop, .. }) => { Expr::Member(MemberExpr {
if let Expr::Ident(Ident { sym, .. }) = &**prop { prop: MemberProp::Ident(Ident { sym, .. }),
sym.to_string() ..
} else { }) => sym.to_string(),
String::from("not_styled_jsx_tag")
}
}
_ => String::from("not_styled_jsx_tag"), _ => String::from("not_styled_jsx_tag"),
}; };
let style = if let JSXStyle::Local(style) = &styles[0] { let style = if let JSXStyle::Local(style) = &styles[0] {
...@@ -809,10 +804,9 @@ fn get_existing_class_name(el: &JSXOpeningElement) -> (Option<Expr>, Option<usiz ...@@ -809,10 +804,9 @@ fn get_existing_class_name(el: &JSXOpeningElement) -> (Option<Expr>, Option<usiz
if valid_spread { if valid_spread {
let member_dot_name = Expr::Member(MemberExpr { let member_dot_name = Expr::Member(MemberExpr {
obj: ExprOrSuper::Expr(Box::new(*expr.clone())), obj: Box::new(*expr.clone()),
prop: Box::new(Expr::Ident(ident("className"))), prop: MemberProp::Ident(ident("className")),
span: DUMMY_SP, span: DUMMY_SP,
computed: false,
}); });
// `${name} && ${name}.className != null && ${name}.className` // `${name} && ${name}.className != null && ${name}.className`
spreads.push(and( spreads.push(and(
...@@ -869,22 +863,21 @@ fn join_spreads(spreads: Vec<Expr>) -> Expr { ...@@ -869,22 +863,21 @@ fn join_spreads(spreads: Vec<Expr>) -> Expr {
new_expr new_expr
} }
fn add_hash_statment((id, hash): (Id, String)) -> Stmt { fn add_hash_statement((id, hash): (Id, String)) -> Stmt {
Stmt::Expr(ExprStmt { Stmt::Expr(ExprStmt {
expr: Box::new(Expr::Assign(AssignExpr { expr: Box::new(Expr::Assign(AssignExpr {
left: PatOrExpr::Expr(Box::new(Expr::Member(MemberExpr { left: PatOrExpr::Expr(Box::new(Expr::Member(MemberExpr {
obj: ExprOrSuper::Expr(Box::new(Expr::Ident(Ident { obj: Box::new(Expr::Ident(Ident {
sym: id.0, sym: id.0,
span: DUMMY_SP.with_ctxt(id.1), span: DUMMY_SP.with_ctxt(id.1),
optional: false, optional: false,
}))), })),
prop: Box::new(Expr::Ident(Ident { prop: MemberProp::Ident(Ident {
sym: "__hash".into(), sym: "__hash".into(),
span: DUMMY_SP, span: DUMMY_SP,
optional: false, optional: false,
})), }),
span: DUMMY_SP, span: DUMMY_SP,
computed: false,
}))), }))),
right: Box::new(string_literal_expr(&hash)), right: Box::new(string_literal_expr(&hash)),
op: op!("="), op: op!("="),
......
...@@ -68,19 +68,18 @@ pub fn compute_class_names( ...@@ -68,19 +68,18 @@ pub fn compute_class_names(
let dynamic_class_name = match dynamic_styles.len() { let dynamic_class_name = match dynamic_styles.len() {
0 => None, 0 => None,
_ => Some(Expr::Call(CallExpr { _ => Some(Expr::Call(CallExpr {
callee: ExprOrSuper::Expr(Box::new(Expr::Member(MemberExpr { callee: Callee::Expr(Box::new(Expr::Member(MemberExpr {
obj: ExprOrSuper::Expr(Box::new(Expr::Ident(Ident { obj: Box::new(Expr::Ident(Ident {
sym: style_import_name.into(), sym: style_import_name.into(),
span: DUMMY_SP, span: DUMMY_SP,
optional: false, optional: false,
}))), })),
prop: Box::new(Expr::Ident(Ident { prop: MemberProp::Ident(Ident {
sym: "dynamic".into(), sym: "dynamic".into(),
span: DUMMY_SP, span: DUMMY_SP,
optional: false, optional: false,
})), }),
span: DUMMY_SP, span: DUMMY_SP,
computed: false,
}))), }))),
args: vec![ExprOrSpread { args: vec![ExprOrSpread {
expr: Box::new(Expr::Array(ArrayLit { expr: Box::new(Expr::Array(ArrayLit {
......
...@@ -23,7 +23,7 @@ export const Test2 = ()=><div className={"jsx-81a68341e430a972 " + `jsx-${styles ...@@ -23,7 +23,7 @@ export const Test2 = ()=><div className={"jsx-81a68341e430a972 " + `jsx-${styles
; ;
export const Test3 = ({ color })=><div className={`jsx-${styles.__hash}` + " " + _JSXStyle.dynamic([ export const Test3 = ({ color })=><div className={`jsx-${styles.__hash}` + " " + _JSXStyle.dynamic([
[ [
"5cadd6714ea141b4", "332b21af86b0ec6",
[ [
color color
] ]
...@@ -32,14 +32,14 @@ export const Test3 = ({ color })=><div className={`jsx-${styles.__hash}` + " " ...@@ -32,14 +32,14 @@ export const Test3 = ({ color })=><div className={`jsx-${styles.__hash}` + " "
<p className={`jsx-${styles.__hash}` + " " + _JSXStyle.dynamic([ <p className={`jsx-${styles.__hash}` + " " + _JSXStyle.dynamic([
[ [
"5cadd6714ea141b4", "332b21af86b0ec6",
[ [
color color
] ]
] ]
])}>external and dynamic</p> ])}>external and dynamic</p>
<_JSXStyle id={"5cadd6714ea141b4"} dynamic={[ <_JSXStyle id={"332b21af86b0ec6"} dynamic={[
color color
]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle> ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle>
...@@ -49,7 +49,7 @@ export const Test3 = ({ color })=><div className={`jsx-${styles.__hash}` + " " ...@@ -49,7 +49,7 @@ export const Test3 = ({ color })=><div className={`jsx-${styles.__hash}` + " "
; ;
export const Test4 = ({ color })=><div className={`jsx-${styles.__hash}` + " jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([ export const Test4 = ({ color })=><div className={`jsx-${styles.__hash}` + " jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
[ [
"8f336bc49da94d3f", "ec8f36d08fa7aa2c",
[ [
color color
] ]
...@@ -58,7 +58,7 @@ export const Test4 = ({ color })=><div className={`jsx-${styles.__hash}` + " js ...@@ -58,7 +58,7 @@ export const Test4 = ({ color })=><div className={`jsx-${styles.__hash}` + " js
<p className={`jsx-${styles.__hash}` + " jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([ <p className={`jsx-${styles.__hash}` + " jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
[ [
"8f336bc49da94d3f", "ec8f36d08fa7aa2c",
[ [
color color
] ]
...@@ -67,7 +67,7 @@ export const Test4 = ({ color })=><div className={`jsx-${styles.__hash}` + " js ...@@ -67,7 +67,7 @@ export const Test4 = ({ color })=><div className={`jsx-${styles.__hash}` + " js
<_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-ceba8c9ce34e3d0c{display:inline-block}"}</_JSXStyle> <_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-ceba8c9ce34e3d0c{display:inline-block}"}</_JSXStyle>
<_JSXStyle id={"8f336bc49da94d3f"} dynamic={[ <_JSXStyle id={"ec8f36d08fa7aa2c"} dynamic={[
color color
]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle> ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle>
...@@ -87,7 +87,7 @@ export const Test5 = ()=><div className={"jsx-df0159ebd3f9fb6f"}> ...@@ -87,7 +87,7 @@ export const Test5 = ()=><div className={"jsx-df0159ebd3f9fb6f"}>
; ;
export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([ export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
[ [
"8f336bc49da94d3f", "ec8f36d08fa7aa2c",
[ [
color color
] ]
...@@ -96,7 +96,7 @@ export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JS ...@@ -96,7 +96,7 @@ export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JS
<p className={"jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([ <p className={"jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
[ [
"8f336bc49da94d3f", "ec8f36d08fa7aa2c",
[ [
color color
] ]
...@@ -105,7 +105,7 @@ export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JS ...@@ -105,7 +105,7 @@ export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JS
<_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-ceba8c9ce34e3d0c{display:inline-block}"}</_JSXStyle> <_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-ceba8c9ce34e3d0c{display:inline-block}"}</_JSXStyle>
<_JSXStyle id={"8f336bc49da94d3f"} dynamic={[ <_JSXStyle id={"ec8f36d08fa7aa2c"} dynamic={[
color color
]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle> ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle>
...@@ -113,7 +113,7 @@ export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JS ...@@ -113,7 +113,7 @@ export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JS
; ;
export const Test7 = ({ color })=><div className={_JSXStyle.dynamic([ export const Test7 = ({ color })=><div className={_JSXStyle.dynamic([
[ [
"5cadd6714ea141b4", "332b21af86b0ec6",
[ [
color color
] ]
...@@ -122,14 +122,14 @@ export const Test7 = ({ color })=><div className={_JSXStyle.dynamic([ ...@@ -122,14 +122,14 @@ export const Test7 = ({ color })=><div className={_JSXStyle.dynamic([
<p className={_JSXStyle.dynamic([ <p className={_JSXStyle.dynamic([
[ [
"5cadd6714ea141b4", "332b21af86b0ec6",
[ [
color color
] ]
] ]
])}>dynamic only</p> ])}>dynamic only</p>
<_JSXStyle id={"5cadd6714ea141b4"} dynamic={[ <_JSXStyle id={"332b21af86b0ec6"} dynamic={[
color color
]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle> ]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle>
...@@ -142,7 +142,7 @@ export const Test8 = ({ color })=>{ ...@@ -142,7 +142,7 @@ export const Test8 = ({ color })=>{
}; };
return <div className={_JSXStyle.dynamic([ return <div className={_JSXStyle.dynamic([
[ [
"6e7028e37f6f2a1c", "c37e7ca12a9fbc5b",
[ [
innerProps.color innerProps.color
] ]
...@@ -151,14 +151,14 @@ export const Test8 = ({ color })=>{ ...@@ -151,14 +151,14 @@ export const Test8 = ({ color })=>{
<p className={_JSXStyle.dynamic([ <p className={_JSXStyle.dynamic([
[ [
"6e7028e37f6f2a1c", "c37e7ca12a9fbc5b",
[ [
innerProps.color innerProps.color
] ]
] ]
])}>dynamic with scoped compound variable</p> ])}>dynamic with scoped compound variable</p>
<_JSXStyle id={"6e7028e37f6f2a1c"} dynamic={[ <_JSXStyle id={"c37e7ca12a9fbc5b"} dynamic={[
innerProps.color innerProps.color
]}>{`p.__jsx-style-dynamic-selector{color:${innerProps.color}}`}</_JSXStyle> ]}>{`p.__jsx-style-dynamic-selector{color:${innerProps.color}}`}</_JSXStyle>
...@@ -171,7 +171,7 @@ export const Test9 = ({ color })=>{ ...@@ -171,7 +171,7 @@ export const Test9 = ({ color })=>{
}; };
return <div className={_JSXStyle.dynamic([ return <div className={_JSXStyle.dynamic([
[ [
"33344a45c20c74fe", "59d22b990ceca2d7",
[ [
innerProps.color innerProps.color
] ]
...@@ -180,25 +180,25 @@ export const Test9 = ({ color })=>{ ...@@ -180,25 +180,25 @@ export const Test9 = ({ color })=>{
<p className={_JSXStyle.dynamic([ <p className={_JSXStyle.dynamic([
[ [
"33344a45c20c74fe", "59d22b990ceca2d7",
[ [
innerProps.color innerProps.color
] ]
] ]
])}>dynamic with compound variable</p> ])}>dynamic with compound variable</p>
<_JSXStyle id={"33344a45c20c74fe"} dynamic={[ <_JSXStyle id={"59d22b990ceca2d7"} dynamic={[
innerProps.color innerProps.color
]}>{`p.__jsx-style-dynamic-selector{color:${innerProps.color}}`}</_JSXStyle> ]}>{`p.__jsx-style-dynamic-selector{color:${innerProps.color}}`}</_JSXStyle>
</div>; </div>;
}; };
const foo = "red"; const foo = "red";
export const Test10 = ()=><div className={"jsx-e993bec5c22e1b75"}> export const Test10 = ()=><div className={"jsx-64eb0b4e09da0dd3"}>
<p className={"jsx-e993bec5c22e1b75"}>dynamic with constant variable</p> <p className={"jsx-64eb0b4e09da0dd3"}>dynamic with constant variable</p>
<_JSXStyle id={"e993bec5c22e1b75"}>{`p.jsx-e993bec5c22e1b75{color:${foo}}`}</_JSXStyle> <_JSXStyle id={"64eb0b4e09da0dd3"}>{`p.jsx-64eb0b4e09da0dd3{color:${foo}}`}</_JSXStyle>
</div> </div>
; ;
...@@ -207,14 +207,14 @@ export const Test11 = ({ color })=>{ ...@@ -207,14 +207,14 @@ export const Test11 = ({ color })=>{
length: 5 length: 5
}).map((item, i)=><li key={i} className={_JSXStyle.dynamic([ }).map((item, i)=><li key={i} className={_JSXStyle.dynamic([
[ [
"5dc7166977a4514", "93933d24284432d0",
[ [
color color
] ]
] ]
]) + " " + "item"}> ]) + " " + "item"}>
<_JSXStyle id={"5dc7166977a4514"} dynamic={[ <_JSXStyle id={"93933d24284432d0"} dynamic={[
color color
]}>{`.item.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle> ]}>{`.item.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle>
......
import _JSXStyle from "styled-jsx/style"; import _JSXStyle from "styled-jsx/style";
const color = "red"; const color = "red";
const otherColor = "green"; const otherColor = "green";
const A = ()=><div className={"jsx-f44d626e14f3cfbc"}> const A = ()=><div className={"jsx-319ecfcffea32bfb"}>
<p className={"jsx-f44d626e14f3cfbc"}>test</p> <p className={"jsx-319ecfcffea32bfb"}>test</p>
<_JSXStyle id={"f44d626e14f3cfbc"}>{`p.jsx-f44d626e14f3cfbc{color:${color}}`}</_JSXStyle> <_JSXStyle id={"319ecfcffea32bfb"}>{`p.jsx-319ecfcffea32bfb{color:${color}}`}</_JSXStyle>
</div> </div>
; ;
const B = ()=><div className={"jsx-9db1df72abe82640"}> const B = ()=><div className={"jsx-8a19b9bd65b986e0"}>
<p className={"jsx-9db1df72abe82640"}>test</p> <p className={"jsx-8a19b9bd65b986e0"}>test</p>
<_JSXStyle id={"9db1df72abe82640"}>{`p.jsx-9db1df72abe82640{color:${otherColor}}`}</_JSXStyle> <_JSXStyle id={"8a19b9bd65b986e0"}>{`p.jsx-8a19b9bd65b986e0{color:${otherColor}}`}</_JSXStyle>
</div> </div>
; ;
......
...@@ -9,85 +9,85 @@ const animationName = "my-cool-animation"; ...@@ -9,85 +9,85 @@ const animationName = "my-cool-animation";
const obj = { const obj = {
display: "block" display: "block"
}; };
export default (({ display })=><div className={"jsx-843124768056a74c " + _JSXStyle.dynamic([ export default (({ display })=><div className={"jsx-1ada4ad4dab7822f " + _JSXStyle.dynamic([
[ [
"a124d516c2c0707d", "183a75aa3877c18a",
[ [
display ? "block" : "none" display ? "block" : "none"
] ]
], ],
[ [
"108a316873f1c6fc", "f07deae908c9294f",
[ [
darken(color) + 2 darken(color) + 2
] ]
], ],
[ [
"785cf5e120672da8", "50021e09364b96c8",
[ [
darken(color) darken(color)
] ]
] ]
])}> ])}>
<p className={"jsx-843124768056a74c " + _JSXStyle.dynamic([ <p className={"jsx-1ada4ad4dab7822f " + _JSXStyle.dynamic([
[ [
"a124d516c2c0707d", "183a75aa3877c18a",
[ [
display ? "block" : "none" display ? "block" : "none"
] ]
], ],
[ [
"108a316873f1c6fc", "f07deae908c9294f",
[ [
darken(color) + 2 darken(color) + 2
] ]
], ],
[ [
"785cf5e120672da8", "50021e09364b96c8",
[ [
darken(color) darken(color)
] ]
] ]
])}>test</p> ])}>test</p>
<_JSXStyle id={"5df43f2861c900e6"}>{`p.${color}.jsx-843124768056a74c{color:${otherColor}; <_JSXStyle id={"6116059e04f3bff7"}>{`p.${color}.jsx-1ada4ad4dab7822f{color:${otherColor};
display:${obj.display}}`}</_JSXStyle> display:${obj.display}}`}</_JSXStyle>
<_JSXStyle id={"94239b6d6b42c9b5"}>{"p.jsx-843124768056a74c{color:red}"}</_JSXStyle> <_JSXStyle id={"94239b6d6b42c9b5"}>{"p.jsx-1ada4ad4dab7822f{color:red}"}</_JSXStyle>
<_JSXStyle id={"a971cf00393d41be"}>{`body{background:${color}}`}</_JSXStyle> <_JSXStyle id={"171303fb0d7f788b"}>{`body{background:${color}}`}</_JSXStyle>
<_JSXStyle id={"a971cf00393d41be"}>{`body{background:${color}}`}</_JSXStyle> <_JSXStyle id={"171303fb0d7f788b"}>{`body{background:${color}}`}</_JSXStyle>
// TODO: the next two should have the same hash // TODO: the next two should have the same hash
<_JSXStyle id={"5cadd6714ea141b4"}>{`p.jsx-843124768056a74c{color:${color}}`}</_JSXStyle> <_JSXStyle id={"332b21af86b0ec6"}>{`p.jsx-1ada4ad4dab7822f{color:${color}}`}</_JSXStyle>
<_JSXStyle id={"5cadd6714ea141b4"}>{`p.jsx-843124768056a74c{color:${color}}`}</_JSXStyle> <_JSXStyle id={"332b21af86b0ec6"}>{`p.jsx-1ada4ad4dab7822f{color:${color}}`}</_JSXStyle>
<_JSXStyle id={"785cf5e120672da8"} dynamic={[ <_JSXStyle id={"50021e09364b96c8"} dynamic={[
darken(color) darken(color)
]}>{`p.__jsx-style-dynamic-selector{color:${darken(color)}}`}</_JSXStyle> ]}>{`p.__jsx-style-dynamic-selector{color:${darken(color)}}`}</_JSXStyle>
<_JSXStyle id={"108a316873f1c6fc"} dynamic={[ <_JSXStyle id={"f07deae908c9294f"} dynamic={[
darken(color) + 2 darken(color) + 2
]}>{`p.__jsx-style-dynamic-selector{color:${darken(color) + 2}}`}</_JSXStyle> ]}>{`p.__jsx-style-dynamic-selector{color:${darken(color) + 2}}`}</_JSXStyle>
<_JSXStyle id={"bb5a8a5ee5cd36db"}>{`@media (min-width:${mediumScreen}) {p.jsx-843124768056a74c{color:green} <_JSXStyle id={"4e4be2da62837c76"}>{`@media (min-width:${mediumScreen}) {p.jsx-1ada4ad4dab7822f{color:green}
p.jsx-843124768056a74c{color:${`red`}}} p.jsx-1ada4ad4dab7822f{color:${`red`}}}
p.jsx-843124768056a74c{color:red}`}</_JSXStyle> p.jsx-1ada4ad4dab7822f{color:red}`}</_JSXStyle>
<_JSXStyle id={"99746edba785c617"}>{`p.jsx-843124768056a74c{-webkit-animation-duration:${animationDuration}; <_JSXStyle id={"27040f0829fb73d4"}>{`p.jsx-1ada4ad4dab7822f{-webkit-animation-duration:${animationDuration};
animation-duration:${animationDuration}}`}</_JSXStyle> animation-duration:${animationDuration}}`}</_JSXStyle>
<_JSXStyle id={"62d69d091a270e9d"}>{`p.jsx-843124768056a74c{-webkit-animation:${animationDuration} forwards ${animationName}; <_JSXStyle id={"3e72d735e703a530"}>{`p.jsx-1ada4ad4dab7822f{-webkit-animation:${animationDuration} forwards ${animationName};
animation:${animationDuration} forwards ${animationName}} animation:${animationDuration} forwards ${animationName}}
div.jsx-843124768056a74c{background:${color}}`}</_JSXStyle> div.jsx-1ada4ad4dab7822f{background:${color}}`}</_JSXStyle>
<_JSXStyle id={"a124d516c2c0707d"} dynamic={[ <_JSXStyle id={"183a75aa3877c18a"} dynamic={[
display ? "block" : "none" display ? "block" : "none"
]}>{`span.__jsx-style-dynamic-selector{display:${display ? "block" : "none"}}`}</_JSXStyle> ]}>{`span.__jsx-style-dynamic-selector{display:${display ? "block" : "none"}}`}</_JSXStyle>
......
import _JSXStyle from "styled-jsx/style"; import _JSXStyle from "styled-jsx/style";
export default (({ breakPoint })=><div className={_JSXStyle.dynamic([ export default (({ breakPoint })=><div className={_JSXStyle.dynamic([
[ [
"6b843a9852a4be26", "42a6f8ca08e1a043",
[ [
breakPoint breakPoint
] ]
] ]
])}> ])}>
<_JSXStyle id={"6b843a9852a4be26"} dynamic={[ <_JSXStyle id={"42a6f8ca08e1a043"} dynamic={[
breakPoint breakPoint
]}>{`@media (${breakPoint}) {}`}</_JSXStyle> ]}>{`@media (${breakPoint}) {}`}</_JSXStyle>
......
...@@ -3,7 +3,7 @@ export default class { ...@@ -3,7 +3,7 @@ export default class {
render() { render() {
return <div className={_JSXStyle.dynamic([ return <div className={_JSXStyle.dynamic([
[ [
"a876575397b32eda", "5bbb77b0f67942dc",
[ [
Typography.base.size.default, Typography.base.size.default,
Typography.base.lineHeight, Typography.base.lineHeight,
...@@ -17,7 +17,7 @@ export default class { ...@@ -17,7 +17,7 @@ export default class {
<p className={_JSXStyle.dynamic([ <p className={_JSXStyle.dynamic([
[ [
"a876575397b32eda", "5bbb77b0f67942dc",
[ [
Typography.base.size.default, Typography.base.size.default,
Typography.base.lineHeight, Typography.base.lineHeight,
...@@ -29,7 +29,7 @@ export default class { ...@@ -29,7 +29,7 @@ export default class {
] ]
])}>test</p> ])}>test</p>
<_JSXStyle id={"a876575397b32eda"} dynamic={[ <_JSXStyle id={"5bbb77b0f67942dc"} dynamic={[
Typography.base.size.default, Typography.base.size.default,
Typography.base.lineHeight, Typography.base.lineHeight,
Target.mediumPlus, Target.mediumPlus,
......
import _JSXStyle from "styled-jsx/style"; import _JSXStyle from "styled-jsx/style";
import Link from "next/link"; import Link from "next/link";
export default function IndexPage() { export default function IndexPage() {
return <div className={"jsx-bc8a8bae32099ce8"}> return <div className={"jsx-b642661fd6426842"}>
Hello World.{" "} Hello World.{" "}
<Link href="/about"> <Link href="/about">
<a className={"jsx-bc8a8bae32099ce8"}>Abound</a> <a className={"jsx-b642661fd6426842"}>Abound</a>
</Link> </Link>
<_JSXStyle id={"bc8a8bae32099ce8"}>{`a.jsx-bc8a8bae32099ce8{color:${"#abcdef"}12}`}</_JSXStyle> <_JSXStyle id={"b642661fd6426842"}>{`a.jsx-b642661fd6426842{color:${"#abcdef"}12}`}</_JSXStyle>
</div>; </div>;
}; };
...@@ -6,29 +6,29 @@ bar.__hash = "aaed0341accea8f"; ...@@ -6,29 +6,29 @@ bar.__hash = "aaed0341accea8f";
const baz = new String("div{font-size:3em}"); const baz = new String("div{font-size:3em}");
baz.__hash = "aaed0341accea8f"; baz.__hash = "aaed0341accea8f";
const a = new String(`div{font-size:${size}em}`); const a = new String(`div{font-size:${size}em}`);
a.__hash = "f14cced97c082d2c"; a.__hash = "5ba1fcb8b8f3d807";
export const uh = bar; export const uh = bar;
export const foo = new String(`div.jsx-a0d126276b085021{color:${color}}`); export const foo = new String(`div.jsx-945eaa83250ed332{color:${color}}`);
foo.__hash = "a0d126276b085021"; foo.__hash = "945eaa83250ed332";
({ ({
styles: <_JSXStyle id={"47e08c293b53f262"}>{`div.jsx-47e08c293b53f262{color:${colors.green.light}} styles: <_JSXStyle id={"c107a919a5b2943d"}>{`div.jsx-c107a919a5b2943d{color:${colors.green.light}}
a.jsx-47e08c293b53f262{color:red}`}</_JSXStyle>, a.jsx-c107a919a5b2943d{color:red}`}</_JSXStyle>,
className: "jsx-47e08c293b53f262" className: "jsx-c107a919a5b2943d"
}); });
const b = { const b = {
styles: <_JSXStyle id={"47e08c293b53f262"}>{`div.jsx-47e08c293b53f262{color:${colors.green.light}} styles: <_JSXStyle id={"c107a919a5b2943d"}>{`div.jsx-c107a919a5b2943d{color:${colors.green.light}}
a.jsx-47e08c293b53f262{color:red}`}</_JSXStyle>, a.jsx-c107a919a5b2943d{color:red}`}</_JSXStyle>,
className: "jsx-47e08c293b53f262" className: "jsx-c107a919a5b2943d"
}; };
const dynamic = (colors1)=>{ const dynamic = (colors1)=>{
const b = { const b = {
styles: <_JSXStyle id={"79d79305fa1611e"} dynamic={[ styles: <_JSXStyle id={"60132422fc87f1d1"} dynamic={[
colors1.green.light colors1.green.light
]}>{`div.__jsx-style-dynamic-selector{color:${colors1.green.light}} ]}>{`div.__jsx-style-dynamic-selector{color:${colors1.green.light}}
a.__jsx-style-dynamic-selector{color:red}`}</_JSXStyle>, a.__jsx-style-dynamic-selector{color:red}`}</_JSXStyle>,
className: _JSXStyle.dynamic([ className: _JSXStyle.dynamic([
[ [
"79d79305fa1611e", "60132422fc87f1d1",
[ [
colors1.green.light colors1.green.light
] ]
...@@ -37,7 +37,7 @@ a.__jsx-style-dynamic-selector{color:red}`}</_JSXStyle>, ...@@ -37,7 +37,7 @@ a.__jsx-style-dynamic-selector{color:red}`}</_JSXStyle>,
}; };
}; };
export default { export default {
styles: <_JSXStyle id={"d9cea503e39c5315"}>{`div.jsx-d9cea503e39c5315{font-size:3em} styles: <_JSXStyle id={"e5da8dd7ff5c7f39"}>{`div.jsx-e5da8dd7ff5c7f39{font-size:3em}
p.jsx-d9cea503e39c5315{color:${color}}`}</_JSXStyle>, p.jsx-e5da8dd7ff5c7f39{color:${color}}`}</_JSXStyle>,
className: "jsx-d9cea503e39c5315" className: "jsx-e5da8dd7ff5c7f39"
}; };
...@@ -2,7 +2,7 @@ import _JSXStyle from "styled-jsx/style"; ...@@ -2,7 +2,7 @@ import _JSXStyle from "styled-jsx/style";
export const Red = ({ Component ="button" })=>{ export const Red = ({ Component ="button" })=>{
return <Component className={_JSXStyle.dynamic([ return <Component className={_JSXStyle.dynamic([
[ [
"ab280f80c0d19763", "ca900d186ad0e495",
[ [
e1, e1,
e2, e2,
...@@ -27,7 +27,7 @@ export const Red = ({ Component ="button" })=>{ ...@@ -27,7 +27,7 @@ export const Red = ({ Component ="button" })=>{
{} {}
<_JSXStyle id={"ab280f80c0d19763"} dynamic={[ <_JSXStyle id={"ca900d186ad0e495"} dynamic={[
e1, e1,
e2, e2,
e3, e3,
......
...@@ -2,14 +2,14 @@ import _JSXStyle from "styled-jsx/style"; ...@@ -2,14 +2,14 @@ import _JSXStyle from "styled-jsx/style";
export default function Home({ fontFamily }) { export default function Home({ fontFamily }) {
return <div className={_JSXStyle.dynamic([ return <div className={_JSXStyle.dynamic([
[ [
"d64fed44dbc5d8df", "f804e2f486b6ac13",
[ [
fontFamily fontFamily
] ]
] ]
])}> ])}>
<_JSXStyle id={"d64fed44dbc5d8df"} dynamic={[ <_JSXStyle id={"f804e2f486b6ac13"} dynamic={[
fontFamily fontFamily
]}>{`body{font-family:${fontFamily}} ]}>{`body{font-family:${fontFamily}}
code:before, code:after{content:'\`'}`}</_JSXStyle> code:before, code:after{content:'\`'}`}</_JSXStyle>
......
...@@ -3,7 +3,7 @@ export default class { ...@@ -3,7 +3,7 @@ export default class {
render() { render() {
return <div className={_JSXStyle.dynamic([ return <div className={_JSXStyle.dynamic([
[ [
"8c1103276226be14", "e359801ddd3b3cb6",
[ [
inputSize ? "height: calc(2 * var(--a)) !important;" : "" inputSize ? "height: calc(2 * var(--a)) !important;" : ""
] ]
...@@ -12,14 +12,14 @@ export default class { ...@@ -12,14 +12,14 @@ export default class {
<p className={_JSXStyle.dynamic([ <p className={_JSXStyle.dynamic([
[ [
"8c1103276226be14", "e359801ddd3b3cb6",
[ [
inputSize ? "height: calc(2 * var(--a)) !important;" : "" inputSize ? "height: calc(2 * var(--a)) !important;" : ""
] ]
] ]
])}>test</p> ])}>test</p>
<_JSXStyle id={"8c1103276226be14"} dynamic={[ <_JSXStyle id={"e359801ddd3b3cb6"} dynamic={[
inputSize ? "height: calc(2 * var(--a)) !important;" : "" inputSize ? "height: calc(2 * var(--a)) !important;" : ""
]}>{`@media only screen {a.__jsx-style-dynamic-selector{${inputSize ? "height: calc(2 * var(--a)) !important;" : ""} ]}>{`@media only screen {a.__jsx-style-dynamic-selector{${inputSize ? "height: calc(2 * var(--a)) !important;" : ""}
}}`}</_JSXStyle> }}`}</_JSXStyle>
......
...@@ -3,7 +3,7 @@ export default class { ...@@ -3,7 +3,7 @@ export default class {
render() { render() {
return <div className={_JSXStyle.dynamic([ return <div className={_JSXStyle.dynamic([
[ [
"1a8c0e5c60018729", "1a799d9370a3a386",
[ [
a[b], a[b],
-1 * (c || 0), -1 * (c || 0),
...@@ -14,7 +14,7 @@ export default class { ...@@ -14,7 +14,7 @@ export default class {
<p className={_JSXStyle.dynamic([ <p className={_JSXStyle.dynamic([
[ [
"1a8c0e5c60018729", "1a799d9370a3a386",
[ [
a[b], a[b],
-1 * (c || 0), -1 * (c || 0),
...@@ -23,7 +23,7 @@ export default class { ...@@ -23,7 +23,7 @@ export default class {
] ]
])}>test</p> ])}>test</p>
<_JSXStyle id={"1a8c0e5c60018729"} dynamic={[ <_JSXStyle id={"1a799d9370a3a386"} dynamic={[
a[b], a[b],
-1 * (c || 0), -1 * (c || 0),
d d
......
...@@ -3,7 +3,7 @@ export default class { ...@@ -3,7 +3,7 @@ export default class {
render() { render() {
return <div className={_JSXStyle.dynamic([ return <div className={_JSXStyle.dynamic([
[ [
"1dd34a5c235f087f", "4ca4ef3595473f53",
[ [
a a
] ]
...@@ -12,14 +12,14 @@ export default class { ...@@ -12,14 +12,14 @@ export default class {
<p className={_JSXStyle.dynamic([ <p className={_JSXStyle.dynamic([
[ [
"1dd34a5c235f087f", "4ca4ef3595473f53",
[ [
a a
] ]
] ]
])}>test</p> ])}>test</p>
<_JSXStyle id={"1dd34a5c235f087f"} dynamic={[ <_JSXStyle id={"4ca4ef3595473f53"} dynamic={[
a a
]}>{`@media only screen {a.__jsx-style-dynamic-selector{color:${a}}}`}</_JSXStyle> ]}>{`@media only screen {a.__jsx-style-dynamic-selector{color:${a}}}`}</_JSXStyle>
......
...@@ -3,7 +3,7 @@ export default class { ...@@ -3,7 +3,7 @@ export default class {
render() { render() {
return <div className={_JSXStyle.dynamic([ return <div className={_JSXStyle.dynamic([
[ [
"35bb702eb335aa6f", "97886c1e9511aafa",
[ [
a || "var(--c)", a || "var(--c)",
b || "inherit" b || "inherit"
...@@ -13,7 +13,7 @@ export default class { ...@@ -13,7 +13,7 @@ export default class {
<p className={_JSXStyle.dynamic([ <p className={_JSXStyle.dynamic([
[ [
"35bb702eb335aa6f", "97886c1e9511aafa",
[ [
a || "var(--c)", a || "var(--c)",
b || "inherit" b || "inherit"
...@@ -21,7 +21,7 @@ export default class { ...@@ -21,7 +21,7 @@ export default class {
] ]
])}>test</p> ])}>test</p>
<_JSXStyle id={"35bb702eb335aa6f"} dynamic={[ <_JSXStyle id={"97886c1e9511aafa"} dynamic={[
a || "var(--c)", a || "var(--c)",
b || "inherit" b || "inherit"
]}>{`.a:hover .b.__jsx-style-dynamic-selector{display:inline-block; ]}>{`.a:hover .b.__jsx-style-dynamic-selector{display:inline-block;
......
...@@ -3,7 +3,7 @@ export default class { ...@@ -3,7 +3,7 @@ export default class {
render() { render() {
return <div className={_JSXStyle.dynamic([ return <div className={_JSXStyle.dynamic([
[ [
"21ae2868f133bbf6", "bcc606c168bcd197",
[ [
a ? "100%" : "200px", a ? "100%" : "200px",
b ? "0" : "8px 20px" b ? "0" : "8px 20px"
...@@ -13,7 +13,7 @@ export default class { ...@@ -13,7 +13,7 @@ export default class {
<p className={_JSXStyle.dynamic([ <p className={_JSXStyle.dynamic([
[ [
"21ae2868f133bbf6", "bcc606c168bcd197",
[ [
a ? "100%" : "200px", a ? "100%" : "200px",
b ? "0" : "8px 20px" b ? "0" : "8px 20px"
...@@ -21,7 +21,7 @@ export default class { ...@@ -21,7 +21,7 @@ export default class {
] ]
])}>test</p> ])}>test</p>
<_JSXStyle id={"21ae2868f133bbf6"} dynamic={[ <_JSXStyle id={"bcc606c168bcd197"} dynamic={[
a ? "100%" : "200px", a ? "100%" : "200px",
b ? "0" : "8px 20px" b ? "0" : "8px 20px"
]}>{`.item.__jsx-style-dynamic-selector{max-width:${a ? "100%" : "200px"}; ]}>{`.item.__jsx-style-dynamic-selector{max-width:${a ? "100%" : "200px"};
......
...@@ -16,12 +16,12 @@ once_cell = "1.8.0" ...@@ -16,12 +16,12 @@ once_cell = "1.8.0"
serde = "1" serde = "1"
serde_json = "1" serde_json = "1"
next-swc = { version = "0.0.0", path = "../core" } next-swc = { version = "0.0.0", path = "../core" }
swc = "0.110.0" swc = "0.114.0"
swc_atoms = "0.2.7" swc_atoms = "0.2.7"
swc_bundler = { version = "0.98.0", features = ["concurrent"] } swc_bundler = { version = "0.101.0", features = ["concurrent"] }
swc_common = { version = "0.16.0", features = ["concurrent", "sourcemap"] } swc_common = { version = "0.17.0", features = ["concurrent", "sourcemap"] }
swc_ecma_loader = { version = "0.26.0", features = ["node", "lru"] } swc_ecma_loader = { version = "0.27.0", features = ["node", "lru"] }
swc_ecmascript = { version = "0.105.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_ecmascript = { version = "0.108.1", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_node_base = "0.5.1" swc_node_base = "0.5.1"
[build-dependencies] [build-dependencies]
......
...@@ -16,9 +16,9 @@ path-clean = "0.1" ...@@ -16,9 +16,9 @@ path-clean = "0.1"
serde = {version = "1", features = ["derive"]} serde = {version = "1", features = ["derive"]}
serde_json = "1" serde_json = "1"
next-swc = { version = "0.0.0", path = "../core" } next-swc = { version = "0.0.0", path = "../core" }
swc = "0.110.0" swc = "0.114.0"
swc_common = { version = "0.16.0", features = ["concurrent", "sourcemap"] } swc_common = { version = "0.17.0", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.105.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] } swc_ecmascript = { version = "0.108.1", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
tracing = {version = "0.1.28", features = ["release_max_level_off"]} tracing = {version = "0.1.28", features = ["release_max_level_off"]}
wasm-bindgen = {version = "0.2", features = ["serde-serialize"]} wasm-bindgen = {version = "0.2", features = ["serde-serialize"]}
wasm-bindgen-futures = "0.4.8" wasm-bindgen-futures = "0.4.8"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment