forked from babel/babel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include $$typeof on inlined React elements
See facebook/react#4832.
- Loading branch information
1 parent
436ba9b
commit 1d0e68f
Showing
17 changed files
with
31 additions
and
9 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
1 change: 1 addition & 0 deletions
1
packages/babel/src/transformation/templates/helper-typeof-react-element.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 @@ | ||
(typeof Symbol === "function" && Symbol.for && Symbol.for("react.element")) || 0xeac7 |
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
3 changes: 2 additions & 1 deletion
3
...xtures/transformation/optimisation.react.inline-elements/component-with-props/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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
"use strict"; | ||
|
||
({ | ||
$$typeof: babelHelpers.typeofReactElement, | ||
type: Baz, | ||
ref: null, | ||
props: babelHelpers.defaultProps(Baz.defaultProps, { | ||
foo: "bar" | ||
}), | ||
key: null | ||
}); | ||
}); |
3 changes: 2 additions & 1 deletion
3
...bel/test/fixtures/transformation/optimisation.react.inline-elements/component/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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
"use strict"; | ||
|
||
({ | ||
$$typeof: babelHelpers.typeofReactElement, | ||
type: Baz, | ||
ref: null, | ||
props: babelHelpers.defaultProps(Baz.defaultProps, {}), | ||
key: null | ||
}); | ||
}); |
3 changes: 2 additions & 1 deletion
3
...res/transformation/optimisation.react.inline-elements/html-element-with-props/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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
"use strict"; | ||
|
||
({ | ||
$$typeof: babelHelpers.typeofReactElement, | ||
type: "foo", | ||
ref: null, | ||
props: { | ||
bar: "foo" | ||
}, | ||
key: null | ||
}); | ||
}); |
3 changes: 2 additions & 1 deletion
3
.../test/fixtures/transformation/optimisation.react.inline-elements/html-element/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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
"use strict"; | ||
|
||
({ | ||
$$typeof: babelHelpers.typeofReactElement, | ||
type: "foo", | ||
ref: null, | ||
props: {}, | ||
key: null | ||
}); | ||
}); |
1 change: 1 addition & 0 deletions
1
...ges/babel/test/fixtures/transformation/optimisation.react.inline-elements/key/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
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
3 changes: 2 additions & 1 deletion
3
...xtures/transformation/optimisation.react.inline-elements/nested-html-elements/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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
"use strict"; | ||
|
||
({ | ||
$$typeof: babelHelpers.typeofReactElement, | ||
type: "div", | ||
ref: null, | ||
props: { | ||
children: bar, | ||
className: "foo" | ||
}, | ||
key: null | ||
}); | ||
}); |
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
1 change: 1 addition & 0 deletions
1
...ormation/optimisation.react.inline-elements/self-closing-component-with-props/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
1 change: 1 addition & 0 deletions
1
...ures/transformation/optimisation.react.inline-elements/self-closing-component/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
1 change: 1 addition & 0 deletions
1
...ation/optimisation.react.inline-elements/self-closing-html-element-with-props/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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
"use strict"; | ||
|
||
({ | ||
$$typeof: babelHelpers.typeofReactElement, | ||
type: "foo", | ||
ref: null, | ||
props: { | ||
|
1 change: 1 addition & 0 deletions
1
...s/transformation/optimisation.react.inline-elements/self-closing-html-element/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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
"use strict"; | ||
|
||
({ | ||
$$typeof: babelHelpers.typeofReactElement, | ||
type: "foo", | ||
ref: null, | ||
props: {}, | ||
|
3 changes: 2 additions & 1 deletion
3
...xtures/transformation/optimisation.react.inline-elements/shorthand-attributes/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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
"use strict"; | ||
|
||
({ | ||
$$typeof: babelHelpers.typeofReactElement, | ||
type: Foo, | ||
ref: null, | ||
props: babelHelpers.defaultProps(Foo.defaultProps, { | ||
bar: true | ||
}), | ||
key: null | ||
}); | ||
}); |