Преглед изворни кода

[RN] Drop no longer needed polyfills

They were required only on Android because of its old JSC version. With the JSC
version bump they are no longer required.
master
Saúl Ibarra Corretgé пре 6 година
родитељ
комит
a1cc9bce91
4 измењених фајлова са 4 додато и 39 уклоњено
  1. 0
    24
      index.android.js
  2. 4
    0
      package-lock.json
  3. 0
    2
      package.json
  4. 0
    13
      react/features/base/lib-jitsi-meet/native/polyfills-browser.js

+ 0
- 24
index.android.js Прегледај датотеку

@@ -1,26 +1,2 @@
1
-// The type field of react-native application loader's React Element is created
2
-// as number and not Symbol, because it's not been defined by the polyfill yet.
3
-// We import the application renderer, before Symbol is defined, in order to use
4
-// number types as well. Otherwise this will result in the invariant exception,
5
-// because fiber thingy will not recognise root react-native component as React
6
-// Element, but as an Object.
7
-//
8
-// See node_modules/react-native/Libraries/polyfills/babelHelpers.js
9
-// :babelHelpers.createRawReactElement - that's where first react-native element
10
-// is created (super early - it's the app loader).
11
-//
12
-// See node_modules/react-native/Libraries/Renderer/ReactNativeFiber-dev.js
13
-// and look for REACT_ELEMENT_TYPE definition - it's defined later when Symbol
14
-// has been defined and type will not match.
15
-//
16
-// As an alternative solution we could stop using/polyfilling Symbols and
17
-// replace with classpath string constants or some kind of a wrapper around
18
-// that.
19
-
20
-import 'react-native/Libraries/ReactNative/renderApplication';
21
-
22
-// Android doesn't provide Symbol
23
-import 'es6-symbol/implement';
24
-
25 1
 import './react/index.native';
26 2
 

+ 4
- 0
package-lock.json Прегледај датотеку

@@ -5727,6 +5727,7 @@
5727 5727
       "version": "1.0.0",
5728 5728
       "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
5729 5729
       "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
5730
+      "dev": true,
5730 5731
       "requires": {
5731 5732
         "es5-ext": "^0.10.9"
5732 5733
       }
@@ -6231,6 +6232,7 @@
6231 6232
       "version": "0.10.39",
6232 6233
       "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.39.tgz",
6233 6234
       "integrity": "sha512-AlaXZhPHl0po/uxMx1tyrlt1O86M6D5iVaDH8UgLfgek4kXTX6vzsRfJQWC2Ku+aG8pkw1XWzh9eTkwfVrsD5g==",
6235
+      "dev": true,
6234 6236
       "requires": {
6235 6237
         "es6-iterator": "~2.0.3",
6236 6238
         "es6-symbol": "~3.1.1"
@@ -6240,6 +6242,7 @@
6240 6242
       "version": "2.0.3",
6241 6243
       "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
6242 6244
       "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=",
6245
+      "dev": true,
6243 6246
       "requires": {
6244 6247
         "d": "1",
6245 6248
         "es5-ext": "^0.10.35",
@@ -6277,6 +6280,7 @@
6277 6280
       "version": "3.1.1",
6278 6281
       "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz",
6279 6282
       "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=",
6283
+      "dev": true,
6280 6284
       "requires": {
6281 6285
         "d": "1",
6282 6286
         "es5-ext": "~0.10.14"

+ 0
- 2
package.json Прегледај датотеку

@@ -36,8 +36,6 @@
36 36
     "@atlaskit/tooltip": "9.1.1",
37 37
     "@webcomponents/url": "0.7.1",
38 38
     "autosize": "1.18.13",
39
-    "es6-iterator": "2.0.3",
40
-    "es6-symbol": "3.1.1",
41 39
     "i18next": "8.4.3",
42 40
     "i18next-browser-languagedetector": "2.0.0",
43 41
     "i18next-xhr-backend": "1.4.2",

+ 0
- 13
react/features/base/lib-jitsi-meet/native/polyfills-browser.js Прегледај датотеку

@@ -1,4 +1,3 @@
1
-import Iterator from 'es6-iterator';
2 1
 import BackgroundTimer from 'react-native-background-timer';
3 2
 import '@webcomponents/url'; // Polyfill for URL constructor
4 3
 
@@ -123,18 +122,6 @@ function _visitNode(node, callback) {
123 122
         global.removeEventListener = () => {};
124 123
     }
125 124
 
126
-    // Array.prototype[@@iterator]
127
-    //
128
-    // Required by:
129
-    // - for...of statement use(s) in lib-jitsi-meet
130
-    const arrayPrototype = Array.prototype;
131
-
132
-    if (typeof arrayPrototype['@@iterator'] === 'undefined') {
133
-        arrayPrototype['@@iterator'] = function() {
134
-            return new Iterator(this);
135
-        };
136
-    }
137
-
138 125
     // document
139 126
     //
140 127
     // Required by:

Loading…
Откажи
Сачувај