Skip to content

Commit

Permalink
Remove prop-types (#1557)
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 authored Dec 10, 2023
1 parent 37fee55 commit b54bc75
Show file tree
Hide file tree
Showing 62 changed files with 4 additions and 642 deletions.
4 changes: 1 addition & 3 deletions packages/react-dock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@
"dependencies": {
"@babel/runtime": "^7.23.5",
"@types/lodash": "^4.14.202",
"@types/prop-types": "^15.7.11",
"lodash.debounce": "^4.0.8",
"prop-types": "^15.8.1"
"lodash.debounce": "^4.0.8"
},
"devDependencies": {
"@babel/cli": "^7.23.4",
Expand Down
16 changes: 0 additions & 16 deletions packages/react-dock/src/Dock.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component, ReactNode } from 'react';
import PropTypes from 'prop-types';
import debounce from 'lodash.debounce';
import type { DebouncedFunc } from 'lodash';
import autoprefix from './autoprefix';
Expand Down Expand Up @@ -260,21 +259,6 @@ export default class Dock extends Component<Props, State> {
isWindowResizing: false,
};

static propTypes = {
position: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),
zIndex: PropTypes.number,
fluid: PropTypes.bool,
size: PropTypes.number,
defaultSize: PropTypes.number,
dimMode: PropTypes.oneOf(['none', 'transparent', 'opaque']),
isVisible: PropTypes.bool,
onVisibleChange: PropTypes.func,
onSizeChange: PropTypes.func,
dimStyle: PropTypes.object,
dockStyle: PropTypes.object,
duration: PropTypes.number,
};

static defaultProps = {
position: 'left',
zIndex: 99999999,
Expand Down
2 changes: 0 additions & 2 deletions packages/redux-devtools-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@
"@redux-devtools/slider-monitor": "^4.1.0",
"@redux-devtools/ui": "^1.3.1",
"@reduxjs/toolkit": "^1.9.7",
"@types/prop-types": "^15.7.11",
"d3-state-visualizer": "^2.0.0",
"javascript-stringify": "^2.1.0",
"jsan": "^3.1.14",
"jsondiffpatch": "^0.5.0",
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"prop-types": "^15.8.1",
"react-icons": "^4.12.0",
"react-is": "^18.2.0",
"react-redux": "^8.1.3",
Expand Down
10 changes: 1 addition & 9 deletions packages/redux-devtools-app/src/components/BottomButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Button, Toolbar, Divider } from '@redux-devtools/ui';
import { MdSave } from 'react-icons/md';
import { Toolbar, Divider } from '@redux-devtools/ui';
import ExportButton from './buttons/ExportButton';
import ImportButton from './buttons/ImportButton';
import PrintButton from './buttons/PrintButton';
Expand All @@ -17,12 +15,6 @@ interface Props {
}

