Skip to content

Commit

Permalink
Cleaned up propTypes (seems eco system is moving to TS/Flow for that …
Browse files Browse the repository at this point in the history
…stuff), cleaned up unused upath dep, cleaned up other unused babel plugins, correced some semver versions being non caret, cleaned up emotion test.
  • Loading branch information
swernerx committed Jun 4, 2019
1 parent 1a1d18a commit b5e49da
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 476 deletions.
9 changes: 0 additions & 9 deletions __tests__/__fixtures__/emotion.js

This file was deleted.

12 changes: 0 additions & 12 deletions __tests__/__fixtures__/react_proptypes.js

This file was deleted.

33 changes: 0 additions & 33 deletions __tests__/__snapshots__/target-browser-dev.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@ before();
after();"
`;

exports[`Target: Browser: Dev emotion 1`] = `
"import { css as _css } from \\"emotion\\";
const className =
/*#__PURE__*/
_css({
name: \\"1vdp66k-className\\",
styles: \\"color:hotpink;label:className;\\"
});
function SomeComponent() {
return React.createElement(\\"div\\", {
className: className
}, \\"Some hotpink text.\\");
}"
`;

exports[`Target: Browser: Dev es2015: classes 1`] = `
"export class Component extends Other {
constructor() {
Expand Down Expand Up @@ -601,22 +584,6 @@ exports[`Target: Browser: Dev react: jsx spread 1`] = `
}"
`;
exports[`Target: Browser: Dev react: proptypes 1`] = `
"import React from \\"react\\";
import PropTypes from \\"prop-types\\";
class MyComponent extends React.Component {
render() {
return React.createElement(\\"div\\", null, this.props.userName);
}
}
MyComponent.propTypes = {
userName: PropTypes.string
};"
`;
exports[`Target: Browser: Dev require context 1`] = `
"if (process.env.NODE_ENV === \\"test\\") {
require('babel-plugin-require-context-hook/register')();
Expand Down
4 changes: 0 additions & 4 deletions __tests__/__snapshots__/target-browser-prod.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ exports[`Target: Browser: Prod comments 1`] = `"import _camelCase from\\"lodash/

exports[`Target: Browser: Prod deadcode 1`] = `"var STATIC=!1;!1,before(),!1,after();"`;

exports[`Target: Browser: Prod emotion 1`] = `"import _jsx from\\"@babel/runtime/helpers/esm/jsx\\";import{css as _css}from\\"emotion\\";var className=/*#__PURE__*/_css({name:\\"1vdp66k-className\\",styles:\\"color:hotpink;label:className;\\"}),_ref=/*#__PURE__*/_jsx(\\"div\\",{className:className},void 0,\\"Some hotpink text.\\");function SomeComponent(){return _ref}"`;

exports[`Target: Browser: Prod es2015: classes 1`] = `"import _inheritsLoose from\\"@babel/runtime/helpers/esm/inheritsLoose\\";export var Component=/*#__PURE__*/function(a){function b(){var b;return b=a.call(this)||this,b.flag=!0,b}_inheritsLoose(b,a);var c=b.prototype;return c.main=function main(){alert(this.foo)},b}(Other);"`;

exports[`Target: Browser: Prod es2015: for_off 1`] = `"import\\"core-js/modules/es.symbol\\";import\\"core-js/modules/es.symbol.description\\";import\\"core-js/modules/es.symbol.iterator\\";import\\"core-js/modules/es.array.iterator\\";import\\"core-js/modules/es.object.to-string\\";import\\"core-js/modules/es.string.iterator\\";import\\"core-js/modules/web.dom-collections.iterator\\";function test(){for(var a=tasks,b=Array.isArray(a),c=0,a=b?a:a[Symbol.iterator]();;){var d;if(b){if(c>=a.length)break;d=a[c++]}else{if(c=a.next(),c.done)break;d=c.value}try{executeCommands()}catch(a){console.error(\\"Error\\")}}}"`;
Expand Down Expand Up @@ -52,6 +50,4 @@ exports[`Target: Browser: Prod react: jsx 1`] = `"import _jsx from\\"@babel/runt

exports[`Target: Browser: Prod react: jsx spread 1`] = `"import\\"core-js/modules/es.object.assign\\";function render(a){return React.createElement(\\"h1\\",Object.assign({className:\\"large\\"},a),\\"Hello\\")}"`;

exports[`Target: Browser: Prod react: proptypes 1`] = `"import _jsx from\\"@babel/runtime/helpers/esm/jsx\\";import _inheritsLoose from\\"@babel/runtime/helpers/esm/inheritsLoose\\";import React from\\"react\\";var MyComponent=/*#__PURE__*/function(a){function b(){return a.apply(this,arguments)||this}_inheritsLoose(b,a);var c=b.prototype;return c.render=function render(){return _jsx(\\"div\\",{},void 0,this.props.userName)},b}(React.Component);"`;

exports[`Target: Browser: Prod require context 1`] = `"\\"test\\"===process.env.NODE_ENV&&require(\\"babel-plugin-require-context-hook/register\\")();var loader=require.context(__dirname,!1,/\\\\.js/);"`;
38 changes: 0 additions & 38 deletions __tests__/__snapshots__/target-node.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,6 @@ before();
after();"
`;

exports[`Target: NodeJS emotion 1`] = `
"\\"use strict\\";
var _emotion = require(\\"emotion\\");
const className =
/*#__PURE__*/
(0, _emotion.css)({
name: \\"1vdp66k-className\\",
styles: \\"color:hotpink;label:className;\\"
});
function SomeComponent() {
return React.createElement(\\"div\\", {
className: className
}, \\"Some hotpink text.\\");
}"
`;

exports[`Target: NodeJS es2015: classes 1`] = `
"\\"use strict\\";
Expand Down Expand Up @@ -769,25 +750,6 @@ function render(props) {
}"
`;
exports[`Target: NodeJS react: proptypes 1`] = `
"\\"use strict\\";
var _interopRequireDefault = require(\\"@babel/runtime/helpers/interopRequireDefault\\"),
_react = _interopRequireDefault(require(\\"react\\")),
_propTypes = _interopRequireDefault(require(\\"prop-types\\"));
class MyComponent extends _react.default.Component {
render() {
return _react.default.createElement(\\"div\\", null, this.props.userName);
}
}
MyComponent.propTypes = {
userName: _propTypes.default.string
};"
`;
exports[`Target: NodeJS require context 1`] = `
"\\"use strict\\";
Expand Down
45 changes: 0 additions & 45 deletions __tests__/__snapshots__/target-universal-node.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@ before();
after();"
`;

exports[`Target: Universal: Node Imports emotion 1`] = `
"import { css as _css } from \\"emotion\\";
var className =
/*#__PURE__*/
_css({
name: \\"1vdp66k-className\\",
styles: \\"color:hotpink;label:className;\\"
});
function SomeComponent() {
return React.createElement(\\"div\\", {
className: className
}, \\"Some hotpink text.\\");
}"
`;

exports[`Target: Universal: Node Imports es2015: classes 1`] = `
"import _inheritsLoose from \\"@babel/runtime/helpers/esm/inheritsLoose\\";
export var Component =
Expand Down Expand Up @@ -686,34 +669,6 @@ function render(props) {
}"
`;

exports[`Target: Universal: Node Imports react: proptypes 1`] = `
"import _inheritsLoose from \\"@babel/runtime/helpers/esm/inheritsLoose\\";
import React from \\"react\\";
import PropTypes from \\"prop-types\\";
var MyComponent =
/*#__PURE__*/
function (_React$Component) {
_inheritsLoose(MyComponent, _React$Component);
function MyComponent() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = MyComponent.prototype;
_proto.render = function render() {
return React.createElement(\\"div\\", null, this.props.userName);
};
return MyComponent;
}(React.Component);
MyComponent.propTypes = {
userName: PropTypes.string
};"
`;

exports[`Target: Universal: Node Imports require context 1`] = `
"if (process.env.NODE_ENV === \\"test\\") {
require('babel-plugin-require-context-hook/register')();
Expand Down
45 changes: 0 additions & 45 deletions __tests__/__snapshots__/target-universal.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@ before();
after();"
`;

exports[`Target: Universal emotion 1`] = `
"import { css as _css } from \\"emotion\\";
var className =
/*#__PURE__*/
_css({
name: \\"1vdp66k-className\\",
styles: \\"color:hotpink;label:className;\\"
});
function SomeComponent() {
return React.createElement(\\"div\\", {
className: className
}, \\"Some hotpink text.\\");
}"
`;

exports[`Target: Universal es2015: classes 1`] = `
"import _inheritsLoose from \\"@babel/runtime/helpers/esm/inheritsLoose\\";
export var Component =
Expand Down Expand Up @@ -682,34 +665,6 @@ function render(props) {
}"
`;

exports[`Target: Universal react: proptypes 1`] = `
"import _inheritsLoose from \\"@babel/runtime/helpers/esm/inheritsLoose\\";
import React from \\"react\\";
import PropTypes from \\"prop-types\\";
var MyComponent =
/*#__PURE__*/
function (_React$Component) {
_inheritsLoose(MyComponent, _React$Component);
function MyComponent() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = MyComponent.prototype;
_proto.render = function render() {
return React.createElement(\\"div\\", null, this.props.userName);
};
return MyComponent;
}(React.Component);
MyComponent.propTypes = {
userName: PropTypes.string
};"
`;

exports[`Target: Universal require context 1`] = `
"if (process.env.NODE_ENV === \\"test\\") {
require('babel-plugin-require-context-hook/register')();
Expand Down
33 changes: 0 additions & 33 deletions __tests__/__snapshots__/transpile-es2015.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@ before();
after();"
`;

exports[`Transpile: ES2015 emotion 1`] = `
"import { css as _css } from \\"emotion\\";
const className =
/*#__PURE__*/
_css({
name: \\"1vdp66k-className\\",
styles: \\"color:hotpink;label:className;\\"
});
function SomeComponent() {
return React.createElement(\\"div\\", {
className: className
}, \\"Some hotpink text.\\");
}"
`;

exports[`Transpile: ES2015 es2015: classes 1`] = `
"export class Component extends Other {
constructor() {
Expand Down Expand Up @@ -680,22 +663,6 @@ function render(props) {
}"
`;
exports[`Transpile: ES2015 react: proptypes 1`] = `
"import React from \\"react\\";
import PropTypes from \\"prop-types\\";
class MyComponent extends React.Component {
render() {
return React.createElement(\\"div\\", null, this.props.userName);
}
}
MyComponent.propTypes = {
userName: PropTypes.string
};"
`;
exports[`Transpile: ES2015 require context 1`] = `
"if (process.env.NODE_ENV === \\"test\\") {
require('babel-plugin-require-context-hook/register')();
Expand Down
45 changes: 0 additions & 45 deletions __tests__/__snapshots__/transpile-es5.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@ before();
after();"
`;

exports[`Transpile: ES5 emotion 1`] = `
"import { css as _css } from \\"emotion\\";
var className =
/*#__PURE__*/
_css({
name: \\"1vdp66k-className\\",
styles: \\"color:hotpink;label:className;\\"
});
function SomeComponent() {
return React.createElement(\\"div\\", {
className: className
}, \\"Some hotpink text.\\");
}"
`;

exports[`Transpile: ES5 es2015: classes 1`] = `
"import _inheritsLoose from \\"@babel/runtime/helpers/esm/inheritsLoose\\";
export var Component =
Expand Down Expand Up @@ -682,34 +665,6 @@ function render(props) {
}"
`;

exports[`Transpile: ES5 react: proptypes 1`] = `
"import _inheritsLoose from \\"@babel/runtime/helpers/esm/inheritsLoose\\";
import React from \\"react\\";
import PropTypes from \\"prop-types\\";
var MyComponent =
/*#__PURE__*/
function (_React$Component) {
_inheritsLoose(MyComponent, _React$Component);
function MyComponent() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = MyComponent.prototype;
_proto.render = function render() {
return React.createElement(\\"div\\", null, this.props.userName);
};
return MyComponent;
}(React.Component);
MyComponent.propTypes = {
userName: PropTypes.string
};"
`;

exports[`Transpile: ES5 require context 1`] = `
"if (process.env.NODE_ENV === \\"test\\") {
require('babel-plugin-require-context-hook/register')();
Expand Down
Loading

0 comments on commit b5e49da

Please sign in to comment.