浏览代码

fix(rn) use a RN-friendly URL polyfill

The previous one no llonger works out of the box with RN.
master
Saúl Ibarra Corretgé 5 年前
父节点
当前提交
65a9de346f
共有 3 个文件被更改,包括 36 次插入7 次删除
  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 查看文件

4833
         "@xtuc/long": "4.2.2"
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
     "@xtuc/ieee754": {
4836
     "@xtuc/ieee754": {
4842
       "version": "1.2.0",
4837
       "version": "1.2.0",
4843
       "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
4838
       "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
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
     "react-native-watch-connectivity": {
14282
     "react-native-watch-connectivity": {
14280
       "version": "0.4.3",
14283
       "version": "0.4.3",
14281
       "resolved": "https://registry.npmjs.org/react-native-watch-connectivity/-/react-native-watch-connectivity-0.4.3.tgz",
14284
       "resolved": "https://registry.npmjs.org/react-native-watch-connectivity/-/react-native-watch-connectivity-0.4.3.tgz",
17220
         "defaults": "^1.0.3"
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
     "webpack": {
17231
     "webpack": {
17224
       "version": "4.43.0",
17232
       "version": "4.43.0",
17225
       "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.43.0.tgz",
17233
       "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.43.0.tgz",
18532
       "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz",
18540
       "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz",
18533
       "integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ="
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
     "which": {
18564
     "which": {
18536
       "version": "1.3.0",
18565
       "version": "1.3.0",
18537
       "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz",
18566
       "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz",

+ 1
- 1
package.json 查看文件

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

+ 1
- 1
react/features/mobile/polyfills/browser.js 查看文件

1
 import { Platform } from 'react-native';
1
 import { Platform } from 'react-native';
2
 import BackgroundTimer from 'react-native-background-timer';
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
 import Storage from './Storage';
6
 import Storage from './Storage';
7
 
7
 

正在加载...
取消
保存