Unverified Commit 2c82615b authored by 강동윤's avatar 강동윤 Committed by GitHub

Fix transform of ` in styled-jsx (#29136)

parent c7e187f8
......@@ -1756,9 +1756,9 @@ dependencies = [
[[package]]
name = "swc_ecma_codegen"
version = "0.70.2"
version = "0.70.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7940bff62e5caf62fe6732ce4f07e52c3c208cb58cd9299f7f7c92dddab2bf72"
checksum = "bb2aca48c8369b19864bbf5ffb6a1e5e8784e451606c48c39f241a7da0751815"
dependencies = [
"bitflags",
"num-bigint",
......
......@@ -81,6 +81,6 @@ fn next_ssg_fixture(input: PathBuf) {
#[fixture("tests/fixture/styled-jsx/**/input.js")]
fn styled_jsx_fixture(input: PathBuf) {
let output = input.parent().unwrap().join("output.js");
test_fixture(syntax(), &|_tr| styled_jsx(), &input, &output);
let output = input.parent().unwrap().join("output.js");
test_fixture(syntax(), &|_tr| styled_jsx(), &input, &output);
}
export default class {
render() {
return (
<div>
<p>test</p>
<style jsx>{`
p {
content: '\`'
}
`}</style>
</div>
)
}
}
import _JSXStyle from "styled-jsx/style";
export default class {
render() {
return <div className={"jsx-1f6cef12199c3a8f"}>
<p className={"jsx-1f6cef12199c3a8f"}>test</p>
<_JSXStyle id={"1f6cef12199c3a8f"}>{"p.jsx-1f6cef12199c3a8f {content:'`'}"}</_JSXStyle>
</div>;
}
}
\ No newline at end of file
export default function Home({ fontFamily }) {
return (
<div>
<style jsx global>
{`
body {
font-family: ${fontFamily};
}
code:before,
code:after {
content: '\`';
}
`}
</style>
</div>
)
}
\ No newline at end of file
import _JSXStyle from "styled-jsx/style";
export default function Home({ fontFamily }) {
return <div className={_JSXStyle.dynamic([
"2566fdd7bc25c35",
[
fontFamily
]
])}>
<_JSXStyle id={"2566fdd7bc25c35"} dynamic={[
fontFamily
]}>{`body {font-family:${fontFamily}}
code:before, code:after {content:'\`'}`}</_JSXStyle>
</div>;
}
\ No newline at end of file
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