-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
908d6ff
commit 46cd8ba
Showing
12 changed files
with
59 additions
and
38 deletions.
There are no files selected for viewing
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
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
7 changes: 7 additions & 0 deletions
7
test/form/samples/jsx/transpiles-automatic-with-defaults/_config.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,7 @@ | ||
module.exports = defineTest({ | ||
description: 'transpiles JSX for react', | ||
options: { | ||
external: ['react', 'react/jsx-runtime'], | ||
jsx: { mode: 'automatic' } | ||
} | ||
}); |
11 changes: 11 additions & 0 deletions
11
test/form/samples/jsx/transpiles-automatic-with-defaults/_expected.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,11 @@ | ||
import { jsx, Fragment, jsxs } from 'react/jsx-runtime'; | ||
import react from 'react'; | ||
|
||
const Foo = () => {}; | ||
const obj = { key: '2' }; | ||
|
||
console.log(/*#__PURE__*/jsx(Foo, {})); | ||
console.log(/*#__PURE__*/jsx(Fragment, { children: /*#__PURE__*/jsx(Foo, {}) })); | ||
console.log(/*#__PURE__*/jsxs(Foo, { children: [/*#__PURE__*/jsx(Foo, {}), /*#__PURE__*/jsx(Foo, {})] })); | ||
console.log(/*#__PURE__*/jsxs(Fragment, { children: [/*#__PURE__*/jsx(Foo, {}), /*#__PURE__*/jsx(Foo, {})] })); | ||
console.log(/*#__PURE__*/react.createElement(Foo, Object.assign({}, obj, { key: "1" }))); |
8 changes: 8 additions & 0 deletions
8
test/form/samples/jsx/transpiles-automatic-with-defaults/main.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,8 @@ | ||
const Foo = () => {}; | ||
const obj = { key: '2' }; | ||
|
||
console.log(<Foo />); | ||
console.log(<><Foo/></>); | ||
console.log(<Foo><Foo/><Foo/></Foo>); | ||
console.log(<><Foo/><Foo/></>); | ||
console.log(<Foo {...obj} key="1" />); |
7 changes: 7 additions & 0 deletions
7
test/form/samples/jsx/transpiles-classic-with-defaults/_config.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,7 @@ | ||
module.exports = defineTest({ | ||
description: 'transpiles JSX for react', | ||
options: { | ||
external: ['react', 'react/jsx-runtime'], | ||
jsx: { mode: 'classic' } | ||
} | ||
}); |
8 changes: 8 additions & 0 deletions
8
test/form/samples/jsx/transpiles-classic-with-defaults/_expected.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,8 @@ | ||
const Foo = () => {}; | ||
const obj = { key: '2' }; | ||
|
||
console.log(/*#__PURE__*/React.createElement(Foo, null)); | ||
console.log(/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Foo, null))); | ||
console.log(/*#__PURE__*/React.createElement(Foo, null, /*#__PURE__*/React.createElement(Foo, null), /*#__PURE__*/React.createElement(Foo, null))); | ||
console.log(/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Foo, null), /*#__PURE__*/React.createElement(Foo, null))); | ||
console.log(/*#__PURE__*/React.createElement(Foo, Object.assign({}, obj, { key: "1" }))); |
8 changes: 8 additions & 0 deletions
8
test/form/samples/jsx/transpiles-classic-with-defaults/main.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,8 @@ | ||
const Foo = () => {}; | ||
const obj = { key: '2' }; | ||
|
||
console.log(<Foo />); | ||
console.log(<><Foo/></>); | ||
console.log(<Foo><Foo/><Foo/></Foo>); | ||
console.log(<><Foo/><Foo/></>); | ||
console.log(<Foo {...obj} key="1" />); |