Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
2c82615b
Unverified
Commit
2c82615b
authored
Sep 16, 2021
by
강동윤
Committed by
GitHub
Sep 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix transform of ` in styled-jsx (#29136)
parent
c7e187f8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
977 additions
and
924 deletions
+977
-924
Cargo.lock
packages/next/build/swc/Cargo.lock
+2
-2
mod.rs
packages/next/build/swc/src/styled_jsx/mod.rs
+658
-657
transform_css.rs
packages/next/build/swc/src/styled_jsx/transform_css.rs
+261
-263
fixture.rs
packages/next/build/swc/tests/fixture.rs
+2
-2
input.js
.../build/swc/tests/fixture/styled-jsx/tpl-escape-1/input.js
+14
-0
output.js
...build/swc/tests/fixture/styled-jsx/tpl-escape-1/output.js
+9
-0
input.js
.../build/swc/tests/fixture/styled-jsx/tpl-escape-2/input.js
+17
-0
output.js
...build/swc/tests/fixture/styled-jsx/tpl-escape-2/output.js
+14
-0
No files found.
packages/next/build/swc/Cargo.lock
View file @
2c82615b
...
...
@@ -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",
...
...
packages/next/build/swc/src/styled_jsx/mod.rs
View file @
2c82615b
This diff is collapsed.
Click to expand it.
packages/next/build/swc/src/styled_jsx/transform_css.rs
View file @
2c82615b
This diff is collapsed.
Click to expand it.
packages/next/build/swc/tests/fixture.rs
View file @
2c82615b
...
...
@@ -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
);
}
packages/next/build/swc/tests/fixture/styled-jsx/tpl-escape-1/input.js
0 → 100644
View file @
2c82615b
export
default
class
{
render
()
{
return
(
<
div
>
<
p
>
test
<
/p
>
<
style
jsx
>
{
`
p {
content: '\`'
}
`
}
<
/style
>
<
/div
>
)
}
}
packages/next/build/swc/tests/fixture/styled-jsx/tpl-escape-1/output.js
0 → 100644
View file @
2c82615b
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
packages/next/build/swc/tests/fixture/styled-jsx/tpl-escape-2/input.js
0 → 100644
View file @
2c82615b
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
packages/next/build/swc/tests/fixture/styled-jsx/tpl-escape-2/output.js
0 → 100644
View file @
2c82615b
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment