fix(rn) use a RN-friendly URL polyfill

The previous one no llonger works out of the box with RN.
This commit is contained in:
Saúl Ibarra Corretgé 2020-10-14 21:18:01 +02:00 committed by Saúl Ibarra Corretgé
parent 036d810d46
commit 65a9de346f
3 changed files with 36 additions and 7 deletions

39
package-lock.json generated
View File

@ -4833,11 +4833,6 @@
"@xtuc/long": "4.2.2"
}
},
"@webcomponents/url": {
"version": "0.7.6",
"resolved": "https://registry.npmjs.org/@webcomponents/url/-/url-0.7.6.tgz",
"integrity": "sha512-u0713SyGVRdct1x+V+gRxDp2zMtHwPGaMjukhENqa6n+8H7Rgw4/lNhsk9DffPo3NoxEHv19iQJaI/Ab8Y+BKw=="
},
"@xtuc/ieee754": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
@ -14276,6 +14271,14 @@
}
}
},
"react-native-url-polyfill": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/react-native-url-polyfill/-/react-native-url-polyfill-1.2.0.tgz",
"integrity": "sha512-hpLZ8RyS3oGVyTOe/HjoqVoCOSkeJvrCoEB3bJsY7t9uh7kpQDV6kgvdlECEafYpxe3RzMrKLVcmWRbPU7CuAw==",
"requires": {
"whatwg-url-without-unicode": "8.0.0-3"
}
},
"react-native-watch-connectivity": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/react-native-watch-connectivity/-/react-native-watch-connectivity-0.4.3.tgz",
@ -17220,6 +17223,11 @@
"defaults": "^1.0.3"
}
},
"webidl-conversions": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz",
"integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA=="
},
"webpack": {
"version": "4.43.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-4.43.0.tgz",
@ -18532,6 +18540,27 @@
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz",
"integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ="
},
"whatwg-url-without-unicode": {
"version": "8.0.0-3",
"resolved": "https://registry.npmjs.org/whatwg-url-without-unicode/-/whatwg-url-without-unicode-8.0.0-3.tgz",
"integrity": "sha512-HoKuzZrUlgpz35YO27XgD28uh/WJH4B0+3ttFqRo//lmq+9T/mIOJ6kqmINI9HpUpz1imRC/nR/lxKpJiv0uig==",
"requires": {
"buffer": "^5.4.3",
"punycode": "^2.1.1",
"webidl-conversions": "^5.0.0"
},
"dependencies": {
"buffer": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",
"integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",
"requires": {
"base64-js": "^1.0.2",
"ieee754": "^1.1.4"
}
}
}
},
"which": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz",

View File

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

View File

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