export default class BottomButtons extends Component<Props> {
static propTypes = {
dispatcherIsOpen: PropTypes.bool,
sliderIsOpen: PropTypes.bool,
options: PropTypes.object.isRequired,
};

shouldComponentUpdate(nextProps: Props) {
return (
nextProps.dispatcherIsOpen !== this.props.dispatcherIsOpen ||
Expand Down
8 changes: 0 additions & 8 deletions packages/redux-devtools-app/src/components/TopButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { ActionCreators, LiftedAction } from '@redux-devtools/core';
import { Button, Toolbar, Divider } from '@redux-devtools/ui';
import { Action } from 'redux';
Expand All @@ -20,13 +19,6 @@ interface Props {
}

export default class TopButtons extends Component<Props> {
static propTypes = {
// shouldSync: PropTypes.bool,
liftedState: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
options: PropTypes.object.isRequired,
};

shouldComponentUpdate(nextProps: Props) {
return (
nextProps.options !== this.props.options ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect, ResolveThunks } from 'react-redux';
import { Button } from '@redux-devtools/ui';
import { FaThumbtack } from 'react-icons/fa';
Expand Down
2 changes: 0 additions & 2 deletions packages/redux-devtools-dock-monitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
},
"dependencies": {
"@babel/runtime": "^7.23.5",
"@types/prop-types": "^15.7.11",
"parse-key": "^0.2.1",
"prop-types": "^15.8.1",
"react-dock": "^0.6.0"
},
"devDependencies": {
Expand Down
20 changes: 0 additions & 20 deletions packages/redux-devtools-dock-monitor/src/DockMonitor.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React, { cloneElement, Children, Component } from 'react';
import PropTypes from 'prop-types';
import { Dock } from 'react-dock';
import { Action, Dispatch } from 'redux';
import { LiftedState, Monitor } from '@redux-devtools/core';
import { POSITIONS } from './constants';
import {
toggleVisibility,
changeMonitor,
Expand Down Expand Up @@ -68,24 +66,6 @@ class DockMonitor<S, A extends Action<string>> extends Component<
> {
static update = reducer;

static propTypes = {
defaultPosition: PropTypes.oneOf(POSITIONS),
defaultIsVisible: PropTypes.bool.isRequired,
defaultSize: PropTypes.number.isRequired,
toggleVisibilityKey: PropTypes.string.isRequired,
changePositionKey: PropTypes.string.isRequired,
changeMonitorKey: PropTypes.string,
fluid: PropTypes.bool,

dispatch: PropTypes.func,
monitorState: PropTypes.shape({
position: PropTypes.oneOf(POSITIONS).isRequired,
size: PropTypes.number.isRequired,
isVisible: PropTypes.bool.isRequired,
childMonitorState: PropTypes.any,
}),
};

static defaultProps: DefaultProps = {
defaultIsVisible: true,
defaultPosition: 'right',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@
"dependencies": {
"@babel/runtime": "^7.23.5",
"@redux-devtools/ui": "^1.3.1",
"@types/prop-types": "^15.7.11",
"es6template": "^1.0.5",
"javascript-stringify": "^2.1.0",
"jsan": "^3.1.14",
"object-path": "^0.11.8",
"prop-types": "^15.8.1",
"react-icons": "^4.12.0",
"simple-diff": "^1.7.2"
},
Expand Down
17 changes: 0 additions & 17 deletions packages/redux-devtools-inspector-monitor-test-tab/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
Toolbar,
Container,
Expand Down Expand Up @@ -185,22 +184,6 @@ export class TestTab<S, A extends Action<string>> extends Component<
</Container>
);
}

static propTypes = {
monitorState: PropTypes.shape({
testGenerator: PropTypes.shape({
templates: PropTypes.array,
selected: PropTypes.number,
hideTip: PropTypes.bool,
}),
}).isRequired,
/*
options: PropTypes.shape({
lib: PropTypes.string
}).isRequired,
*/
updateMonitorState: PropTypes.func.isRequired,
};
}

export { default as reduxAvaTemplate } from './redux/ava';
Expand Down
2 changes: 0 additions & 2 deletions packages/redux-devtools-inspector-monitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@types/lodash": "^4.14.202",
"@types/prop-types": "^15.7.11",
"@types/redux-devtools-themes": "^1.0.3",
"dateformat": "^5.0.3",
"hex-rgba": "^1.0.2",
Expand All @@ -51,7 +50,6 @@
"jss": "^10.10.0",
"jss-preset-default": "^10.10.0",
"lodash.debounce": "^4.0.8",
"prop-types": "^15.8.1",
"react-base16-styling": "^0.9.1",
"react-json-tree": "^0.18.0",
"redux-devtools-themes": "^1.0.0"
Expand Down
11 changes: 0 additions & 11 deletions packages/redux-devtools-inspector-monitor/src/ActionListHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FunctionComponent } from 'react';
import PropTypes from 'prop-types';
import { StylingFunction } from 'react-base16-styling';
import RightSlider from './RightSlider';

Expand Down Expand Up @@ -65,14 +64,4 @@ const ActionListHeader: FunctionComponent<Props> = ({
</div>
);

ActionListHeader.propTypes = {
styling: PropTypes.func.isRequired,
onSearch: PropTypes.func.isRequired,
onCommit: PropTypes.func.isRequired,
onSweep: PropTypes.func.isRequired,
hideMainButtons: PropTypes.bool,
hasSkippedActions: PropTypes.bool.isRequired,
hasStagedActions: PropTypes.bool.isRequired,
};

export default ActionListHeader;
15 changes: 0 additions & 15 deletions packages/redux-devtools-inspector-monitor/src/ActionListRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { MouseEvent, MouseEventHandler, PureComponent } from 'react';
import PropTypes from 'prop-types';
import dateformat from 'dateformat';
import type { DebouncedFunc } from 'lodash';
import debounce from 'lodash.debounce';
Expand Down Expand Up @@ -37,20 +36,6 @@ export default class ActionListRow<
> extends PureComponent<Props<A>, State> {
state: State = { hover: false };

static propTypes = {
styling: PropTypes.func.isRequired,
isSelected: PropTypes.bool.isRequired,
action: PropTypes.object.isRequired,
isInFuture: PropTypes.bool.isRequired,
isInitAction: PropTypes.bool.isRequired,
onSelect: PropTypes.func.isRequired,
timestamps: PropTypes.shape({
current: PropTypes.number.isRequired,
previous: PropTypes.number.isRequired,
}).isRequired,
isSkipped: PropTypes.bool.isRequired,
};

render() {
const {
styling,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FunctionComponent } from 'react';
import PropTypes from 'prop-types';
import { Action } from 'redux';
import { StylingFunction } from 'react-base16-styling';
import { Tab } from './ActionPreview';
Expand Down Expand Up @@ -65,13 +64,4 @@ const ActionPreviewHeader: FunctionComponent<
</div>
);

ActionPreviewHeader.propTypes = {
tabs: PropTypes.array.isRequired,
styling: PropTypes.func.isRequired,
inspectedPath: PropTypes.array.isRequired,
onInspectPath: PropTypes.func.isRequired,
tabName: PropTypes.string.isRequired,
onSelectTab: PropTypes.func.isRequired,
};

export default ActionPreviewHeader;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Base16Theme } from 'redux-devtools-themes';
import {
getBase16Theme,
Expand Down Expand Up @@ -205,32 +204,6 @@ class DevtoolsInspector<S, A extends Action<string>> extends PureComponent<
themeState: createThemeState(this.props),
};

static propTypes = {
dispatch: PropTypes.func,
computedStates: PropTypes.array,
stagedActionIds: PropTypes.array,
actionsById: PropTypes.object,
currentStateIndex: PropTypes.number,
monitorState: PropTypes.shape({
initialScrollTop: PropTypes.number,
}),
preserveScrollTop: PropTypes.bool,
draggableActions: PropTypes.bool,
select: PropTypes.func.isRequired,
theme: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
supportImmutable: PropTypes.bool,
diffObjectHash: PropTypes.func,
diffPropertyFilter: PropTypes.func,
hideMainButtons: PropTypes.bool,
hideActionButtons: PropTypes.bool,
invertTheme: PropTypes.bool,
sortStateTreeAlphabetically: PropTypes.bool,
disableStateTreeCollection: PropTypes.bool,
skippedActionIds: PropTypes.array,
dataTypeKey: PropTypes.any,
tabs: PropTypes.oneOfType([PropTypes.array, PropTypes.func]),
};

static update = reducer;

static defaultProps = {
Expand Down
8 changes: 0 additions & 8 deletions packages/redux-devtools-inspector-monitor/src/RightSlider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FunctionComponent } from 'react';
import PropTypes from 'prop-types';
import { StylingFunction } from 'react-base16-styling';

interface Props {
Expand Down Expand Up @@ -27,11 +26,4 @@ const RightSlider: FunctionComponent<Props> = ({
</div>
);

RightSlider.propTypes = {
styling: PropTypes.func.isRequired,
shown: PropTypes.bool,
children: PropTypes.any.isRequired,
rotate: PropTypes.bool,
};

export default RightSlider;
11 changes: 0 additions & 11 deletions packages/redux-devtools-inspector-monitor/src/tabs/ActionTab.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FunctionComponent } from 'react';
import PropTypes from 'prop-types';
import { JSONTree } from 'react-json-tree';
import { Action } from 'redux';
import getItemString from './getItemString';
Expand Down Expand Up @@ -29,14 +28,4 @@ const ActionTab: FunctionComponent<
/>
);

ActionTab.propTypes = {
action: PropTypes.any.isRequired,
styling: PropTypes.func.isRequired,
base16Theme: PropTypes.any.isRequired,
invertTheme: PropTypes.bool.isRequired,
labelRenderer: PropTypes.func.isRequired,
dataTypeKey: PropTypes.string,
isWideLayout: PropTypes.bool.isRequired,
};

export default ActionTab;
11 changes: 0 additions & 11 deletions packages/redux-devtools-inspector-monitor/src/tabs/DiffTab.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FunctionComponent } from 'react';
import PropTypes from 'prop-types';
import JSONDiff from './JSONDiff';
import { TabComponentProps } from '../ActionPreview';
import { Action } from 'redux';
Expand Down Expand Up @@ -28,14 +27,4 @@ const DiffTab: FunctionComponent<
/>
);

DiffTab.propTypes = {
delta: PropTypes.any,
styling: PropTypes.func.isRequired,
base16Theme: PropTypes.any.isRequired,
invertTheme: PropTypes.bool.isRequired,
labelRenderer: PropTypes.func.isRequired,
isWideLayout: PropTypes.bool.isRequired,
dataTypeKey: PropTypes.oneOfType([PropTypes.string, PropTypes.symbol]),
};

export default DiffTab;
11 changes: 0 additions & 11 deletions packages/redux-devtools-inspector-monitor/src/tabs/StateTab.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import PropTypes from 'prop-types';
import { JSONTree } from 'react-json-tree';
import { Action } from 'redux';
import getItemString from './getItemString';
Expand Down Expand Up @@ -33,14 +32,4 @@ const StateTab: React.FunctionComponent<
/>
);

StateTab.propTypes = {
nextState: PropTypes.any.isRequired,
styling: PropTypes.func.isRequired,
base16Theme: PropTypes.any.isRequired,
invertTheme: PropTypes.bool.isRequired,
labelRenderer: PropTypes.func.isRequired,
dataTypeKey: PropTypes.oneOfType([PropTypes.string, PropTypes.symbol]),
isWideLayout: PropTypes.bool.isRequired,
};

export default StateTab;
Loading

0 comments on commit b54bc75

Please sign in to comment.