feat(es/minifier): Remove pure calls (#3925)

This commit is contained in:
Austaras 2022-03-09 19:55:31 +08:00 committed by GitHub
parent 8f4e10e44c
commit bd838ac5a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
312 changed files with 496 additions and 2409 deletions

View File

@ -1,4 +1,3 @@
import React from "react";
class ResizablePanel extends React.Component {
}
React.createElement(ResizablePanel, null, React.createElement("div", null), React.createElement("div", null)), React.createElement(ResizablePanel, null, React.createElement("div", null), React.createElement("div", null), React.createElement("div", null));

View File

@ -9,4 +9,3 @@ var ResizablePanel = function(_Component) {
}
return ResizablePanel;
}(React.Component);
React.createElement(ResizablePanel, null, React.createElement("div", null), React.createElement("div", null)), React.createElement(ResizablePanel, null, React.createElement("div", null), React.createElement("div", null), React.createElement("div", null));

View File

@ -1,6 +0,0 @@
React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", React.createElement("h1", null, " world ")), React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", (user)=>React.createElement("h2", null, user.name)
), React.createElement("div", null, " ", 1, " ", "That is a number", " "), React.createElement(class {
render() {
return React.createElement("div", null, "My Button");
}
}, null, " ", React.createElement("h2", null, " Hello "), " ");

View File

@ -8,6 +8,3 @@ var Button = function() {
return React.createElement("div", null, "My Button");
}, Button;
}();
React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", React.createElement("h1", null, " world ")), React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", function(user) {
return React.createElement("h2", null, user.name);
}), React.createElement("div", null, " ", 1, " ", "That is a number", " "), React.createElement(Button, null, " ", React.createElement("h2", null, " Hello "), " ");

View File

@ -1,6 +0,0 @@
React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", React.createElement("h1", null, " world ")), React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", (user)=>React.createElement("h2", null, user.name)
), React.createElement("div", null, " ", 1, " ", "That is a number", " "), React.createElement(class {
render() {
return React.createElement("div", null, "My Button");
}
}, null, " ", React.createElement("h2", null, " Hello "), " ");

View File

@ -8,6 +8,3 @@ var Button = function() {
return React.createElement("div", null, "My Button");
}, Button;
}();
React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", React.createElement("h1", null, " world ")), React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", function(user) {
return React.createElement("h2", null, user.name);
}), React.createElement("div", null, " ", 1, " ", "That is a number", " "), React.createElement(Button, null, " ", React.createElement("h2", null, " Hello "), " ");

View File

@ -4,29 +4,5 @@ class Button extends React.Component {
return React.createElement("div", null, "My Button");
}
}
function AnotherButton(p) {
return React.createElement("h1", null, "Just Another Button");
}
function Comp(p) {
return React.createElement("div", null, p.b);
}
function SingleChildComp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(React.Fragment, null), React.createElement(Button, null), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(React.Fragment, null, React.createElement(Button, null)), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(React.Fragment, null, React.createElement(Button, null), React.createElement(AnotherButton, null))), React.createElement(SingleChildComp, {
a: 10,
b: "hi"
}, React.createElement(React.Fragment, null, React.createElement(Button, null), React.createElement(AnotherButton, null))), React.createElement(SingleChildComp, {
a: 10,
b: "hi"
}, React.createElement(React.Fragment, null), React.createElement(Button, null), React.createElement(AnotherButton, null));
React.Fragment, React.Fragment, React.Fragment, React.Fragment, React.Fragment;
export { };

View File

@ -10,28 +10,4 @@ var React = require("react"), Button = function(_Component) {
return React.createElement("div", null, "My Button");
}, Button;
}(React.Component);
function AnotherButton(p) {
return React.createElement("h1", null, "Just Another Button");
}
function Comp(p) {
return React.createElement("div", null, p.b);
}
function SingleChildComp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(React.Fragment, null), React.createElement(Button, null), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(React.Fragment, null, React.createElement(Button, null)), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(React.Fragment, null, React.createElement(Button, null), React.createElement(AnotherButton, null))), React.createElement(SingleChildComp, {
a: 10,
b: "hi"
}, React.createElement(React.Fragment, null, React.createElement(Button, null), React.createElement(AnotherButton, null))), React.createElement(SingleChildComp, {
a: 10,
b: "hi"
}, React.createElement(React.Fragment, null), React.createElement(Button, null), React.createElement(AnotherButton, null));
React.Fragment, React.Fragment, React.Fragment, React.Fragment, React.Fragment;

View File

@ -1,10 +1,2 @@
const React = require("react"), Tag = (x)=>React.createElement("div", null)
;
React.createElement(Tag, null), React.createElement(Tag, null), React.createElement(Tag, {
children: React.createElement("div", null)
}), React.createElement(Tag, {
key: "1"
}, React.createElement("div", null)), React.createElement(Tag, {
key: "1"
}, React.createElement("div", null), React.createElement("div", null));
require("react");
export { };

View File

@ -1,11 +1,2 @@
var React = require("react"), Tag = function(x) {
return React.createElement("div", null);
};
React.createElement(Tag, null), React.createElement(Tag, null), React.createElement(Tag, {
children: React.createElement("div", null)
}), React.createElement(Tag, {
key: "1"
}, React.createElement("div", null)), React.createElement(Tag, {
key: "1"
}, React.createElement("div", null), React.createElement("div", null));
require("react");
export { };

View File

