ソースを参照

Merge pull request #3762 from saghul/no-prop-types

misc: drop dependency on prop-types and polyfill
j8
virtuacoplenny 7年前
コミット
2d57d22a3f
コミッターのメールアドレスに関連付けられたアカウントが存在しません

+ 0
- 6
app.js ファイルの表示

@@ -1,11 +1,5 @@
1 1
 /* application specific logic */
2 2
 
3
-// FIXME: remove once atlaskit work with React 16
4
-// It seems that @atlaskit/icon is importing PropTypes from React, but it
5
-// happens through some glyph coffee script template. It could be that more
6
-// things are broken there (not only the icon).
7
-import './react/features/base/react/prop-types-polyfill.js';
8
-
9 3
 import 'jquery';
10 4
 import 'jquery-contextmenu';
11 5
 import 'jQuery-Impromptu';

+ 0
- 35
flow-typed/npm/prop-types_v15.x.x.js ファイルの表示

@@ -1,35 +0,0 @@
1
-// flow-typed signature: d9a983bb1ac458a256c31c139047bdbb
2
-// flow-typed version: 927687984d/prop-types_v15.x.x/flow_>=v0.41.x
3
-
4
-type $npm$propTypes$ReactPropsCheckType = (
5
-  props: any,
6
-  propName: string,
7
-  componentName: string,
8
-  href?: string) => ?Error;
9
-
10
-declare module 'prop-types' {
11
-  declare var array: React$PropType$Primitive<Array<any>>;
12
-  declare var bool: React$PropType$Primitive<boolean>;
13
-  declare var func: React$PropType$Primitive<Function>;
14
-  declare var number: React$PropType$Primitive<number>;
15
-  declare var object: React$PropType$Primitive<Object>;
16
-  declare var string: React$PropType$Primitive<string>;
17
-  declare var symbol: React$PropType$Primitive<Symbol>;
18
-  declare var any: React$PropType$Primitive<any>;
19
-  declare var arrayOf: React$PropType$ArrayOf;
20
-  declare var element: React$PropType$Primitive<any>; /* TODO */
21
-  declare var instanceOf: React$PropType$InstanceOf;
22
-  declare var node: React$PropType$Primitive<any>; /* TODO */
23
-  declare var objectOf: React$PropType$ObjectOf;
24
-  declare var oneOf: React$PropType$OneOf;
25
-  declare var oneOfType: React$PropType$OneOfType;
26
-  declare var shape: React$PropType$Shape;
27
-
28
-  declare function checkPropTypes<V>(
29
-    propTypes: $Subtype<{[_: $Keys<V>]: $npm$propTypes$ReactPropsCheckType}>,
30
-    values: V,
31
-    location: string,
32
-    componentName: string,
33
-    getStack: ?(() => ?string)
34
-  ) : void;
35
-}

+ 0
- 12
package-lock.json ファイルの表示

@@ -691,18 +691,6 @@
691 691
         "react-scrolllock": "^3.0.2"
692 692
       }
693 693
     },
