@powersync/react-native 0.0.0-dev-20240703080040 → 0.0.0-dev-20240703093437
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js
CHANGED
|
@@ -22733,44 +22733,6 @@ class ReactNativeFetchProvider extends FetchImplementationProvider {
|
|
|
22733
22733
|
return fetch.bind(globalThis);
|
|
22734
22734
|
}
|
|
22735
22735
|
}
|
|
22736
|
-
const CommonPolyfills = [
|
|
22737
|
-
// {
|
|
22738
|
-
// name: 'TextEncoder',
|
|
22739
|
-
// test: () => typeof TextEncoder == 'undefined'
|
|
22740
|
-
// }
|
|
22741
|
-
];
|
|
22742
|
-
const SocketPolyfillTests = [
|
|
22743
|
-
...CommonPolyfills
|
|
22744
|
-
// {
|
|
22745
|
-
// name: 'nextTick',
|
|
22746
|
-
// test: () => typeof process.nextTick == 'undefined'
|
|
22747
|
-
// },
|
|
22748
|
-
// {
|
|
22749
|
-
// name: 'Buffer',
|
|
22750
|
-
// test: () => typeof global.Buffer == 'undefined'
|
|
22751
|
-
// }
|
|
22752
|
-
];
|
|
22753
|
-
const HttpPolyfillTests = [
|
|
22754
|
-
...CommonPolyfills
|
|
22755
|
-
// {
|
|
22756
|
-
// name: 'TextDecoder',
|
|
22757
|
-
// test: () => typeof TextDecoder == 'undefined'
|
|
22758
|
-
// },
|
|
22759
|
-
// {
|
|
22760
|
-
// name: 'ReadableStream',
|
|
22761
|
-
// test: () => typeof ReadableStream == 'undefined'
|
|
22762
|
-
// }
|
|
22763
|
-
];
|
|
22764
|
-
const validatePolyfills = (tests) => {
|
|
22765
|
-
const missingPolyfills = tests.filter((t) => t.test()).map((t) => t.name);
|
|
22766
|
-
if (missingPolyfills.length) {
|
|
22767
|
-
throw new Error(`
|
|
22768
|
-
Polyfills are undefined. Please ensure React Native polyfills are installed and imported in the app entrypoint.
|
|
22769
|
-
See package README for detailed instructions.
|
|
22770
|
-
The following polyfills appear to be missing:
|
|
22771
|
-
${missingPolyfills.join('\n')}`);
|
|
22772
|
-
}
|
|
22773
|
-
};
|
|
22774
22736
|
class ReactNativeRemote extends AbstractRemote {
|
|
22775
22737
|
connector;
|
|
22776
22738
|
logger;
|
|
@@ -22786,11 +22748,9 @@ class ReactNativeRemote extends AbstractRemote {
|
|
|
22786
22748
|
return bson.BSON;
|
|
22787
22749
|
}
|
|
22788
22750
|
async socketStream(options) {
|
|
22789
|
-
validatePolyfills(SocketPolyfillTests);
|
|
22790
22751
|
return super.socketStream(options);
|
|
22791
22752
|
}
|
|
22792
22753
|
async postStream(options) {
|
|
22793
|
-
validatePolyfills(HttpPolyfillTests);
|
|
22794
22754
|
const timeout = reactNative.Platform.OS == 'android'
|
|
22795
22755
|
? setTimeout(() => {
|
|
22796
22756
|
this.logger.warn(`HTTP Streaming POST is taking longer than ${Math.ceil(STREAMING_POST_TIMEOUT_MS / 1000)} seconds to resolve. If using a debug build, please ensure Flipper Network plugin is disabled.`);
|
|
@@ -23452,4 +23412,3 @@ Object.keys(react).forEach(function (k) {
|
|
|
23452
23412
|
get: function () { return react[k]; }
|
|
23453
23413
|
});
|
|
23454
23414
|
});
|
|
23455
|
-
//# sourceMappingURL=main.js.map
|
|
@@ -14,44 +14,6 @@ class ReactNativeFetchProvider extends FetchImplementationProvider {
|
|
|
14
14
|
return fetch.bind(globalThis);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
const CommonPolyfills = [
|
|
18
|
-
// {
|
|
19
|
-
// name: 'TextEncoder',
|
|
20
|
-
// test: () => typeof TextEncoder == 'undefined'
|
|
21
|
-
// }
|
|
22
|
-
];
|
|
23
|
-
const SocketPolyfillTests = [
|
|
24
|
-
...CommonPolyfills
|
|
25
|
-
// {
|
|
26
|
-
// name: 'nextTick',
|
|
27
|
-
// test: () => typeof process.nextTick == 'undefined'
|
|
28
|
-
// },
|
|
29
|
-
// {
|
|
30
|
-
// name: 'Buffer',
|
|
31
|
-
// test: () => typeof global.Buffer == 'undefined'
|
|
32
|
-
// }
|
|
33
|
-
];
|
|
34
|
-
const HttpPolyfillTests = [
|
|
35
|
-
...CommonPolyfills
|
|
36
|
-
// {
|
|
37
|
-
// name: 'TextDecoder',
|
|
38
|
-
// test: () => typeof TextDecoder == 'undefined'
|
|
39
|
-
// },
|
|
40
|
-
// {
|
|
41
|
-
// name: 'ReadableStream',
|
|
42
|
-
// test: () => typeof ReadableStream == 'undefined'
|
|
43
|
-
// }
|
|
44
|
-
];
|
|
45
|
-
const validatePolyfills = (tests) => {
|
|
46
|
-
const missingPolyfills = tests.filter((t) => t.test()).map((t) => t.name);
|
|
47
|
-
if (missingPolyfills.length) {
|
|
48
|
-
throw new Error(`
|
|
49
|
-
Polyfills are undefined. Please ensure React Native polyfills are installed and imported in the app entrypoint.
|
|
50
|
-
See package README for detailed instructions.
|
|
51
|
-
The following polyfills appear to be missing:
|
|
52
|
-
${missingPolyfills.join('\n')}`);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
17
|
export class ReactNativeRemote extends AbstractRemote {
|
|
56
18
|
connector;
|
|
57
19
|
logger;
|
|
@@ -67,11 +29,9 @@ export class ReactNativeRemote extends AbstractRemote {
|
|
|
67
29
|
return BSON;
|
|
68
30
|
}
|
|
69
31
|
async socketStream(options) {
|
|
70
|
-
validatePolyfills(SocketPolyfillTests);
|
|
71
32
|
return super.socketStream(options);
|
|
72
33
|
}
|
|
73
34
|
async postStream(options) {
|
|
74
|
-
validatePolyfills(HttpPolyfillTests);
|
|
75
35
|
const timeout = Platform.OS == 'android'
|
|
76
36
|
? setTimeout(() => {
|
|
77
37
|
this.logger.warn(`HTTP Streaming POST is taking longer than ${Math.ceil(STREAMING_POST_TIMEOUT_MS / 1000)} seconds to resolve. If using a debug build, please ensure Flipper Network plugin is disabled.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactNativeRemote.js","sourceRoot":"","sources":["../../../src/sync/stream/ReactNativeRemote.ts"],"names":[],"mappings":"AAEA,OAAO,E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AAS,GAAT,SAAS,CAAiB;QAC1B,WAAM,GAAN,MAAM,CAAiC;IAOnD,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAA0B;QAC3C,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAA0B;QACzC,MAAM,OAAO,GACX,QAAQ,CAAC,EAAE,IAAI,SAAS;YACtB,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE;gBACd,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,6CAA6C,IAAI,CAAC,IAAI,CACpD,yBAAyB,GAAG,IAAI,CACjC,gGAAgG,CAClG,CAAC;YACJ,CAAC,EAAE,yBAAyB,CAAC;YAC/B,CAAC,CAAC,IAAI,CAAC;QAEX,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC;YACpC,GAAG,OAAO;YACV,YAAY,EAAE;gBACZ,GAAG,OAAO,CAAC,YAAY;gBACvB;;;;mBAIG;gBACH,yFAAyF;gBACzF,WAAW,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE;aACrC;SACF,CAAC,CAAC;QAEH,IAAI,OAAO,EAAE,CAAC;YACZ,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/react-native",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20240703093437",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@craftzdog/react-native-buffer": "^6.0.5",
|
|
41
41
|
"@journeyapps/react-native-quick-sqlite": "^1.1.6",
|
|
42
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
42
43
|
"@rollup/plugin-inject": "^5.0.5",
|
|
44
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
43
45
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
44
46
|
"@rollup/plugin-typescript": "11.1.6",
|
|
45
|
-
"@rollup/plugin-commonjs": "^25.0.7",
|
|
46
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
47
47
|
"@types/async-lock": "^1.4.0",
|
|
48
48
|
"react": "18.2.0",
|
|
49
49
|
"react-native": "0.72.4",
|