-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swc_ecma_codegen: - Check for comments deeply while emitting a return statement. swc_ecma_transforms_react: - Fix handling of texts in attributes.
- Loading branch information
Showing
15 changed files
with
137 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
ecmascript/transforms/react/tests/jsx/fixture/vercel/1/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default <A | ||
className={b} | ||
header="C" | ||
subheader="D | ||
E" | ||
/> |
5 changes: 5 additions & 0 deletions
5
ecmascript/transforms/react/tests/jsx/fixture/vercel/1/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default React.createElement(A, { | ||
className: b, | ||
header: "C", | ||
subheader: "D E" | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"jsc": { | ||
"target": "es5", | ||
"externalHelpers": true, | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function a({ b = [] }: { b: C[] }) { | ||
const t = useMemo(() => { | ||
return [ | ||
// Cmt1 | ||
...a.slice(0, 1), | ||
// Cmt2 | ||
...b, | ||
// Cmt3 | ||
...c.slice(1), | ||
]; | ||
}, [frameworks]); | ||
|
||
return 1; | ||
} | ||
|
||
export default a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as swcHelpers from "@swc/helpers"; | ||
function a(param) { | ||
var _b = param.b, b = _b === void 0 ? [] : _b; | ||
var t = useMemo(function() { | ||
return(// Cmt1 | ||
swcHelpers.toConsumableArray(a.slice(0, 1)).concat(// Cmt2 | ||
swcHelpers.toConsumableArray(b), // Cmt3 | ||
swcHelpers.toConsumableArray(c.slice(1)))); | ||
}, [ | ||
frameworks | ||
]); | ||
return 1; | ||
} | ||
export default a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "ecmascript", | ||
"jsx": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default <A | ||
className={b} | ||
header="C" | ||
subheader="D | ||
E" | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default /*#__PURE__*/ React.createElement(A, { | ||
className: b, | ||
header: "C", | ||
subheader: "D E" | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
function Component() { | ||
return(/*#__PURE__*/ React.createElement("div", { | ||
name: "A\\n\\n B" | ||
name: "A B" | ||
})); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
console.log(/*#__PURE__*/ React.createElement("h1", { | ||
value: "abc\\nas" | ||
value: "abc as" | ||
}, "s")); |