Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load
jsx-runtime
after existing imports (#12546)
Co-authored-by: Brian Ng <bng412@gmail.com> Co-authored-by: Babel Bot <babel-bot@users.noreply.github.com>
- Loading branch information
1 parent
6c9a481
commit 4f83a09
Showing
30 changed files
with
207 additions
and
46 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
6 changes: 3 additions & 3 deletions
6
...bel-plugin-transform-react-jsx-development/test/fixtures/linux/auto-import-dev/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
4 changes: 2 additions & 2 deletions
4
...l-plugin-transform-react-jsx-development/test/fixtures/linux/self-inside-arrow/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
6 changes: 3 additions & 3 deletions
6
...-transform-react-jsx-development/test/fixtures/windows/auto-import-dev-windows/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
4 changes: 2 additions & 2 deletions
4
...ransform-react-jsx-development/test/fixtures/windows/self-inside-arrow-windows/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
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
11 changes: 11 additions & 0 deletions
11
...ges/babel-plugin-transform-react-jsx/test/fixtures/autoImport/after-polyfills-2/input.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,11 @@ | ||
// https://github.com/babel/babel/issues/12522 | ||
|
||
ReactDOM.render( | ||
<p>Hello, World!</p>, | ||
document.getElementById('root') | ||
); | ||
|
||
// Imports are hoisted, so this is still ok | ||
import 'react-app-polyfill/ie11'; | ||
import 'react-app-polyfill/stable'; | ||
import ReactDOM from 'react-dom'; |
9 changes: 9 additions & 0 deletions
9
...es/babel-plugin-transform-react-jsx/test/fixtures/autoImport/after-polyfills-2/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,9 @@ | ||
// https://github.com/babel/babel/issues/12522 | ||
ReactDOM.render( /*#__PURE__*/_jsx("p", { | ||
children: "Hello, World!" | ||
}), document.getElementById('root')); // Imports are hoisted, so this is still ok | ||
|
||
import 'react-app-polyfill/ie11'; | ||
import 'react-app-polyfill/stable'; | ||
import ReactDOM from 'react-dom'; | ||
import { jsx as _jsx } from "react/jsx-runtime"; |
10 changes: 10 additions & 0 deletions
10
...in-transform-react-jsx/test/fixtures/autoImport/after-polyfills-compiled-to-cjs/input.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,10 @@ | ||
// https://github.com/babel/babel/issues/12522 | ||
|
||
import 'react-app-polyfill/ie11'; | ||
import 'react-app-polyfill/stable'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
ReactDOM.render( | ||
<p>Hello, World!</p>, | ||
document.getElementById('root') | ||
); |
7 changes: 7 additions & 0 deletions
7
...transform-react-jsx/test/fixtures/autoImport/after-polyfills-compiled-to-cjs/options.json
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 @@ | ||
{ | ||
"plugins": [ | ||
["transform-react-jsx", { "runtime": "automatic" }], | ||
"transform-modules-commonjs" | ||
], | ||
"sourceType": "module" | ||
} |
16 changes: 16 additions & 0 deletions
16
...in-transform-react-jsx/test/fixtures/autoImport/after-polyfills-compiled-to-cjs/output.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,16 @@ | ||
"use strict"; | ||
|
||
require("react-app-polyfill/ie11"); | ||
|
||
require("react-app-polyfill/stable"); | ||
|
||
var _reactDom = _interopRequireDefault(require("react-dom")); | ||
|
||
var _jsxRuntime = require("react/jsx-runtime"); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
// https://github.com/babel/babel/issues/12522 | ||
_reactDom.default.render( /*#__PURE__*/(0, _jsxRuntime.jsx)("p", { | ||
children: "Hello, World!" | ||
}), document.getElementById('root')); |
10 changes: 10 additions & 0 deletions
10
...ransform-react-jsx/test/fixtures/autoImport/after-polyfills-script-not-supported/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,10 @@ | ||
// https://github.com/babel/babel/issues/12522 | ||
|
||
require('react-app-polyfill/ie11'); | ||
require('react-app-polyfill/stable'); | ||
const ReactDOM = require('react-dom'); | ||
|
||
ReactDOM.render( | ||
<p>Hello, World!</p>, | ||
document.getElementById('root') | ||
); |
4 changes: 4 additions & 0 deletions
4
...form-react-jsx/test/fixtures/autoImport/after-polyfills-script-not-supported/options.json
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,4 @@ | ||
{ | ||
"plugins": [["transform-react-jsx", { "runtime": "automatic" }]], | ||
"sourceType": "script" | ||
} |
12 changes: 12 additions & 0 deletions
12
...ansform-react-jsx/test/fixtures/autoImport/after-polyfills-script-not-supported/output.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,12 @@ | ||
var _reactJsxRuntime = require("react/jsx-runtime"); | ||
|
||
// https://github.com/babel/babel/issues/12522 | ||
require('react-app-polyfill/ie11'); | ||
|
||
require('react-app-polyfill/stable'); | ||
|
||
const ReactDOM = require('react-dom'); | ||
|
||
ReactDOM.render( /*#__PURE__*/_reactJsxRuntime.jsx("p", { | ||
children: "Hello, World!" | ||
}), document.getElementById('root')); |
10 changes: 10 additions & 0 deletions
10
packages/babel-plugin-transform-react-jsx/test/fixtures/autoImport/after-polyfills/input.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,10 @@ | ||
// https://github.com/babel/babel/issues/12522 | ||
|
||
import 'react-app-polyfill/ie11'; | ||
import 'react-app-polyfill/stable'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
ReactDOM.render( | ||
<p>Hello, World!</p>, | ||
document.getElementById('root') | ||
); |
8 changes: 8 additions & 0 deletions
8
...ages/babel-plugin-transform-react-jsx/test/fixtures/autoImport/after-polyfills/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,8 @@ | ||
// https://github.com/babel/babel/issues/12522 | ||
import 'react-app-polyfill/ie11'; | ||
import 'react-app-polyfill/stable'; | ||
import ReactDOM from 'react-dom'; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
ReactDOM.render( /*#__PURE__*/_jsx("p", { | ||
children: "Hello, World!" | ||
}), document.getElementById('root')); |
6 changes: 3 additions & 3 deletions
6
...nsform-react-jsx/test/fixtures/autoImport/auto-import-react-source-type-module/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
6 changes: 3 additions & 3 deletions
6
packages/babel-plugin-transform-react-jsx/test/fixtures/autoImport/react-defined/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
2 changes: 1 addition & 1 deletion
2
...-react-jsx/test/fixtures/react-automatic/concatenates-adjacent-string-literals/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
6 changes: 3 additions & 3 deletions
6
...orm-react-jsx/test/fixtures/react-automatic/does-not-add-source-self-automatic/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
2 changes: 1 addition & 1 deletion
2
...in-transform-react-jsx/test/fixtures/react-automatic/handle-fragments-with-key/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import * as React from "react"; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
|
||
var x = /*#__PURE__*/_jsx(React.Fragment, {}, "foo"); |
2 changes: 1 addition & 1 deletion
2
...form-react-jsx/test/fixtures/react-automatic/handle-fragments-with-no-children/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import { Fragment as _Fragment } from "react/jsx-runtime"; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
|
||
var x = /*#__PURE__*/_jsx(_Fragment, {}); |
2 changes: 1 addition & 1 deletion
2
...abel-plugin-transform-react-jsx/test/fixtures/react-automatic/handle-fragments/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
2 changes: 1 addition & 1 deletion
2
...lugin-transform-react-jsx/test/fixtures/react-automatic/handle-static-children/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
4 changes: 2 additions & 2 deletions
4
...ransform-react-jsx/test/fixtures/react-automatic/should-allow-nested-fragments/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
Oops, something went wrong.