Browse Source

fix(rn) use a RN-friendly URL polyfill

The previous one no llonger works out of the box with RN.
j8
Saúl Ibarra Corretgé 5 years ago
parent
commit
65a9de346f
3 changed files with 36 additions and 7 deletions
  1. 34
    5
      package-lock.json
  2. 1
    1
      package.json
  3. 1
    1
      react/features/mobile/polyfills/browser.js

+ 34
- 5
package-lock.json View File

@@ -4833,11 +4833,6 @@
4833 4833
         "@xtuc/long": "4.2.2"
4834 4834
       }
4835 4835
     },
4836
-    "@webcomponents/url": {
4837
-      "version": "0.7.6",
4838
-      "resolved": "https://registry.npmjs.org/@webcomponents/url/-/url-0.7.6.tgz",
4839
-      "integrity": "sha512-u0713SyGVRdct1x+V+gRxDp2zMtHwPGaMjukhENqa6n+8H7Rgw4/lNhsk9DffPo3NoxEHv19iQJaI/Ab8Y+BKw=="
4840
-    },
4841 4836
     "@xtuc/ieee754": {
4842 4837
       "version": "1.2.0",
4843 4838
       "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
@@ -14276,6 +14271,14 @@
14276 14271
         }
14277 14272
       }
14278 14273
     },
14274
+    "react-native-url-polyfill": {
14275
+      "version": "1.2.0",
14276
+      "resolved": "https://registry.npmjs.org/react-native-url-polyfill/-/react-native-url-polyfill-1.2.0.tgz",
14277
+      "integrity": "sha512-hpLZ8RyS3oGVyTOe/HjoqVoCOSkeJvrCoEB3bJsY7t9uh7kpQDV6kgvdlECEafYpxe3RzMrKLVcmWRbPU7CuAw==",
14278
+      "requires": {
14279
+        "whatwg-url-without-unicode": "8.0.0-3"
14280
+      }
14281
+    },
14279 14282
     "react-native-watch-connectivity": {
14280 14283
       "version": "0.4.3",
14281 14284
       "resolved": "https://registry.npmjs.org/react-native-watch-connectivity/-/react-native-watch-connectivity-0.4.3.tgz",
@@ -17220,6 +17223,11 @@
17220 17223
         "defaults": "^1.0.3"
17221 17224
       }
17222 17225
     },
17226
+    "webidl-conversions": {
17227
+      "version": "5.0.0",
17228
+      "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz",
17229
+      "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA=="
17230
+    },
17223 17231
     "webpack": {
17224 17232
       "version": "4.43.0",
17225 17233
       "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.43.0.tgz",
@@ -18532,6 +18540,27 @@
18532 18540
       "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz",
18533 18541
       "integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ="
18534 18542
     },
18543
+    "whatwg-url-without-unicode": {
18544
+      "version": "8.0.0-3",
18545
+      "resolved": "https://registry.npmjs.org/whatwg-url-without-unicode/-/whatwg-url-without-unicode-8.0.0-3.tgz",
18546
+      "integrity": "sha512-HoKuzZrUlgpz35YO27XgD28uh/WJH4B0+3ttFqRo//lmq+9T/mIOJ6kqmINI9HpUpz1imRC/nR/lxKpJiv0uig==",
18547
+      "requires": {
18548
+        "buffer": "^5.4.3",
18549
+        "punycode": "^2.1.1",
18550
+        "webidl-conversions": "^5.0.0"
18551
+      },
18552
+      "dependencies": {
18553
+        "buffer": {
18554
+          "version": "5.6.0",
18555
+          "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",
18556
+          "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",
18557
+          "requires": {
18558
+            "base64-js": "^1.0.2",
18559
+            "ieee754": "^1.1.4"
18560
+          }
18561
+        }
18562
+      }
18563
+    },
18535 18564
     "which": {
18536 18565
       "version": "1.3.0",
18537 18566
       "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz",

+ 1
- 1
package.json View File

@@ -40,7 +40,6 @@
40 40
     "@svgr/webpack": "4.3.2",
41 41
     "@tensorflow-models/body-pix": "2.0.4",
42 42
     "@tensorflow/tfjs": "1.5.1",
43
-    "@webcomponents/url": "0.7.6",
44 43
     "amplitude-js": "7.1.1",
45 44
     "base64-js": "1.3.1",
46 45
     "bc-css-flags": "3.0.0",
@@ -83,6 +82,7 @@
83 82
     "react-native-splash-screen": "3.2.0",
84 83
     "react-native-svg": "10.1.0",
85 84
     "react-native-svg-transformer": "0.14.3",
85
+    "react-native-url-polyfill": "1.2.0",
86 86
     "react-native-watch-connectivity": "0.4.3",
87 87
     "react-native-webrtc": "1.84.0",
88 88
     "react-native-webview": "10.9.0",

+ 1
- 1
react/features/mobile/polyfills/browser.js View File

@@ -1,7 +1,7 @@
1 1
 import { Platform } from 'react-native';
2 2
 import BackgroundTimer from 'react-native-background-timer';
3 3
 
4
-import '@webcomponents/url'; // Polyfill for URL constructor
4
+import 'react-native-url-polyfill/auto'; // Complete URL polyfill.
5 5
 
6 6
 import Storage from './Storage';
7 7
 

Loading…
Cancel
Save