add optimisation.react.constantElements transformer - facebook/react#3228
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<Baz foo="bar"></Baz>;
|
||||
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: Baz,
|
||||
ref: null,
|
||||
children: [],
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {
|
||||
foo: "bar"
|
||||
}),
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<Baz></Baz>;
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: Baz,
|
||||
ref: null,
|
||||
children: [],
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {}),
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<foo bar="foo"></foo>;
|
||||
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: "foo",
|
||||
ref: null,
|
||||
children: [],
|
||||
props: {
|
||||
bar: "foo"
|
||||
},
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<foo></foo>;
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: "foo",
|
||||
ref: null,
|
||||
children: [],
|
||||
props: {},
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<Foo key="foo" />
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: Foo,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Foo.defaultProps, {}),
|
||||
key: "foo"
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<Foo className="foo">{bar}<Baz key="baz" /></Foo>
|
||||
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: Foo,
|
||||
ref: null,
|
||||
children: [bar, {
|
||||
type: Baz,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {}),
|
||||
key: "baz"
|
||||
}],
|
||||
props: babelHelpers.defaultProps(Foo.defaultProps, {
|
||||
className: "foo"
|
||||
}),
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<div className="foo">{bar}</div>;
|
||||
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: "div",
|
||||
ref: null,
|
||||
children: [bar],
|
||||
props: {
|
||||
className: "foo"
|
||||
},
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<div className="foo">{bar}<Baz key="baz" /></div>
|
||||
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: "div",
|
||||
ref: null,
|
||||
children: [bar, {
|
||||
type: Baz,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {}),
|
||||
key: "baz"
|
||||
}],
|
||||
props: {
|
||||
className: "foo"
|
||||
},
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"externalHelpers": true,
|
||||
"noCheckAst": true,
|
||||
"optional": ["optimisation.react.inlineElements"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<Foo ref="bar" />
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
React.createElement(Foo, { ref: "bar" });
|
||||
@@ -0,0 +1 @@
|
||||
<Baz foo="bar" />;
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: Baz,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {
|
||||
foo: "bar"
|
||||
}),
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<Baz />;
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: Baz,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {}),
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<foo bar="foo" />;
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: "foo",
|
||||
ref: null,
|
||||
props: {
|
||||
bar: "foo"
|
||||
},
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<foo />;
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
type: "foo",
|
||||
ref: null,
|
||||
props: {},
|
||||
key: null
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<Foo {...bar} />
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
React.createElement(Foo, bar);
|
||||
Reference in New Issue
Block a user