@ -1,16 +1,2 @@
const React = require("react");
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi",
children: "lol"
}), React.createElement(Comp, {
a: 10,
b: "hi"
}, "hi hi hi!"), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement("div", null, "hi hi hi!"));
require("react");
export { };

View File

@ -1,16 +1,2 @@
var React = require("react");
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi",
children: "lol"
}), React.createElement(Comp, {
a: 10,
b: "hi"
}, "hi hi hi!"), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement("div", null, "hi hi hi!"));
require("react");
export { };

View File

@ -1,31 +1,9 @@
import * as swcHelpers from "@swc/helpers";
const React = require("react");
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}), React.createElement(Comp, {
a: 10,
b: "hi",
children: "Random"
}, "hi hi hi!"), React.createElement(Comp, swcHelpers.extends({
swcHelpers.extends({
a: 10,
b: "hi"
}, {
children: "Random"
}), "hi hi hi!"), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement("div", null, " My Div "), (name)=>React.createElement("div", null, " My name ", name, " ")
), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement("div", null, " My Div "), 1000000), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement("div", null, " My Div "), "hi hi hi!"), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement("div", null, " My Div "), React.createElement("div", null, " My Div "));
}), (name)=>React.createElement("div", null, " My name ", name, " ")
;

View File

@ -1,32 +1,7 @@
import * as swcHelpers from "@swc/helpers";
var React = require("react");
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}), React.createElement(Comp, {
a: 10,
b: "hi",
children: "Random"
}, "hi hi hi!"), React.createElement(Comp, swcHelpers.extends({
require("react"), swcHelpers.extends({
a: 10,
b: "hi"
}, {
children: "Random"
}), "hi hi hi!"), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement("div", null, " My Div "), function(name) {
return React.createElement("div", null, " My name ", name, " ");
}), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement("div", null, " My Div "), 1000000), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement("div", null, " My Div "), "hi hi hi!"), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement("div", null, " My Div "), React.createElement("div", null, " My Div "));
});

View File

@ -4,17 +4,4 @@ class Button extends React.Component {
return React.createElement("div", null, "My Button");
}
}
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, Button);
export { };

View File

@ -10,16 +10,3 @@ var React = require("react"), Button = function(_Component) {
return React.createElement("div", null, "My Button");
}, Button;
}(React.Component);
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, Button);

View File

@ -4,23 +4,4 @@ class Button extends React.Component {
return React.createElement("div", null, "My Button");
}
}
function AnotherButton(p) {
return React.createElement("h1", null, "Just Another Button");
}
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null));
export { };

View File

@ -10,22 +10,3 @@ var React = require("react"), Button = function(_Component) {
return React.createElement("div", null, "My Button");
}, Button;
}(React.Component);
function AnotherButton(p) {
return React.createElement("h1", null, "Just Another Button");
}
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null));

View File

@ -4,20 +4,4 @@ class Button extends React.Component {
return React.createElement("div", null, "My Button");
}
}
function AnotherButton(p) {
return React.createElement("h1", null, "Just Another Button");
}
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), " ", React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), React.createElement(AnotherButton, null), " "), React.createElement(Comp, {
a: 10,
b: "hi"
}, " ", React.createElement(Button, null), React.createElement(AnotherButton, null));
export { };

View File

@ -10,19 +10,3 @@ var React = require("react"), Button = function(_Component) {
return React.createElement("div", null, "My Button");
}, Button;
}(React.Component);
function AnotherButton(p) {
return React.createElement("h1", null, "Just Another Button");
}
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), " ", React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), React.createElement(AnotherButton, null), " "), React.createElement(Comp, {
a: 10,
b: "hi"
}, " ", React.createElement(Button, null), React.createElement(AnotherButton, null));

View File

@ -4,23 +4,4 @@ class Button extends React.Component {
return React.createElement("div", null, "My Button");
}
}
function AnotherButton(p) {
return React.createElement("h1", null, "Just Another Button");
}
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), " ", React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), React.createElement(AnotherButton, null), " "), React.createElement(Comp, {
a: 10,
b: "hi"
}, " ", React.createElement(Button, null), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), " ");
export { };

View File

@ -10,22 +10,3 @@ var React = require("react"), Button = function(_Component) {
return React.createElement("div", null, "My Button");
}, Button;
}(React.Component);
function AnotherButton(p) {
return React.createElement("h1", null, "Just Another Button");
}
function Comp(p) {
return React.createElement("div", null, p.b);
}
React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), " ", React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), React.createElement(AnotherButton, null), " "), React.createElement(Comp, {
a: 10,
b: "hi"
}, " ", React.createElement(Button, null), React.createElement(AnotherButton, null)), React.createElement(Comp, {
a: 10,
b: "hi"
}, React.createElement(Button, null), " ");

View File

@ -1,4 +1,2 @@
const React = require("react");
React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", React.createElement("h1", null, " world ")), React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", (user)=>React.createElement("h2", null, user.name)
), React.createElement("div", null, " ", 1, " ", "That is a number", " ");
require("react");
export { };

View File

@ -1,5 +1,2 @@
var React = require("react");
React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", React.createElement("h1", null, " world ")), React.createElement("div", null, " ", React.createElement("h2", null, " Hello "), " ", function(user) {
return React.createElement("h2", null, user.name);
}), React.createElement("div", null, " ", 1, " ", "That is a number", " ");
require("react");
export { };

