-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41151 from Andarist/fix/create-element-new-jsx-tr…
…ansform Fix/create element new jsx transform
- Loading branch information
Showing
23 changed files
with
734 additions
and
32 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
29 changes: 29 additions & 0 deletions
29
tests/baselines/reference/jsxJsxsCjsTransformKeyProp(jsx=react-jsx).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,29 @@ | ||
//// [jsxJsxsCjsTransformKeyProp.tsx] | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
const props = { answer: 42 } | ||
const a = <div key="foo" {...props}>text</div>; | ||
const b = <div {...props} key="bar">text</div>; | ||
|
||
export {}; | ||
|
||
|
||
//// [jsxJsxsCjsTransformKeyProp.js] | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
exports.__esModule = true; | ||
var react_1 = require("react"); | ||
var jsx_runtime_1 = require("react/jsx-runtime"); | ||
/// <reference path="react16.d.ts" /> | ||
var props = { answer: 42 }; | ||
var a = jsx_runtime_1.jsx("div", __assign({}, props, { children: "text" }), "foo"); | ||
var b = react_1.createElement("div", __assign({}, props, { key: "bar" }), "text"); |
22 changes: 22 additions & 0 deletions
22
tests/baselines/reference/jsxJsxsCjsTransformKeyProp(jsx=react-jsx).symbols
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,22 @@ | ||
=== tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformKeyProp.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
const props = { answer: 42 } | ||
>props : Symbol(props, Decl(jsxJsxsCjsTransformKeyProp.tsx, 1, 5)) | ||
>answer : Symbol(answer, Decl(jsxJsxsCjsTransformKeyProp.tsx, 1, 15)) | ||
|
||
const a = <div key="foo" {...props}>text</div>; | ||
>a : Symbol(a, Decl(jsxJsxsCjsTransformKeyProp.tsx, 2, 5)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
>key : Symbol(key, Decl(jsxJsxsCjsTransformKeyProp.tsx, 2, 14)) | ||
>props : Symbol(props, Decl(jsxJsxsCjsTransformKeyProp.tsx, 1, 5)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
|
||
const b = <div {...props} key="bar">text</div>; | ||
>b : Symbol(b, Decl(jsxJsxsCjsTransformKeyProp.tsx, 3, 5)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
>props : Symbol(props, Decl(jsxJsxsCjsTransformKeyProp.tsx, 1, 5)) | ||
>key : Symbol(key, Decl(jsxJsxsCjsTransformKeyProp.tsx, 3, 25)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
|
||
export {}; | ||
|
26 changes: 26 additions & 0 deletions
26
tests/baselines/reference/jsxJsxsCjsTransformKeyProp(jsx=react-jsx).types
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,26 @@ | ||
=== tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformKeyProp.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
const props = { answer: 42 } | ||
>props : { answer: number; } | ||
>{ answer: 42 } : { answer: number; } | ||
>answer : number | ||
>42 : 42 | ||
|
||
const a = <div key="foo" {...props}>text</div>; | ||
>a : JSX.Element | ||
><div key="foo" {...props}>text</div> : JSX.Element | ||
>div : any | ||
>key : string | ||
>props : { answer: number; } | ||
>div : any | ||
|
||
const b = <div {...props} key="bar">text</div>; | ||
>b : JSX.Element | ||
><div {...props} key="bar">text</div> : JSX.Element | ||
>div : any | ||
>props : { answer: number; } | ||
>key : string | ||
>div : any | ||
|
||
export {}; | ||
|
30 changes: 30 additions & 0 deletions
30
tests/baselines/reference/jsxJsxsCjsTransformKeyProp(jsx=react-jsxdev).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,30 @@ | ||
//// [jsxJsxsCjsTransformKeyProp.tsx] | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
const props = { answer: 42 } | ||
const a = <div key="foo" {...props}>text</div>; | ||
const b = <div {...props} key="bar">text</div>; | ||
|
||
export {}; | ||
|
||
|
||
//// [jsxJsxsCjsTransformKeyProp.js] | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
exports.__esModule = true; | ||
var react_1 = require("react"); | ||
var jsx_dev_runtime_1 = require("react/jsx-dev-runtime"); | ||
var _jsxFileName = "tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformKeyProp.tsx"; | ||
/// <reference path="react16.d.ts" /> | ||
var props = { answer: 42 }; | ||
var a = jsx_dev_runtime_1.jsxDEV("div", __assign({}, props, { children: "text" }), "foo", false, { fileName: _jsxFileName, lineNumber: 3, columnNumber: 10 }, this); | ||
var b = react_1.createElement("div", __assign({}, props, { key: "bar" }), "text"); |
22 changes: 22 additions & 0 deletions
22
tests/baselines/reference/jsxJsxsCjsTransformKeyProp(jsx=react-jsxdev).symbols
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,22 @@ | ||
=== tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformKeyProp.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
const props = { answer: 42 } | ||
>props : Symbol(props, Decl(jsxJsxsCjsTransformKeyProp.tsx, 1, 5)) | ||
>answer : Symbol(answer, Decl(jsxJsxsCjsTransformKeyProp.tsx, 1, 15)) | ||
|
||
const a = <div key="foo" {...props}>text</div>; | ||
>a : Symbol(a, Decl(jsxJsxsCjsTransformKeyProp.tsx, 2, 5)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
>key : Symbol(key, Decl(jsxJsxsCjsTransformKeyProp.tsx, 2, 14)) | ||
>props : Symbol(props, Decl(jsxJsxsCjsTransformKeyProp.tsx, 1, 5)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
|
||
const b = <div {...props} key="bar">text</div>; | ||
>b : Symbol(b, Decl(jsxJsxsCjsTransformKeyProp.tsx, 3, 5)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
>props : Symbol(props, Decl(jsxJsxsCjsTransformKeyProp.tsx, 1, 5)) | ||
>key : Symbol(key, Decl(jsxJsxsCjsTransformKeyProp.tsx, 3, 25)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
|
||
export {}; | ||
|
26 changes: 26 additions & 0 deletions
26
tests/baselines/reference/jsxJsxsCjsTransformKeyProp(jsx=react-jsxdev).types
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,26 @@ | ||
=== tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformKeyProp.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
const props = { answer: 42 } | ||
>props : { answer: number; } | ||
>{ answer: 42 } : { answer: number; } | ||
>answer : number | ||
>42 : 42 | ||
|
||
const a = <div key="foo" {...props}>text</div>; | ||
>a : JSX.Element | ||
><div key="foo" {...props}>text</div> : JSX.Element | ||
>div : any | ||
>key : string | ||
>props : { answer: number; } | ||
>div : any | ||
|
||
const b = <div {...props} key="bar">text</div>; | ||
>b : JSX.Element | ||
><div {...props} key="bar">text</div> : JSX.Element | ||
>div : any | ||
>props : { answer: number; } | ||
>key : string | ||
>div : any | ||
|
||
export {}; | ||
|
29 changes: 29 additions & 0 deletions
29
tests/baselines/reference/jsxJsxsCjsTransformKeyPropCustomImport(jsx=react-jsx).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,29 @@ | ||
//// [jsxJsxsCjsTransformKeyPropCustomImport.tsx] | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
const props = { answer: 42 } | ||
const a = <div key="foo" {...props}>text</div>; | ||
const b = <div {...props} key="bar">text</div>; | ||
|
||
export {}; | ||
|
||
|
||
//// [jsxJsxsCjsTransformKeyPropCustomImport.js] | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
exports.__esModule = true; | ||
var preact_1 = require("preact"); | ||
var jsx_runtime_1 = require("preact/jsx-runtime"); | ||
/// <reference path="react16.d.ts" /> | ||
var props = { answer: 42 }; | ||
var a = jsx_runtime_1.jsx("div", __assign({}, props, { children: "text" }), "foo"); | ||
var b = preact_1.createElement("div", __assign({}, props, { key: "bar" }), "text"); |
22 changes: 22 additions & 0 deletions
22
tests/baselines/reference/jsxJsxsCjsTransformKeyPropCustomImport(jsx=react-jsx).symbols
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,22 @@ | ||
=== tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformKeyPropCustomImport.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
const props = { answer: 42 } | ||
>props : Symbol(props, Decl(jsxJsxsCjsTransformKeyPropCustomImport.tsx, 1, 5)) | ||
>answer : Symbol(answer, Decl(jsxJsxsCjsTransformKeyPropCustomImport.tsx, 1, 15)) | ||
|
||
const a = <div key="foo" {...props}>text</div>; | ||
>a : Symbol(a, Decl(jsxJsxsCjsTransformKeyPropCustomImport.tsx, 2, 5)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
>key : Symbol(key, Decl(jsxJsxsCjsTransformKeyPropCustomImport.tsx, 2, 14)) | ||
>props : Symbol(props, Decl(jsxJsxsCjsTransformKeyPropCustomImport.tsx, 1, 5)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
|
||
const b = <div {...props} key="bar">text</div>; | ||
>b : Symbol(b, Decl(jsxJsxsCjsTransformKeyPropCustomImport.tsx, 3, 5)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
>props : Symbol(props, Decl(jsxJsxsCjsTransformKeyPropCustomImport.tsx, 1, 5)) | ||
>key : Symbol(key, Decl(jsxJsxsCjsTransformKeyPropCustomImport.tsx, 3, 25)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) | ||
|
||
export {}; | ||
|
26 changes: 26 additions & 0 deletions
26
tests/baselines/reference/jsxJsxsCjsTransformKeyPropCustomImport(jsx=react-jsx).types
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,26 @@ | ||
=== tests/cases/conformance/jsx/jsxs/jsxJsxsCjsTransformKeyPropCustomImport.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
const props = { answer: 42 } | ||
>props : { answer: number; } | ||
>{ answer: 42 } : { answer: number; } | ||
>answer : number | ||
>42 : 42 | ||
|
||
const a = <div key="foo" {...props}>text</div>; | ||
>a : JSX.Element | ||
><div key="foo" {...props}>text</div> : JSX.Element | ||
>div : any | ||
>key : string | ||
>props : { answer: number; } | ||
>div : any | ||
|
||
const b = <div {...props} key="bar">text</div>; | ||
>b : JSX.Element | ||
><div {...props} key="bar">text</div> : JSX.Element | ||
>div : any | ||
>props : { answer: number; } | ||
>key : string | ||
>div : any | ||
|
||
export {}; | ||
|
Oops, something went wrong.