Skip to content

Commit df4e5e5

Browse files
authored
feat: remove babel jsesc workaround (#2)
1 parent 7a1bcff commit df4e5e5

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/react-compiler-loader.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@ export default async function reactCompilerLoader(this: webpack.LoaderContext<Re
2121
sourceFileName: this.resourcePath,
2222
filename: this.resourcePath,
2323
cloneInputAst: false,
24-
generatorOpts: {
25-
...babelTransFormOpt?.generatorOpts,
26-
// https://github.com/facebook/react/issues/29120
27-
// TODO: remove once React Compiler has provided their workaround
28-
jsescOption: {
29-
minimal: true,
30-
...babelTransFormOpt?.generatorOpts?.jsescOption
31-
}
32-
},
3324
// user configured babel option
3425
...babelTransFormOpt,
3526
// override babel plugins

test/__snapshots__/index.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function Comp() {
99
let t0;
1010
if ($[0] === Symbol.for(\\"react.memo_cache_sentinel\\")) {
1111
t0 = /*#__PURE__*/ _jsx(\\"div\\", {
12-
\\"aria-label\\": \\"我能吞下玻璃而不伤身体\\",
12+
\\"aria-label\\": \\"\\\\u6211\\\\u80FD\\\\u541E\\\\u4E0B\\\\u73BB\\\\u7483\\\\u800C\\\\u4E0D\\\\u4F24\\\\u8EAB\\\\u4F53\\",
1313
children: \\"我能吞下玻璃而不伤身体\\"
1414
});
1515
$[0] = t0;
@@ -165,7 +165,7 @@ export default function Comp() {
165165
let t0;
166166
if ($[0] === Symbol.for(\\"react.memo_cache_sentinel\\")) {
167167
t0 = /*#__PURE__*/ _jsx(\\"div\\", {
168-
\\"aria-label\\": \\"我能吞下玻璃而不伤身体\\",
168+
\\"aria-label\\": \\"\\\\u6211\\\\u80FD\\\\u541E\\\\u4E0B\\\\u73BB\\\\u7483\\\\u800C\\\\u4E0D\\\\u4F24\\\\u8EAB\\\\u4F53\\",
169169
children: \\"我能吞下玻璃而不伤身体\\"
170170
});
171171
$[0] = t0;

0 commit comments

Comments
 (0)