View File

@ -1,22 +1 @@
import * as React from "react";
React.createElement(GenericComponent, {
initialValues: {
x: "y"
},
nextValues: (a)=>a
}), React.createElement(GenericComponent, {
initialValues: 12,
nextValues: (a)=>a
}), React.createElement(GenericComponent, {
initialValues: {
x: "y"
},
nextValues: (a)=>({
x: a.x
})
}), React.createElement(GenericComponent, {
initialValues: {
x: "y"
},
nextValues: (a)=>a.x
});

View File

@ -1,30 +1 @@
import * as React from "react";
React.createElement(GenericComponent, {
initialValues: {
x: "y"
},
nextValues: function(a) {
return a;
}
}), React.createElement(GenericComponent, {
initialValues: 12,
nextValues: function(a) {
return a;
}
}), React.createElement(GenericComponent, {
initialValues: {
x: "y"
},
nextValues: function(a) {
return {
x: a.x
};
}
}), React.createElement(GenericComponent, {
initialValues: {
x: "y"
},
nextValues: function(a) {
return a.x;
}
});

View File

@ -1,7 +1,4 @@
class C extends Component {
}
new C({
foobar: "example"
}), React.createElement(C, {
new class extends Component {
}({
foobar: "example"
});

View File

@ -10,6 +10,4 @@ var C = function(Component) {
}(Component);
new C({
foobar: "example"
}), React.createElement(C, {
foobar: "example"
});

View File

@ -5,16 +5,3 @@ class AsyncLoader extends React.Component {
return null;
}
}
function _load() {
return (_load = swcHelpers.asyncToGenerator(function*() {
return {
success: !0
};
})).apply(this, arguments);
}
React.createElement(AsyncLoader, {
prop1: function() {
return _load.apply(this, arguments);
},
prop2: (result)=>result
});

View File

@ -12,26 +12,3 @@ var AsyncLoader = function(_Component) {
return null;
}, AsyncLoader;
}(React.Component);
function _load() {
return (_load = swcHelpers.asyncToGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.abrupt("return", {
success: !0
});
case 1:
case "end":
return _ctx.stop();
}
}, _callee);
}))).apply(this, arguments);
}
React.createElement(AsyncLoader, {
prop1: function() {
return _load.apply(this, arguments);
},
prop2: function(result) {
return result;
}
});

View File

@ -3,11 +3,3 @@ var D = function() {
"use strict";
swcHelpers.classCallCheck(this, D);
};
!function(D1) {
"use strict";
swcHelpers.inherits(C, D1);
var _super = swcHelpers.createSuper(C);
function C() {
return swcHelpers.classCallCheck(this, C), _super.apply(this, arguments);
}
}(D);

View File

@ -3,11 +3,3 @@ var D = function() {
"use strict";
swcHelpers.classCallCheck(this, D);
};
!function(D1) {
"use strict";
swcHelpers.inherits(C, D1);
var _super = swcHelpers.createSuper(C);
function C() {
return swcHelpers.classCallCheck(this, C), _super.apply(this, arguments);
}
}(D);

View File

@ -1,3 +1,2 @@
const React = require("react");
React.createElement("div", null, "// Not Comment"), React.createElement("div", null, "// Not Comment", "// Another not Comment"), React.createElement("div", null, "// Not Comment", "Hi", "// Another not Comment"), React.createElement("div", null, "/* Not Comment */", "Hi");
require("react");
export { };

View File

@ -1,3 +1,2 @@
var React = require("react");
React.createElement("div", null, "// Not Comment"), React.createElement("div", null, "// Not Comment", "// Another not Comment"), React.createElement("div", null, "// Not Comment", "Hi", "// Another not Comment"), React.createElement("div", null, "/* Not Comment */", "Hi");
require("react");
export { };

View File

@ -1,11 +0,0 @@
const FooComponent = (props)=>React.createElement("span", null, props.foo)
;
React.createElement(FooComponent, {
foo: "A"
}), React.createElement(FooComponent, {
foo: "A"
}), React.createElement(FooComponent, {
foo: "f"
}), React.createElement(FooComponent, {
foo: "f"
});

View File

@ -1,12 +0,0 @@
var FooComponent = function(props) {
return React.createElement("span", null, props.foo);
};
React.createElement(FooComponent, {
foo: "A"
}), React.createElement(FooComponent, {
foo: "A"
}), React.createElement(FooComponent, {
foo: "f"
}), React.createElement(FooComponent, {
foo: "f"
});

View File

