Skip to content

Commit 05339be

Browse files
committed
BREAKING CHANGE: remove prop-types
1 parent 2cac081 commit 05339be

File tree

132 files changed

+137
-2011
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+137
-2011
lines changed

.storybook/custom-header/version.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import PropTypes from 'prop-types';
2-
31
import DropdownMenu from '../../src/dropdown-menu/dropdown-menu';
42

53
import branches from '../branches.json';
@@ -44,8 +42,4 @@ const Version = ({version}: VersionProps) => (
4442
/>
4543
);
4644

47-
Version.propTypes = {
48-
version: PropTypes.string
49-
};
50-
5145
export default Version;

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- `palette.css` is removed
1010
- Table: `wideFirstColumn` is now `false` by default
1111
- Tag: `angled` prop is removed
12+
- propTypes are removed in favor of TypeScript
1213

1314
## [6.0.0](https://youtrack.jetbrains.com/issue/RG-2303/Release-Ring-UI-6.0)
1415

package-lock.json

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@
204204
"@types/combokeys": "^2.4.9",
205205
"@types/deep-equal": "^1.0.4",
206206
"@types/element-resize-detector": "^1.1.6",
207-
"@types/prop-types": "^15.7.12",
208207
"@types/react-virtualized": "9.21.30",
209208
"@types/util-deprecate": "^1.0.3",
210209
"@ungap/url-search-params": "^0.2.2",
@@ -233,7 +232,6 @@
233232
"postcss-loader": "^8.1.1",
234233
"postcss-modules-values-replace": "^4.2.0",
235234
"postcss-preset-env": "^10.0.0",
236-
"prop-types": "^15.8.1",
237235
"react-movable": "^3.3.1",
238236
"react-virtualized": "^9.22.5",
239237
"react-waypoint": "^10.3.0",

prepare-built-package.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const WHITE_LIST = [
2525
'highlight.js',
2626
'just-debounce-it',
2727
'memoize-one',
28-
'prop-types',
2928
'react-movable',
3029
'react-virtualized',
3130
'react-waypoint',

src/alert/alert.tsx

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {PureComponent, ReactNode} from 'react';
22
import * as React from 'react';
33
import classNames from 'classnames';
4-
import PropTypes from 'prop-types';
54

65
import exceptionIcon from '@jetbrains/icons/exception';
76
import checkmarkIcon from '@jetbrains/icons/checkmark';
@@ -60,10 +59,17 @@ const TypeToIconColor: Partial<Record<AlertType, Color>> = {
6059
export interface AlertProps {
6160
theme: Theme,
6261
timeout: number
62+
/**
63+
* Fires when alert starts closing if timeout is out or user clicks "Close" button
64+
*/
6365
onCloseRequest: ((event?: React.MouseEvent<HTMLElement>) => void)
6466
onClose: (() => void)
6567
isShaking: boolean
6668
isClosing: boolean
69+
/**
70+
* Whether an alert is rendered inside an **Alerts** container
71+
* or standalone.
72+
*/
6773
inline: boolean
6874
showWithAnimation: boolean
6975
closeable: boolean
@@ -88,31 +94,6 @@ interface State {
8894
* **Alert** is a component for displaying contextual notifications. If you want to display a stack of notifications, use **Alerts** instead.
8995
*/
9096
export default class Alert extends PureComponent<AlertProps, State> {
91-
static propTypes = {
92-
timeout: PropTypes.number,
93-
/**
94-
* Fires when alert starts closing if timeout is out or user clicks "Close" button
95-
*/
96-
onCloseRequest: PropTypes.func,
97-
onClose: PropTypes.func,
98-
isShaking: PropTypes.bool,
99-
isClosing: PropTypes.bool,
100-
/**
101-
* Whether an alert is rendered inside an **Alerts** container
102-
* or standalone.
103-
*/
104-
inline: PropTypes.bool,
105-
showWithAnimation: PropTypes.bool,
106-
closeable: PropTypes.bool,
107-
type: PropTypes.oneOf(Object.values(AlertType)),
108-
109-
children: PropTypes.node,
110-
className: PropTypes.string,
111-
captionClassName: PropTypes.string,
112-
closeButtonClassName: PropTypes.string,
113-
'data-test': PropTypes.string
114-
};
115-
11697
/** @override */
11798
static defaultProps = {
11899
theme: Theme.DARK,

src/alert/container.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {Children, cloneElement, PureComponent, HTMLAttributes, isValidElement} from 'react';
22
import {createPortal} from 'react-dom';
33
import classNames from 'classnames';
4-
import PropTypes from 'prop-types';
54

65
import styles from './container.css';
76

@@ -14,11 +13,6 @@ import styles from './container.css';
1413
export type AlertContainerProps = HTMLAttributes<HTMLDivElement>
1514

1615
export default class Alerts extends PureComponent<AlertContainerProps> {
17-
static propTypes = {
18-
children: PropTypes.node,
19-
className: PropTypes.string
20-
};
21-
2216
render() {
2317
const {children, className, ...restProps} = this.props;
2418
const classes = classNames(styles.alertContainer, className);

src/auth-dialog/auth-dialog.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {Component} from 'react';
2-
import PropTypes from 'prop-types';
32
import classNames from 'classnames';
43

54
import {Content} from '../island/island';
@@ -33,26 +32,6 @@ export interface AuthDialogProps {
3332
}
3433

3534
export default class AuthDialog extends Component<AuthDialogProps> {
36-
static propTypes = {
37-
className: PropTypes.string,
38-
title: PropTypes.string,
39-
errorMessage: PropTypes.string,
40-
serviceImage: PropTypes.string,
41-
serviceName: PropTypes.string,
42-
loginCaption: PropTypes.string,
43-
loginToCaption: PropTypes.string,
44-
45-
show: PropTypes.bool,
46-
cancelOnEsc: PropTypes.bool,
47-
confirmLabel: PropTypes.string,
48-
cancelLabel: PropTypes.string,
49-
tryAgainLabel: PropTypes.string,
50-
51-
onConfirm: PropTypes.func,
52-
onCancel: PropTypes.func,
53-
onTryAgain: PropTypes.func
54-
};
55-
5635
static defaultProps = {
5736
loginCaption: 'Log in',
5837
loginToCaption: 'Log in to %serviceName%',

src/auth/down-notification.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {ReactNode} from 'react';
22
import * as React from 'react';
3-
import PropTypes from 'prop-types';
43

54
import alertService from '../alert-service/alert-service';
65
import Alert from '../alert/alert';
@@ -46,14 +45,6 @@ function Message({translations, onCheckAgain}: BackendDownMessageProps) {
4645
</div>
4746
);
4847
}
49-
Message.propTypes = {
50-
translations: PropTypes.shape({
51-
backendIsNotAvailable: PropTypes.string,
52-
checkAgain: PropTypes.string,
53-
errorMessage: PropTypes.string
54-
}),
55-
onCheckAgain: PropTypes.func
56-
};
5748

5849
export interface OnBackendDownParams {
5950
translations: BackendDownTranslations

src/avatar/avatar.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {PureComponent, ImgHTMLAttributes} from 'react';
2-
import PropTypes from 'prop-types';
32
import classNames from 'classnames';
43

54
import {encodeURL, isDataURI, parseQueryString} from '../global/url';
@@ -35,19 +34,6 @@ export interface AvatarProps extends ImgHTMLAttributes<HTMLImageElement> {
3534
}
3635

3736
export default class Avatar extends PureComponent<AvatarProps> {
38-
static propTypes = {
39-
dpr: PropTypes.number,
40-
className: PropTypes.string,
41-
size: PropTypes.number,
42-
style: PropTypes.object,
43-
url: PropTypes.string,
44-
round: PropTypes.bool,
45-
subavatar: PropTypes.string,
46-
subavatarSize: PropTypes.number,
47-
username: PropTypes.string,
48-
skipParams: PropTypes.bool
49-
};
50-
5137
static defaultProps = {
5238
dpr: getPixelRatio(),
5339
size: Size.Size20,

0 commit comments

Comments
 (0)