694
-    "@atlaskit/layer-manager": {
695
-      "version": "5.0.19",
696
-      "resolved": "https://registry.npmjs.org/@atlaskit/layer-manager/-/layer-manager-5.0.19.tgz",
697
-      "integrity": "sha512-2NvSNEERS9uW/oExF7ltj/h8akJvJRJnhEleKGx1JXqnbCUwQHtGkiP+06cX9JriGnhPEySt26dfQS5dAA0sKg==",
698
-      "requires": {
699
-        "@babel/runtime": "^7.0.0",
700
-        "prop-types": "^15.5.10",
701
-        "react-focus-lock": "^1.11.3",
702
-        "react-scrolllock": "^3.0.2",
703
-        "react-transition-group": "^2.2.1"
704
-      }
705
-    },
706 694
     "@atlaskit/lozenge": {
707 695
       "version": "6.2.4",
708 696
       "resolved": "https://registry.npmjs.org/@atlaskit/lozenge/-/lozenge-6.2.4.tgz",

+ 0
- 2
package.json ファイルの表示

@@ -25,7 +25,6 @@
25 25
     "@atlaskit/icon": "15.0.3",
26 26
     "@atlaskit/inline-dialog": "5.3.0",
27 27
     "@atlaskit/inline-message": "7.0.10",
28
-    "@atlaskit/layer-manager": "5.0.19",
29 28
     "@atlaskit/lozenge": "6.2.4",
30 29
     "@atlaskit/modal-dialog": "7.1.2",
31 30
     "@atlaskit/multi-select": "11.0.13",
@@ -56,7 +55,6 @@
56 55
     "moment": "2.19.4",
57 56
     "moment-duration-format": "2.2.2",
58 57
     "postis": "2.2.0",
59
-    "prop-types": "15.6.0",
60 58
     "react": "16.6.3",
61 59
     "react-dom": "16.6.3",
62 60
     "react-emoji-render": "0.4.6",

+ 10
- 34
react/features/base/dialog/components/web/StatelessDialog.js ファイルの表示

@@ -1,10 +1,8 @@
1 1
 // @flow
2 2
 
3 3
 import Button, { ButtonGroup } from '@atlaskit/button';
4
-import { withContextFromProps } from '@atlaskit/layer-manager';
5 4
 import Modal, { ModalFooter } from '@atlaskit/modal-dialog';
6 5
 import _ from 'lodash';
7
-import PropTypes from 'prop-types';
8 6
 import React, { Component } from 'react';
9 7
 
10 8
 import { translate } from '../../../i18n';
@@ -71,17 +69,6 @@ type Props = {
71 69
     width: string
72 70
 };
73 71
 
74
-/**
75
- * ContexTypes is used as a workaround for Atlaskit's modal being displayed
76
- * outside of the normal App hierarchy, thereby losing context. ContextType
77
- * is responsible for taking its props and passing them into children.
78
- *
79
- * @type {ReactElement}
80
- */
81
-const ContextProvider = withContextFromProps({
82
-    i18n: PropTypes.object
83
-});
84
-
85 72
 /**
86 73
  * Web dialog that uses atlaskit modal-dialog to display dialogs.
87 74
  */
@@ -136,27 +123,16 @@ class StatelessDialog extends Component<Props> {
136 123
                 onDialogDismissed = { this._onDialogDismissed }
137 124
                 shouldCloseOnEscapePress = { true }
138 125
                 width = { width || 'medium' }>
139
-                {
140
-
141
-                    /**
142
-                     * Wrapping the contents of {@link Modal} with
143
-                     * {@link ContextProvider} is a workaround for the
144
-                     * i18n context becoming undefined as modal gets rendered
145
-                     * outside of the normal react app context.
146
-                     */
147
-                }
148
-                <ContextProvider i18n = { this.props.i18n }>
149
-                    <div
150
-                        onKeyDown = { this._onKeyDown }
151
-                        ref = { this._setDialogElement }>
152
-                        <form
153
-                            className = 'modal-dialog-form'
154
-                            id = 'modal-dialog-form'
155
-                            onSubmit = { this._onSubmit }>
156
-                            { children }
157
-                        </form>
158
-                    </div>
159
-                </ContextProvider>
126
+                <div
127
+                    onKeyDown = { this._onKeyDown }
128
+                    ref = { this._setDialogElement }>
129
+                    <form
130
+                        className = 'modal-dialog-form'
131
+                        id = 'modal-dialog-form'
132
+                        onSubmit = { this._onSubmit }>
133
+                        { children }
134
+                    </form>
135
+                </div>
160 136
             </Modal>
161 137
         );
162 138
     }

+ 0
- 10
react/features/base/react/prop-types-polyfill.js ファイルの表示

@@ -1,10 +0,0 @@
1
-import React from 'react';
2
-import PropTypes from 'prop-types';
3
-
4
-/* eslint-disable react/no-deprecated */
5
-
6
-if (typeof React.PropTypes === 'undefined') {
7
-    React.PropTypes = PropTypes;
8
-}
9
-
10
-/* eslint-enable react/no-deprecated */

+ 0
- 3
react/features/settings/popup.js ファイルの表示

@@ -1,8 +1,5 @@
1 1
 /* global JitsiMeetJS */
2 2
 
3
-// FIXME: remove once atlaskit work with React 16.
4
-import '../base/react/prop-types-polyfill.js';
5
-
6 3
 import DeviceSelectionPopup from './DeviceSelectionPopup';
7 4
 
8 5
 let deviceSelectionPopup;

+ 0
- 4
webpack.config.js ファイルの表示

@@ -125,10 +125,6 @@ module.exports = [
125 125
                 './react/features/always-on-top/index.js',
126 126
 
127 127
             'dial_in_info_bundle': [
128
-
129
-                // atlaskit does not support React 16 prop-types
130
-                './react/features/base/react/prop-types-polyfill.js',
131
-
132 128
                 './react/features/invite/components/dial-in-info-page'
133 129
             ],
134 130
 

読み込み中…
キャンセル
保存