We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Ethella commented on Sat Feb 15 2020
https://github.com/facebook/react-native/blob/0.59-stable/Libraries/Blob/URL.js#L157
RN does not support URL, need to rewrite it in a different format
URL
@Ethella commented on Wed Feb 19 2020
Two options,
This is will create overhead to developers
new URL
Will come back to find best solution
@smithki commented on Fri Feb 21 2020
This can be worked around using NodeJS url module: facebook/react-native#16434
url
There is also a polyfill specifically for this: https://github.com/charpeni/react-native-url-polyfill
@Ethella commented on Mon Feb 24 2020
@smithki I agree, there is quite a lot of workaround.
But the decision is if we proceed with the solution of 2 in 1 bundle in fortmatic-js,
react-native-url-polyfill
require ('react-native-url-polyfill')
Here's a copy of what I add to RN to make fortmatic-js work so far, some of them are not necessary. I'll prune them later.
if (typeof __dirname === 'undefined') global.__dirname = '/' if (typeof __filename === 'undefined') global.__filename = '' if (typeof process === 'undefined') { global.process = require('process') } else { const bProcess = require('process') for (var p in bProcess) { if (!(p in process)) { process[p] = bProcess[p] } } } global.Buffer = require('buffer').Buffer global.process = require('process') global.process.env.NODE_ENV = __DEV__ ? 'development' : 'production' if (typeof btoa === 'undefined') { global.btoa = function (str) { return new Buffer(str, 'binary').toString('base64') } } if (typeof atob === 'undefined') { global.atob = function (b64Encoded) { return new Buffer(b64Encoded, 'base64').toString('binary') } } process.browser = false if (typeof Buffer === 'undefined') global.Buffer = require('buffer').Buffer global.location = { protocol: 'file:' } const isDev = typeof __DEV__ === 'boolean' && __DEV__ process.env['NODE_ENV'] = isDev ? 'development' : 'production' if (typeof localStorage !== 'undefined') { localStorage.debug = isDev ? '*' : '' } import { URL, URLSearchParams } from "whatwg-url"; global.URL = URL; global.URLSearchParams = URLSearchParams; /* To inject window object for window.addEventListener */ if (global.window === undefined) { global.window = global; }
The text was updated successfully, but these errors were encountered:
smithki
No branches or pull requests
@Ethella commented on Sat Feb 15 2020
https://github.com/facebook/react-native/blob/0.59-stable/Libraries/Blob/URL.js#L157
RN does not support
URL
, need to rewrite it in a different format@Ethella commented on Wed Feb 19 2020
Two options,
import { URL, URLSearchParams } from "whatwg-url";
global.URL = URL;
global.URLSearchParams = URLSearchParams;
This is will create overhead to developers
new URL
in SDKLosing tidiness on SDK, and reinvent the wheel of an existing package
Will come back to find best solution
@smithki commented on Fri Feb 21 2020
This can be worked around using NodeJSurl
module: facebook/react-native#16434There is also a polyfill specifically for this: https://github.com/charpeni/react-native-url-polyfill
@Ethella commented on Mon Feb 24 2020
@smithki I agree, there is quite a lot of workaround.
But the decision is if we proceed with the solution of 2 in 1 bundle in fortmatic-js,
react-native-url-polyfill
andrequire ('react-native-url-polyfill')
Here's a copy of what I add to RN to make fortmatic-js work so far, some of them are not necessary. I'll prune them later.
The text was updated successfully, but these errors were encountered: