Merge pull request #3762 from saghul/no-prop-types
misc: drop dependency on prop-types and polyfill
This commit is contained in:
commit
2d57d22a3f
6
app.js
6
app.js
|
@ -1,11 +1,5 @@
|
|||
/* application specific logic */
|
||||
|
||||
// FIXME: remove once atlaskit work with React 16
|
||||
// It seems that @atlaskit/icon is importing PropTypes from React, but it
|
||||
// happens through some glyph coffee script template. It could be that more
|
||||
// things are broken there (not only the icon).
|
||||
import './react/features/base/react/prop-types-polyfill.js';
|
||||
|
||||
import 'jquery';
|
||||
import 'jquery-contextmenu';
|
||||
import 'jQuery-Impromptu';
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
// flow-typed signature: d9a983bb1ac458a256c31c139047bdbb
|
||||
// flow-typed version: 927687984d/prop-types_v15.x.x/flow_>=v0.41.x
|
||||
|
||||
type $npm$propTypes$ReactPropsCheckType = (
|
||||
props: any,
|
||||
propName: string,
|
||||
componentName: string,
|
||||
href?: string) => ?Error;
|
||||
|
||||
declare module 'prop-types' {
|
||||
declare var array: React$PropType$Primitive<Array<any>>;
|
||||
declare var bool: React$PropType$Primitive<boolean>;
|
||||
declare var func: React$PropType$Primitive<Function>;
|
||||
declare var number: React$PropType$Primitive<number>;
|
||||
declare var object: React$PropType$Primitive<Object>;
|
||||
declare var string: React$PropType$Primitive<string>;
|
||||
declare var symbol: React$PropType$Primitive<Symbol>;
|
||||
declare var any: React$PropType$Primitive<any>;
|
||||
declare var arrayOf: React$PropType$ArrayOf;
|
||||
declare var element: React$PropType$Primitive<any>; /* TODO */
|
||||
declare var instanceOf: React$PropType$InstanceOf;
|
||||
declare var node: React$PropType$Primitive<any>; /* TODO */
|
||||
declare var objectOf: React$PropType$ObjectOf;
|
||||
declare var oneOf: React$PropType$OneOf;
|
||||
declare var oneOfType: React$PropType$OneOfType;
|
||||
declare var shape: React$PropType$Shape;
|
||||
|
||||
declare function checkPropTypes<V>(
|
||||
propTypes: $Subtype<{[_: $Keys<V>]: $npm$propTypes$ReactPropsCheckType}>,
|
||||
values: V,
|
||||
location: string,
|
||||
componentName: string,
|
||||
getStack: ?(() => ?string)
|
||||
) : void;
|
||||
}
|
|
@ -691,18 +691,6 @@
|
|||
"react-scrolllock": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"@atlaskit/layer-manager": {
|
||||
"version": "5.0.19",
|
||||
"resolved": "https://registry.npmjs.org/@atlaskit/layer-manager/-/layer-manager-5.0.19.tgz",
|
||||
"integrity": "sha512-2NvSNEERS9uW/oExF7ltj/h8akJvJRJnhEleKGx1JXqnbCUwQHtGkiP+06cX9JriGnhPEySt26dfQS5dAA0sKg==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.0.0",
|
||||
"prop-types": "^15.5.10",
|
||||
"react-focus-lock": "^1.11.3",
|
||||
"react-scrolllock": "^3.0.2",
|
||||
"react-transition-group": "^2.2.1"
|
||||
}
|
||||
},
|
||||
"@atlaskit/lozenge": {
|
||||
"version": "6.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@atlaskit/lozenge/-/lozenge-6.2.4.tgz",
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
"@atlaskit/icon": "15.0.3",
|
||||
"@atlaskit/inline-dialog": "5.3.0",
|
||||
"@atlaskit/inline-message": "7.0.10",
|
||||
"@atlaskit/layer-manager": "5.0.19",
|
||||
"@atlaskit/lozenge": "6.2.4",
|
||||
"@atlaskit/modal-dialog": "7.1.2",
|
||||
"@atlaskit/multi-select": "11.0.13",
|
||||
|
@ -56,7 +55,6 @@
|
|||
"moment": "2.19.4",
|
||||
"moment-duration-format": "2.2.2",
|
||||
"postis": "2.2.0",
|
||||
"prop-types": "15.6.0",
|
||||
"react": "16.6.3",
|
||||
"react-dom": "16.6.3",
|
||||
"react-emoji-render": "0.4.6",
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
// @flow
|
||||
|
||||
import Button, { ButtonGroup } from '@atlaskit/button';
|
||||
import { withContextFromProps } from '@atlaskit/layer-manager';
|
||||
import Modal, { ModalFooter } from '@atlaskit/modal-dialog';
|
||||
import _ from 'lodash';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { translate } from '../../../i18n';
|
||||
|
@ -71,17 +69,6 @@ type Props = {
|
|||
width: string
|
||||
};
|
||||
|
||||
/**
|
||||
* ContexTypes is used as a workaround for Atlaskit's modal being displayed
|
||||
* outside of the normal App hierarchy, thereby losing context. ContextType
|
||||
* is responsible for taking its props and passing them into children.
|
||||
*
|
||||
* @type {ReactElement}
|
||||
*/
|
||||
const ContextProvider = withContextFromProps({
|
||||
i18n: PropTypes.object
|
||||
});
|
||||
|
||||
/**
|
||||
* Web dialog that uses atlaskit modal-dialog to display dialogs.
|
||||
*/
|
||||
|
@ -136,27 +123,16 @@ class StatelessDialog extends Component<Props> {
|
|||
onDialogDismissed = { this._onDialogDismissed }
|
||||
shouldCloseOnEscapePress = { true }
|
||||
width = { width || 'medium' }>
|
||||
{
|
||||
|
||||
/**
|
||||
* Wrapping the contents of {@link Modal} with
|
||||
* {@link ContextProvider} is a workaround for the
|
||||
* i18n context becoming undefined as modal gets rendered
|
||||
* outside of the normal react app context.
|
||||
*/
|
||||
}
|
||||
<ContextProvider i18n = { this.props.i18n }>
|
||||
<div
|
||||
onKeyDown = { this._onKeyDown }
|
||||
ref = { this._setDialogElement }>
|
||||
<form
|
||||
className = 'modal-dialog-form'
|
||||
id = 'modal-dialog-form'
|
||||
onSubmit = { this._onSubmit }>
|
||||
{ children }
|
||||
</form>
|
||||
</div>
|
||||
</ContextProvider>
|
||||
<div
|
||||
onKeyDown = { this._onKeyDown }
|
||||
ref = { this._setDialogElement }>
|
||||
<form
|
||||
className = 'modal-dialog-form'
|
||||
id = 'modal-dialog-form'
|
||||
onSubmit = { this._onSubmit }>
|
||||
{ children }
|
||||
</form>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/* eslint-disable react/no-deprecated */
|
||||
|
||||
if (typeof React.PropTypes === 'undefined') {
|
||||
React.PropTypes = PropTypes;
|
||||
}
|
||||
|
||||
/* eslint-enable react/no-deprecated */
|
|
@ -1,8 +1,5 @@
|
|||
/* global JitsiMeetJS */
|
||||
|
||||
// FIXME: remove once atlaskit work with React 16.
|
||||
import '../base/react/prop-types-polyfill.js';
|
||||
|
||||
import DeviceSelectionPopup from './DeviceSelectionPopup';
|
||||
|
||||
let deviceSelectionPopup;
|
||||
|
|
|
@ -125,10 +125,6 @@ module.exports = [
|
|||
'./react/features/always-on-top/index.js',
|
||||
|
||||
'dial_in_info_bundle': [
|
||||
|
||||
// atlaskit does not support React 16 prop-types
|
||||
'./react/features/base/react/prop-types-polyfill.js',
|
||||
|
||||
'./react/features/invite/components/dial-in-info-page'
|
||||
],
|
||||
|
||||
|
|
Loading…
Reference in New Issue