@ -1,38 +1,30 @@
import * as swcHelpers from "@swc/helpers";
const React = require("react");
require("react");
export function MainButton(props) {
return props.goTo ? this._buildMainLink(props) : this._buildMainButton(props);
}
React.createElement(MainButton, swcHelpers.extends({}, {
swcHelpers.extends({}, {
onClick: (k)=>{
console.log(k);
}
}, {
extra: !0
})), React.createElement(MainButton, {
onClick: (k)=>{
console.log(k);
},
extra: !0
}), React.createElement(MainButton, swcHelpers.extends({}, {
}), swcHelpers.extends({}, {
goTo: "home"
}, {
extra: !0
})), React.createElement(MainButton, {
goTo: "home",
extra: !0
});
export function NoOverload() {}
React.createElement(NoOverload, swcHelpers.extends({}, {
swcHelpers.extends({}, {
onClick: (k)=>{
console.log(k);
}
}, {
extra: !0
}));
});
export function NoOverload1() {}
React.createElement(NoOverload1, swcHelpers.extends({}, {
swcHelpers.extends({}, {
goTo: "home"
}, {
extra: !0
}));
});

View File

@ -1,38 +1,30 @@
import * as swcHelpers from "@swc/helpers";
var React = require("react");
require("react");
export function MainButton(props) {
return props.goTo ? this._buildMainLink(props) : this._buildMainButton(props);
}
React.createElement(MainButton, swcHelpers.extends({}, {
swcHelpers.extends({}, {
onClick: function(k) {
console.log(k);
}
}, {
extra: !0
})), React.createElement(MainButton, {
onClick: function(k) {
console.log(k);
},
extra: !0
}), React.createElement(MainButton, swcHelpers.extends({}, {
}), swcHelpers.extends({}, {
goTo: "home"
}, {
extra: !0
})), React.createElement(MainButton, {
goTo: "home",
extra: !0
});
export function NoOverload() {}
React.createElement(NoOverload, swcHelpers.extends({}, {
swcHelpers.extends({}, {
onClick: function(k) {
console.log(k);
}
}, {
extra: !0
}));
});
export function NoOverload1() {}
React.createElement(NoOverload1, swcHelpers.extends({}, {
swcHelpers.extends({}, {
goTo: "home"
}, {
extra: !0
}));
});

View File

@ -2,8 +2,6 @@ import * as swcHelpers from "@swc/helpers";
import * as cx from "classnames";
import * as React from "react";
let buttonProps;
React.createElement("button", swcHelpers.extends({}, buttonProps), React.createElement("span", {
className: cx("class1", {
class2: !0
})
}));
swcHelpers.extends({}, buttonProps), cx("class1", {
class2: !0
});

View File

@ -2,8 +2,6 @@ var buttonProps;
import * as swcHelpers from "@swc/helpers";
import * as cx from "classnames";
import * as React from "react";
React.createElement("button", swcHelpers.extends({}, buttonProps), React.createElement("span", {
className: cx("class1", {
class2: !0
})
}));
swcHelpers.extends({}, buttonProps), cx("class1", {
class2: !0
});

View File

@ -2,8 +2,6 @@ import * as swcHelpers from "@swc/helpers";
import * as cx from "classnames";
import * as React from "react";
let buttonProps;
React.createElement("button", swcHelpers.extends({}, buttonProps), React.createElement("span", {
className: cx("class1", {
class2: !0
})
}));
swcHelpers.extends({}, buttonProps), cx("class1", {
class2: !0
});

View File

@ -2,8 +2,6 @@ var buttonProps;
import * as swcHelpers from "@swc/helpers";
import * as cx from "classnames";
import * as React from "react";
React.createElement("button", swcHelpers.extends({}, buttonProps), React.createElement("span", {
className: cx("class1", {
class2: !0
})
}));
swcHelpers.extends({}, buttonProps), cx("class1", {
class2: !0
});

View File

@ -2,8 +2,6 @@ import * as swcHelpers from "@swc/helpers";
import * as cx from "classnames";
import * as React from "react";
let buttonProps;
React.createElement("button", swcHelpers.extends({}, buttonProps), React.createElement("span", {
className: cx("class1", {
class2: !0
})
}));
swcHelpers.extends({}, buttonProps), cx("class1", {
class2: !0
});

View File

@ -2,8 +2,6 @@ var buttonProps;
import * as swcHelpers from "@swc/helpers";
import * as cx from "classnames";
import * as React from "react";
React.createElement("button", swcHelpers.extends({}, buttonProps), React.createElement("span", {
className: cx("class1", {
class2: !0
})
}));
swcHelpers.extends({}, buttonProps), cx("class1", {
class2: !0
});

View File

@ -2,8 +2,8 @@ import * as swcHelpers from "@swc/helpers";
import * as cx from "classnames";
import * as React from "react";
let buttonProps;
React.createElement("button", swcHelpers.extends({}, buttonProps, {
swcHelpers.extends({}, buttonProps, {
className: cx("class1", {
class2: !0
})
}));
});

View File

@ -2,8 +2,8 @@ var buttonProps;
import * as swcHelpers from "@swc/helpers";
import * as cx from "classnames";
import * as React from "react";
React.createElement("button", swcHelpers.extends({}, buttonProps, {
swcHelpers.extends({}, buttonProps, {
className: cx("class1", {
class2: !0
})
}));
});

View File

@ -1,4 +1,3 @@
import { h, Frag } from "./preact";
import { h } from "./snabbdom";
import { h } from "./preact";
h(Frag, null, h("span", null)), h(Frag, null, h("div", null)), h(Frag, null, h("div", null)), h(Frag, null, h("span", null));

View File

@ -1,4 +1,3 @@
import { h, Frag } from "./preact";
import { h } from "./snabbdom";
import { h } from "./preact";
h(Frag, null, h("span", null)), h(Frag, null, h("div", null)), h(Frag, null, h("div", null)), h(Frag, null, h("span", null));

View File

@ -4,6 +4,3 @@ import { Fragment } from "./renderer";
import "./renderer";
import { h, Fragment } from "./renderer";
import { h } from "./renderer";
h(Fragment, null, h("div", null)), h(Fragment, null, h("span", null)), h(Fragment, null), h(Fragment, null), h(Fragment, null), h(Fragment, null), h("div", null), h("div", null), h(function() {
return null;
}, null);

View File

@ -4,6 +4,3 @@ import { Fragment } from "./renderer";
import "./renderer";
import { h, Fragment } from "./renderer";
import { h } from "./renderer";
h(Fragment, null, h("div", null)), h(Fragment, null, h("span", null)), h(Fragment, null), h(Fragment, null), h(Fragment, null), h(Fragment, null), h("div", null), h("div", null), h(function() {
return null;
}, null);

View File

@ -21,36 +21,3 @@ export const tree = predom(MySFC, {
y: 6
}));
export default predom("h", null);
predom("h", null);
const DOMSFC = (props)=>predom("p", null, props.x, " + ", props.y, " = ", props.x + props.y, props.children)
;
class DOMClass {
render() {
return predom("p", null, this.props.x, " + ", this.props.y, " = ", this.props.x + this.props.y);
}
constructor(props){
this.props = props;
}
}
predom(DOMSFC, {
x: 1,
y: 2
}, predom(DOMClass, {
x: 3,
y: 4
}), predom(DOMClass, {
x: 5,
y: 6
})), predom(MySFC, {
x: 1,
y: 2
}, predom(MyClass, {
x: 3,
y: 4
}), predom(MyClass, {
x: 5,
y: 6
})), predom(DOMSFC, {
x: 1,
y: 2
}, tree, tree);

View File

@ -24,10 +24,7 @@ export var tree = predom(MySFC, {
y: 6
}));
export default predom("h", null);
predom("h", null);
var DOMSFC = function(props) {
return predom("p", null, props.x, " + ", props.y, " = ", props.x + props.y, props.children);
}, DOMClass = function() {
var DOMClass = function() {
"use strict";
function DOMClass(props) {
swcHelpers.classCallCheck(this, DOMClass), this.props = props;
@ -36,25 +33,3 @@ var DOMSFC = function(props) {
return predom("p", null, this.props.x, " + ", this.props.y, " = ", this.props.x + this.props.y);
}, DOMClass;
}();
predom(DOMSFC, {
x: 1,
y: 2
}, predom(DOMClass, {
x: 3,
y: 4
}), predom(DOMClass, {
x: 5,
y: 6
})), predom(MySFC, {
x: 1,
y: 2
}, predom(MyClass, {
x: 3,
y: 4
}), predom(MyClass, {
x: 5,
y: 6
})), predom(DOMSFC, {
x: 1,
y: 2
}, tree, tree);

View File

@ -1,4 +1,3 @@
import { predom } from "./renderer2";
import prerendered from "./component";
export default predom("h", null);
predom("h", null);

View File

@ -1,4 +1,3 @@
import { predom } from "./renderer2";
import prerendered from "./component";
export default predom("h", null);
predom("h", null);

View File

@ -1,4 +1,3 @@
import { dom } from "./renderer";
import { p } from "./renderer";
dom("h", null), dom("h", null);
export { dom as p };

View File

@ -1,4 +1,3 @@
import { dom } from "./renderer";
import { p } from "./renderer";
dom("h", null), dom("h", null);
export { dom as p };

View File

@ -1,2 +1,2 @@
import * as React from "./renderer";
React.createElement(React.Fragment, null, React.createElement("h", null)), React.createElement(React.Fragment, null, React.createElement("h", null));
React.Fragment, React.Fragment;

View File

@ -1,2 +1,2 @@
import * as React from "./renderer";
React.createElement(React.Fragment, null, React.createElement("h", null)), React.createElement(React.Fragment, null, React.createElement("h", null));
React.Fragment, React.Fragment;

View File

@ -1,6 +1,3 @@
import * as React from "react";
import * as React from "react";
React.createElement(MyComp, {
a: 10,
b: "hi"
});
MyComp;

View File

@ -1,6 +1,3 @@
import * as React from "react";
import * as React from "react";
React.createElement(MyComp, {
a: 10,
b: "hi"
});
MyComp;

View File

@ -1,2 +1,2 @@
React.createElement("div", null, "text");
"text";
export { };

View File

@ -1,2 +1,2 @@
React.createElement("div", null, "text");
"text";
export { };

View File

@ -1,19 +1,2 @@
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
import "./preact";
_jsxs(_Fragment, {
children: [
_jsx("p", {}),
"text",
_jsx("div", {
className: "foo"
})
]
}), _jsxs(_Fragment, {
children: [
_jsx("p", {}),
"text",
_jsx("div", {
className: "foo"
})
]
});

View File

@ -1,19 +1,2 @@
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
import "./preact";
_jsxs(_Fragment, {
children: [
_jsx("p", {}),
"text",
_jsx("div", {
className: "foo"
})
]
}), _jsxs(_Fragment, {
children: [
_jsx("p", {}),
"text",
_jsx("div", {
className: "foo"
})
]
});

View File

@ -1,4 +1,2 @@
React.createElement(React.Fragment, null, React.createElement("p", null), "text", React.createElement("div", {
className: "foo"
}));
React.Fragment;
export { };

View File

@ -1,4 +1,2 @@
React.createElement(React.Fragment, null, React.createElement("p", null), "text", React.createElement("div", {
className: "foo"
}));
React.Fragment;
export { };

View File

@ -5,18 +5,18 @@ import "./preact";
const props = {
answer: 42
};
_jsx("div", swcHelpers.objectSpread({}, props, {
swcHelpers.objectSpread({}, props, {
children: "text"
}), "foo"), _createElement("div", swcHelpers.objectSpread({}, props, {
}), swcHelpers.objectSpread({}, props, {
key: "bar",
children: "text"
}));
});
const props2 = {
answer: 42
};
_jsx("div", swcHelpers.objectSpread({}, props2, {
swcHelpers.objectSpread({}, props2, {
children: "text"
}), "foo"), _createElement("div", swcHelpers.objectSpread({}, props2, {
}), swcHelpers.objectSpread({}, props2, {
key: "bar",
children: "text"
}));
});

View File

@ -5,18 +5,18 @@ import "./preact";
var props = {
answer: 42
};
_jsx("div", swcHelpers.objectSpread({}, props, {
swcHelpers.objectSpread({}, props, {
children: "text"
}), "foo"), _createElement("div", swcHelpers.objectSpread({}, props, {
}), swcHelpers.objectSpread({}, props, {
key: "bar",
children: "text"
}));
});
var props2 = {
answer: 42
};
_jsx("div", swcHelpers.objectSpread({}, props2, {
swcHelpers.objectSpread({}, props2, {
children: "text"
}), "foo"), _createElement("div", swcHelpers.objectSpread({}, props2, {
}), swcHelpers.objectSpread({}, props2, {
key: "bar",
children: "text"
}));
});

View File

@ -2,8 +2,8 @@ import * as swcHelpers from "@swc/helpers";
const props = {
answer: 42
};
React.createElement("div", swcHelpers.extends({
swcHelpers.extends({
key: "foo"
}, props), "text"), React.createElement("div", swcHelpers.extends({}, props, {
}, props), swcHelpers.extends({}, props, {
key: "bar"
}), "text");
});

View File

@ -2,8 +2,8 @@ import * as swcHelpers from "@swc/helpers";
var props = {
answer: 42
};
React.createElement("div", swcHelpers.extends({
swcHelpers.extends({
key: "foo"
}, props), "text"), React.createElement("div", swcHelpers.extends({}, props, {
}, props), swcHelpers.extends({}, props, {
key: "bar"
}), "text");
});

View File

@ -2,8 +2,8 @@ import * as swcHelpers from "@swc/helpers";
const props = {
answer: 42
};
React.createElement("div", swcHelpers.extends({
swcHelpers.extends({
key: "foo"
}, props), "text"), React.createElement("div", swcHelpers.extends({}, props, {
}, props), swcHelpers.extends({}, props, {
key: "bar"
}), "text");
});

View File

@ -2,8 +2,8 @@ import * as swcHelpers from "@swc/helpers";
var props = {
answer: 42
};
React.createElement("div", swcHelpers.extends({
swcHelpers.extends({
key: "foo"
}, props), "text"), React.createElement("div", swcHelpers.extends({}, props, {
}, props), swcHelpers.extends({}, props, {
key: "bar"
}), "text");
});

View File

@ -1,2 +1,2 @@
React.createElement(React.Fragment, null, React.createElement("p", null), "text", React.createElement("div", null));
React.Fragment;
export { };

View File

@ -1,2 +1,2 @@
React.createElement(React.Fragment, null, React.createElement("p", null), "text", React.createElement("div", null));
React.Fragment;
export { };

View File

@ -1,2 +1 @@
React.createElement("div", null);
export { };

View File

@ -1,2 +1 @@
React.createElement("div", null);
export { };

View File

@ -1 +0,0 @@
React.createElement("public-foo", null), React.createElement("public", null);

View File

@ -1 +0,0 @@
React.createElement("public-foo", null), React.createElement("public", null);

View File

@ -1,38 +1,30 @@
import * as swcHelpers from "@swc/helpers";
React.createElement("div", null, "text"), React.createElement("div", null, this.props.children), React.createElement("div", null, React.createElement("div", null, React.createElement("br", null)), React.createElement(Component, null, foo, React.createElement("br", null), bar), React.createElement("br", null)), React.createElement(Composite, null, this.props.children), React.createElement(Composite, null, React.createElement(Composite2, null));
this.props.children, Component, foo, bar, Composite, this.props.children, Composite, Composite2;
var x = React.createElement("div", {
attr1: "foobar",
attr2: "foobarbazbug",
attr3: "foobarbazbug",
attr4: "baz"
});
React.createElement("div", null, React.createElement("span", null), React.createElement("br", null)), React.createElement("div", {
attr1: "foo"
}, React.createElement("span", {
attr2: "bar"
})), React.createElement("div", null, "\xa0"), React.createElement("div", null, "\xa0 "), React.createElement("hasOwnProperty", null, "testing"), React.createElement(Component, {
constructor: "foo"
}), React.createElement(Namespace.Component, null), React.createElement(Namespace.DeepNamespace.Component, null), React.createElement(Component, swcHelpers.extends({}, x, {
Namespace.Component, Namespace.DeepNamespace.Component, Component, swcHelpers.extends({}, x, {
y: 2,
z: !0
})), React.createElement(Component, swcHelpers.extends({}, this.props, {
}), Component, swcHelpers.extends({}, this.props, {
sound: "moo"
})), React.createElement("font-face", null), React.createElement(Component, {
x: y
}), React.createElement("x-component", null), React.createElement(Component, swcHelpers.extends({}, x)), React.createElement(Component, swcHelpers.extends({}, x, {
}), Component, swcHelpers.extends({}, x), Component, swcHelpers.extends({}, x, {
y: 2
})), React.createElement(Component, swcHelpers.extends({}, x, {
}), Component, swcHelpers.extends({}, x, {
y: 2,
z: !0
})), React.createElement(Component, swcHelpers.extends({
}), Component, swcHelpers.extends({
x: 1
}, y)), React.createElement(Component, swcHelpers.extends({
}, y), Component, swcHelpers.extends({
x: 1,
y: "2"
}, z, z), React.createElement(Child, null)), React.createElement(Component, swcHelpers.extends({
}, z, z), Child, Component, swcHelpers.extends({
x: "1"
}, z = {
y: 2
}, {
z: 3
}), "Text");
});

View File

@ -1,38 +1,30 @@
import * as swcHelpers from "@swc/helpers";
React.createElement("div", null, "text"), React.createElement("div", null, this.props.children), React.createElement("div", null, React.createElement("div", null, React.createElement("br", null)), React.createElement(Component, null, foo, React.createElement("br", null), bar), React.createElement("br", null)), React.createElement(Composite, null, this.props.children), React.createElement(Composite, null, React.createElement(Composite2, null));
this.props.children, Component, foo, bar, Composite, this.props.children, Composite, Composite2;
var x = React.createElement("div", {
attr1: "foobar",
attr2: "foobarbazbug",
attr3: "foobarbazbug",
attr4: "baz"
});
React.createElement("div", null, React.createElement("span", null), React.createElement("br", null)), React.createElement("div", {
attr1: "foo"
}, React.createElement("span", {
attr2: "bar"
})), React.createElement("div", null, "\xa0"), React.createElement("div", null, "\xa0 "), React.createElement("hasOwnProperty", null, "testing"), React.createElement(Component, {
constructor: "foo"
}), React.createElement(Namespace.Component, null), React.createElement(Namespace.DeepNamespace.Component, null), React.createElement(Component, swcHelpers.extends({}, x, {
Namespace.Component, Namespace.DeepNamespace.Component, Component, swcHelpers.extends({}, x, {
y: 2,
z: !0
})), React.createElement(Component, swcHelpers.extends({}, this.props, {
}), Component, swcHelpers.extends({}, this.props, {
sound: "moo"
})), React.createElement("font-face", null), React.createElement(Component, {
x: y
}), React.createElement("x-component", null), React.createElement(Component, swcHelpers.extends({}, x)), React.createElement(Component, swcHelpers.extends({}, x, {
}), Component, swcHelpers.extends({}, x), Component, swcHelpers.extends({}, x, {
y: 2
})), React.createElement(Component, swcHelpers.extends({}, x, {
}), Component, swcHelpers.extends({}, x, {
y: 2,
z: !0
})), React.createElement(Component, swcHelpers.extends({
}), Component, swcHelpers.extends({
x: 1
}, y)), React.createElement(Component, swcHelpers.extends({
}, y), Component, swcHelpers.extends({
x: 1,
y: "2"
}, z, z), React.createElement(Child, null)), React.createElement(Component, swcHelpers.extends({
}, z, z), Child, Component, swcHelpers.extends({
x: "1"
}, z = {
y: 2
}, {
z: 3
}), "Text");
});

View File

@ -1,25 +1,25 @@
import * as swcHelpers from "@swc/helpers";
const React = require("react"), props = {
require("react");
const props = {
a: 1,
b: 1
}, Foo = (props1)=>React.createElement("div", null, props1.a)
;
React.createElement(Foo, swcHelpers.extends({}, props)), React.createElement(Foo, swcHelpers.extends({
};
swcHelpers.extends({}, props), swcHelpers.extends({
d: 1
}, props)), React.createElement(Foo, swcHelpers.extends({
}, props), swcHelpers.extends({
a: 1
}, props)), React.createElement(Foo, swcHelpers.extends({
}, props), swcHelpers.extends({
a: 1,
b: 2
}, props)), React.createElement(Foo, swcHelpers.extends({
}, props), swcHelpers.extends({
a: 1,
d: 1
}, props, {
d: 1
})), React.createElement(Foo, swcHelpers.extends({
}), swcHelpers.extends({
a: 1,
d: 1
}, props, {
a: 1,
d: 1
}));
});

View File

@ -1,26 +1,25 @@
import * as swcHelpers from "@swc/helpers";
var React = require("react"), props = {
require("react");
var props = {
a: 1,
b: 1
}, Foo = function(props1) {
return React.createElement("div", null, props1.a);
};
React.createElement(Foo, swcHelpers.extends({}, props)), React.createElement(Foo, swcHelpers.extends({
swcHelpers.extends({}, props), swcHelpers.extends({
d: 1
}, props)), React.createElement(Foo, swcHelpers.extends({
}, props), swcHelpers.extends({
a: 1
}, props)), React.createElement(Foo, swcHelpers.extends({
}, props), swcHelpers.extends({
a: 1,
b: 2
}, props)), React.createElement(Foo, swcHelpers.extends({
}, props), swcHelpers.extends({
a: 1,
d: 1
}, props, {
d: 1
})), React.createElement(Foo, swcHelpers.extends({
}), swcHelpers.extends({
a: 1,
d: 1
}, props, {
a: 1,
d: 1
}));
});

View File

@ -4,18 +4,3 @@ texts.push(100), texts.push(100), texts.push("100");
export function MyComponent() {
return React.createElement("div", null);
}
React.createElement("div", null, React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: "hooray"
}));

View File

@ -4,18 +4,3 @@ texts.push(100), texts.push(100), texts.push("100");
export function MyComponent() {
return React.createElement("div", null);
}
React.createElement("div", null, React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: 100
}), React.createElement(MyComponent, {
foo: "hooray"
}));

View File

@ -1,11 +1,4 @@
import * as swcHelpers from "@swc/helpers";
React.createElement("div", {
text: 42
}), React.createElement("div", {
width: "foo"
}), React.createElement("div", swcHelpers.extends({}, {
swcHelpers.extends({}, {
text: 100
})), React.createElement("span", {
foo: "bar",
bar: "foo"
});

View File

@ -1,11 +1,4 @@
import * as swcHelpers from "@swc/helpers";
React.createElement("div", {
text: 42
}), React.createElement("div", {
width: "foo"
}), React.createElement("div", swcHelpers.extends({}, {
swcHelpers.extends({}, {
text: 100
})), React.createElement("span", {
foo: "bar",
bar: "foo"
});

View File

@ -1,10 +1,3 @@
export class MyComponent {
render() {}
}
React.createElement(MyComponent, {
bar: "world"
}), React.createElement(MyComponent, {
bar: !0
}), React.createElement(MyComponent, {
"data-bar": "hello"
});

View File

@ -6,10 +6,3 @@ export var MyComponent = function() {
}
return MyComponent.prototype.render = function() {}, MyComponent;
}();
React.createElement(MyComponent, {
bar: "world"
}), React.createElement(MyComponent, {
bar: !0
}), React.createElement(MyComponent, {
"data-bar": "hello"
});

View File

@ -1,5 +0,0 @@
React.createElement(class {
render() {}
}, {
bar: "world"
});

View File

@ -6,6 +6,3 @@ var MyComponent = function() {
}
return MyComponent.prototype.render = function() {}, MyComponent;
}();
React.createElement(MyComponent, {
bar: "world"
});

View File

@ -1,2 +1 @@
const T = TestMod.Test;
React.createElement(T, null), React.createElement(TestMod.Test, null);
TestMod.Test, TestMod.Test;

View File

@ -1,2 +1 @@
var T = TestMod.Test;
React.createElement(T, null), React.createElement(TestMod.Test, null);
TestMod.Test, TestMod.Test;

View File

@ -1 +0,0 @@
React.createElement(function() {}, null);

View File

@ -1 +0,0 @@
React.createElement(function() {}, null);

View File

@ -4,13 +4,4 @@ class BigGreeter extends React.Component {
return React.createElement("div", null, "Default hi");
}
}
React.createElement(BigGreeter, {
prop1: "hello"
}), React.createElement(BigGreeter, {
ref: (input)=>{
this.textInput = input;
}
}), React.createElement(BigGreeter, {
"data-extra": "hi"
});
export { };

View File

@ -1,5 +1,5 @@
import * as swcHelpers from "@swc/helpers";
var _this = this, React = require("react"), BigGreeter = function(_Component) {
var React = require("react"), BigGreeter = function(_Component) {
"use strict";
swcHelpers.inherits(BigGreeter, _Component);
var _super = swcHelpers.createSuper(BigGreeter);
@ -10,12 +10,3 @@ var _this = this, React = require("react"), BigGreeter = function(_Component) {
return React.createElement("div", null, "Default hi");
}, BigGreeter;
}(React.Component);
React.createElement(BigGreeter, {
prop1: "hello"
}), React.createElement(BigGreeter, {
ref: function(input) {
_this.textInput = input;
}
}), React.createElement(BigGreeter, {
"data-extra": "hi"
});

View File

@ -4,8 +4,3 @@ export class AddressComp extends React.Component {
return null;
}
}
React.createElement(AddressComp, {
postalCode: "T1B 0L3",
street: "vancouver",
country: "CA"
});

View File

@ -11,8 +11,3 @@ export var AddressComp = function(_Component) {
return null;
}, AddressComp;
}(React.Component);
React.createElement(AddressComp, {
postalCode: "T1B 0L3",
street: "vancouver",
country: "CA"
});

View File

@ -1,23 +0,0 @@
React.createElement("test1", {
x: 0
}), React.createElement("test1", null), React.createElement("test1", {
"data-x": !0
}), React.createElement("test2", {
reqd: "true"
}), React.createElement("test2", {
reqd: "true"
}), React.createElement("test1", {
x: "0"
}), React.createElement("test1", {
y: 0
}), React.createElement("test1", {
y: "foo"
}), React.createElement("test1", {
x: "32"
}), React.createElement("test1", {
var: "10"
}), React.createElement("test2", null), React.createElement("test2", {
reqd: 10
}), React.createElement("var", {
var: "var"
});

View File

@ -1,23 +0,0 @@
React.createElement("test1", {
x: 0
}), React.createElement("test1", null), React.createElement("test1", {
"data-x": !0
}), React.createElement("test2", {
reqd: "true"
}), React.createElement("test2", {
reqd: "true"
}), React.createElement("test1", {
x: "0"
}), React.createElement("test1", {
y: 0
}), React.createElement("test1", {
y: "foo"
}), React.createElement("test1", {
x: "32"
}), React.createElement("test1", {
var: "10"
}), React.createElement("test2", null), React.createElement("test2", {
reqd: 10
}), React.createElement("var", {
var: "var"
});

Some files were not shown because too many files have changed in this diff Show More