@wavemaker/rn-codegen 11.8.5-patch.5 → 11.8.5-patch.7
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/package.json
CHANGED
|
@@ -275,52 +275,75 @@ class App extends BaseApp {
|
|
|
275
275
|
|
|
276
276
|
|
|
277
277
|
{{#if enableWavePulse}}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
278
|
+
confirmWavePulseConnect(connectionData) {
|
|
279
|
+
return new Promise((resolve, reject) => {
|
|
280
|
+
Alert.alert(
|
|
281
|
+
'Confirm',
|
|
282
|
+
'This app is going to connect to WavePulse for debugging remotely.' +
|
|
283
|
+
' Please tap on \'Yes\' button to confirm the connection.' +
|
|
284
|
+
' If you are not sure, what WavePulse is or if you don\'t want' +
|
|
285
|
+
' to connect to WavePulse, press on \'no\' button.',
|
|
286
|
+
[
|
|
287
|
+
{
|
|
288
|
+
text: 'No',
|
|
289
|
+
onPress: () => {
|
|
290
|
+
StorageService.removeItem('wavepulse.server');
|
|
291
|
+
resolve();
|
|
292
|
+
},
|
|
293
|
+
style: 'positive'
|
|
294
|
+
}, {
|
|
295
|
+
text: 'Yes',
|
|
296
|
+
onPress: () => resolve(connectionData),
|
|
297
|
+
style: 'negative'
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
[{
|
|
301
|
+
cancelable: true,
|
|
302
|
+
onDismiss: () => {
|
|
303
|
+
StorageService.removeItem('wavepulse.server');
|
|
304
|
+
resolve();
|
|
305
|
+
}
|
|
306
|
+
}]
|
|
307
|
+
)
|
|
281
308
|
});
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}]
|
|
314
|
-
)
|
|
315
|
-
});
|
|
316
|
-
}).then(url => {
|
|
317
|
-
if (url) {
|
|
318
|
-
this.wavepulseAgent.connect(url);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
async tryToconnectWavepulse(connectionData) {
|
|
312
|
+
try{
|
|
313
|
+
this.wavepulseAgent = createWavePulseAgent({
|
|
314
|
+
handler: this
|
|
315
|
+
});
|
|
316
|
+
if (!connectionData) {
|
|
317
|
+
connectionData = await Linking.getInitialURL()
|
|
318
|
+
.then(url => {
|
|
319
|
+
const paramStr = url?.split('://wavepulse/connect?')[1];
|
|
320
|
+
return paramStr?.split('&')
|
|
321
|
+
.map(v => v?.split('='))
|
|
322
|
+
.reduce((r, v) => {
|
|
323
|
+
r[v[0]] = v[1];
|
|
324
|
+
return r;
|
|
325
|
+
}, {})
|
|
326
|
+
}, () => {});
|
|
327
|
+
}
|
|
328
|
+
if (!connectionData || !connectionData.url) {
|
|
329
|
+
connectionData = await StorageService.getItem('wavepulse.server')
|
|
330
|
+
.then(d => d && JSON.parse(d));
|
|
331
|
+
}
|
|
332
|
+
if (!connectionData) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (!(isWebPreviewMode() || this.appConfig.preferences.autoConfirmWavePulse === true)) {
|
|
336
|
+
connectionData = await this.confirmWavePulseConnect(connectionData);
|
|
337
|
+
}
|
|
338
|
+
if (connectionData) {
|
|
339
|
+
this.wavepulseAgent.connect(connectionData.url, connectionData.channelId);
|
|
319
340
|
BASE_THEME.enableTrace(true);
|
|
320
|
-
StorageService.setItem('wavepulse.server',
|
|
341
|
+
StorageService.setItem('wavepulse.server', JSON.stringify(connectionData));
|
|
321
342
|
LogBox.ignoreAllLogs();
|
|
322
343
|
}
|
|
323
|
-
})
|
|
344
|
+
} catch(e) {
|
|
345
|
+
console.error(e);
|
|
346
|
+
}
|
|
324
347
|
}
|
|
325
348
|
{{/if}}
|
|
326
349
|
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"postinstall": "echo \"\""
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@wavemaker/app-rn-runtime": "11.8.5-patch.
|
|
13
|
-
"@wavemaker/variables": "11.8.5-patch.
|
|
14
|
-
"@wavemaker/rn-codegen": "11.8.5-patch.
|
|
15
|
-
"@wavemaker/wavepulse-agent": "1.0.
|
|
12
|
+
"@wavemaker/app-rn-runtime": "11.8.5-patch.7",
|
|
13
|
+
"@wavemaker/variables": "11.8.5-patch.7",
|
|
14
|
+
"@wavemaker/rn-codegen": "11.8.5-patch.7",
|
|
15
|
+
"@wavemaker/wavepulse-agent": "1.0.9",
|
|
16
16
|
"deprecated-react-native-prop-types": "4.1.0",
|
|
17
17
|
"expo": "50.0.17",
|
|
18
18
|
"expo-build-properties": "0.12.0",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"postinstall": "node ./scripts/post-build.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@wavemaker/app-rn-runtime": "11.8.5-patch.
|
|
13
|
-
"@wavemaker/variables": "11.8.5-patch.
|
|
14
|
-
"@wavemaker/rn-codegen": "11.8.5-patch.
|
|
15
|
-
"@wavemaker/wavepulse-agent": "1.0.
|
|
12
|
+
"@wavemaker/app-rn-runtime": "11.8.5-patch.7",
|
|
13
|
+
"@wavemaker/variables": "11.8.5-patch.7",
|
|
14
|
+
"@wavemaker/rn-codegen": "11.8.5-patch.7",
|
|
15
|
+
"@wavemaker/wavepulse-agent": "1.0.9",
|
|
16
16
|
"deprecated-react-native-prop-types": "4.1.0",
|
|
17
17
|
"expo": "50.0.17",
|
|
18
18
|
"expo-build-properties": "0.12.0",
|
|
@@ -10,9 +10,14 @@ let wavePulseAgent = new (class WavePulseAgent extends Agent {
|
|
|
10
10
|
isFlushAllowed() {
|
|
11
11
|
return this.isConnected;
|
|
12
12
|
}
|
|
13
|
-
connect(
|
|
13
|
+
connect(serverUrl, channelId) {
|
|
14
|
+
const pathIndex = serverUrl.indexOf('/', serverUrl.indexOf('//') + 2);
|
|
15
|
+
const serverOrigin = pathIndex > 0 ? serverUrl.substring(0, pathIndex) : serverUrl;
|
|
16
|
+
const contextPath = pathIndex > 0 ? serverUrl.substring(pathIndex) : undefined;
|
|
14
17
|
this.setChannel(WebSocketChannel.connect({
|
|
15
|
-
'url':
|
|
18
|
+
'url': serverOrigin || '',
|
|
19
|
+
'path': contextPath + '/socket.io',
|
|
20
|
+
'channelId': channelId
|
|
16
21
|
}));
|
|
17
22
|
}
|
|
18
23
|
})();
|