react-native-debug-toolkit 3.3.4 → 3.3.8
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/README.md +48 -46
- package/README.zh-CN.md +48 -46
- package/android/src/main/java/com/reactnativedebugtoolkit/DebugToolkitDevConnectModule.java +0 -187
- package/bin/debug-toolkit.js +0 -16
- package/ios/DebugToolkitDevConnect.h +0 -12
- package/ios/DebugToolkitDevConnect.mm +0 -321
- package/lib/commonjs/core/initialize.js +8 -1
- package/lib/commonjs/core/initialize.js.map +1 -1
- package/lib/commonjs/features/devConnect/DevConnectTab.js +18 -470
- package/lib/commonjs/features/devConnect/DevConnectTab.js.map +1 -1
- package/lib/commonjs/features/devConnect/devConnectPreferences.js +0 -12
- package/lib/commonjs/features/devConnect/devConnectPreferences.js.map +1 -1
- package/lib/commonjs/features/devConnect/devConnectUtils.js +2 -57
- package/lib/commonjs/features/devConnect/devConnectUtils.js.map +1 -1
- package/lib/commonjs/features/devConnect/index.js +1 -23
- package/lib/commonjs/features/devConnect/index.js.map +1 -1
- package/lib/commonjs/features/devConnect/nativeDevConnect.js +1 -103
- package/lib/commonjs/features/devConnect/nativeDevConnect.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/DebugView.js +2 -0
- package/lib/commonjs/ui/DebugView.js.map +1 -1
- package/lib/commonjs/ui/panel/FloatPanelView.js +22 -10
- package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -1
- package/lib/commonjs/ui/panel/tabPersistence.js +17 -0
- package/lib/commonjs/ui/panel/tabPersistence.js.map +1 -0
- package/lib/commonjs/utils/createDebugTab.js +21 -0
- package/lib/commonjs/utils/createDebugTab.js.map +1 -0
- package/lib/commonjs/utils/debugPreferences.js +0 -1
- package/lib/commonjs/utils/debugPreferences.js.map +1 -1
- package/lib/module/core/initialize.js +8 -1
- package/lib/module/core/initialize.js.map +1 -1
- package/lib/module/features/devConnect/DevConnectTab.js +21 -473
- package/lib/module/features/devConnect/DevConnectTab.js.map +1 -1
- package/lib/module/features/devConnect/devConnectPreferences.js +1 -12
- package/lib/module/features/devConnect/devConnectPreferences.js.map +1 -1
- package/lib/module/features/devConnect/devConnectUtils.js +1 -53
- package/lib/module/features/devConnect/devConnectUtils.js.map +1 -1
- package/lib/module/features/devConnect/index.js +5 -9
- package/lib/module/features/devConnect/index.js.map +1 -1
- package/lib/module/features/devConnect/nativeDevConnect.js +1 -100
- package/lib/module/features/devConnect/nativeDevConnect.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/DebugView.js +2 -0
- package/lib/module/ui/DebugView.js.map +1 -1
- package/lib/module/ui/panel/FloatPanelView.js +22 -10
- package/lib/module/ui/panel/FloatPanelView.js.map +1 -1
- package/lib/module/ui/panel/tabPersistence.js +13 -0
- package/lib/module/ui/panel/tabPersistence.js.map +1 -0
- package/lib/module/utils/createDebugTab.js +17 -0
- package/lib/module/utils/createDebugTab.js.map +1 -0
- package/lib/module/utils/debugPreferences.js +0 -1
- package/lib/module/utils/debugPreferences.js.map +1 -1
- package/lib/typescript/src/core/initialize.d.ts +2 -0
- package/lib/typescript/src/core/initialize.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/DevConnectTab.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/devConnectPreferences.d.ts +0 -2
- package/lib/typescript/src/features/devConnect/devConnectPreferences.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/devConnectUtils.d.ts +0 -20
- package/lib/typescript/src/features/devConnect/devConnectUtils.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/index.d.ts +2 -2
- package/lib/typescript/src/features/devConnect/index.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/nativeDevConnect.d.ts +0 -25
- package/lib/typescript/src/features/devConnect/nativeDevConnect.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/types.d.ts +1 -3
- package/lib/typescript/src/features/devConnect/types.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/ui/DebugView.d.ts +4 -2
- package/lib/typescript/src/ui/DebugView.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/FloatPanelView.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/tabPersistence.d.ts +3 -0
- package/lib/typescript/src/ui/panel/tabPersistence.d.ts.map +1 -0
- package/lib/typescript/src/utils/createDebugTab.d.ts +18 -0
- package/lib/typescript/src/utils/createDebugTab.d.ts.map +1 -0
- package/lib/typescript/src/utils/debugPreferences.d.ts +0 -1
- package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -1
- package/package.json +2 -6
- package/src/core/initialize.ts +17 -1
- package/src/features/devConnect/DevConnectTab.tsx +17 -381
- package/src/features/devConnect/devConnectPreferences.ts +0 -15
- package/src/features/devConnect/devConnectUtils.ts +1 -81
- package/src/features/devConnect/index.ts +2 -9
- package/src/features/devConnect/nativeDevConnect.ts +1 -136
- package/src/features/devConnect/types.ts +1 -3
- package/src/index.ts +2 -0
- package/src/ui/DebugView.tsx +5 -1
- package/src/ui/panel/FloatPanelView.tsx +22 -10
- package/src/ui/panel/tabPersistence.ts +22 -0
- package/src/utils/createDebugTab.ts +32 -0
- package/src/utils/debugPreferences.ts +0 -1
- package/app.plugin.js +0 -51
- package/dev-client.js +0 -3
- package/scripts/bundle/android.js +0 -101
- package/scripts/bundle/cli.js +0 -57
- package/scripts/bundle/doctor.js +0 -38
- package/scripts/bundle/ios.js +0 -179
- package/scripts/bundle/setup.js +0 -39
- package/scripts/debug-bundle.gradle +0 -147
|
@@ -1,70 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useCallback, useEffect,
|
|
3
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { KeyboardAvoidingView, Platform, ScrollView, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native';
|
|
5
5
|
import { Colors } from '../../ui/theme/colors';
|
|
6
6
|
import { buildDeviceDaemonEndpoint, daemonClient, getDefaultDaemonEndpoint, normalizeDaemonSettings } from '../../utils/DaemonClient';
|
|
7
|
-
import { DEFAULT_DAEMON_PORT,
|
|
8
|
-
import { saveComputerHost, saveComputerTarget, saveDaemonPort
|
|
9
|
-
import { applyMetroBundle, getNativeDiagnostics, resetMetroBundle } from './nativeDevConnect';
|
|
7
|
+
import { DEFAULT_DAEMON_PORT, buildDaemonDeviceHost, normalizeComputerHost, normalizePort, parseComputerTarget } from './devConnectUtils';
|
|
8
|
+
import { saveComputerHost, saveComputerTarget, saveDaemonPort } from './devConnectPreferences';
|
|
10
9
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
const CONNECTION_TIMEOUT_MS = 2000;
|
|
12
|
-
function
|
|
11
|
+
function getSimulatorHost() {
|
|
13
12
|
return Platform.OS === 'android' ? '10.0.2.2' : 'localhost';
|
|
14
13
|
}
|
|
15
|
-
function describeMetroFailure(result) {
|
|
16
|
-
if (result.reason === 'native_unavailable') {
|
|
17
|
-
return 'Native DevConnect not installed. Rebuild app after installing native module.';
|
|
18
|
-
}
|
|
19
|
-
if (result.reason === 'metro_unreachable') {
|
|
20
|
-
return result.error ? `Metro not reachable: ${result.error}` : 'Metro not reachable. Start Metro on that port.';
|
|
21
|
-
}
|
|
22
|
-
if (result.reason === 'fetch_unavailable') {
|
|
23
|
-
return 'Cannot check Metro because fetch is unavailable.';
|
|
24
|
-
}
|
|
25
|
-
if (result.reason === 'invalid_target') {
|
|
26
|
-
return 'Enter a valid computer IP and Metro port.';
|
|
27
|
-
}
|
|
28
|
-
return result.error ? `Metro switch failed: ${result.error}` : 'Metro switch failed.';
|
|
29
|
-
}
|
|
30
14
|
export function DevConnectTab({
|
|
31
15
|
snapshot,
|
|
32
16
|
feature
|
|
33
17
|
}) {
|
|
34
18
|
const inputRef = useRef(null);
|
|
35
19
|
const [computerHost, setComputerHost] = useState(snapshot.computerHost);
|
|
36
|
-
const [metroPort, setMetroPort] = useState(snapshot.metroPort);
|
|
37
20
|
const [daemonPort, setDaemonPort] = useState(snapshot.daemonPort);
|
|
38
21
|
const [streaming, setStreaming] = useState(snapshot.streaming);
|
|
39
22
|
const [syncState, setSyncState] = useState(snapshot.streaming ? 'running' : 'idle');
|
|
40
23
|
const [message, setMessage] = useState(null);
|
|
41
24
|
const [sending, setSending] = useState(false);
|
|
42
|
-
const [metroBusy, setMetroBusy] = useState(false);
|
|
43
|
-
const [diagData, setDiagData] = useState(null);
|
|
44
|
-
const [diagOpen, setDiagOpen] = useState(false);
|
|
45
25
|
const isSim = snapshot.isSimulator;
|
|
46
26
|
const updateFeatureSettings = useCallback(patch => {
|
|
47
27
|
feature.updateSettings?.(patch);
|
|
48
28
|
}, [feature]);
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
getNativeDiagnostics().then(result => {
|
|
51
|
-
if (result) {
|
|
52
|
-
setDiagData(result);
|
|
53
|
-
console.info(`[DevConnect] debugBuild=${result.isDebugBuild} appDelegate=${result.appDelegateClass} persistedHost=${result.persistedMetroHost ?? 'none'}`);
|
|
54
|
-
}
|
|
55
|
-
}).catch(() => {});
|
|
56
|
-
}, []);
|
|
57
|
-
const refreshDiag = useCallback(() => {
|
|
58
|
-
getNativeDiagnostics().then(result => {
|
|
59
|
-
if (result) setDiagData(result);
|
|
60
|
-
}).catch(() => {});
|
|
61
|
-
}, []);
|
|
62
29
|
useEffect(() => {
|
|
63
30
|
setComputerHost(snapshot.computerHost);
|
|
64
31
|
}, [snapshot.computerHost]);
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
setMetroPort(snapshot.metroPort);
|
|
67
|
-
}, [snapshot.metroPort]);
|
|
68
32
|
useEffect(() => {
|
|
69
33
|
setDaemonPort(snapshot.daemonPort);
|
|
70
34
|
}, [snapshot.daemonPort]);
|
|
@@ -72,19 +36,14 @@ export function DevConnectTab({
|
|
|
72
36
|
setStreaming(snapshot.streaming);
|
|
73
37
|
setSyncState(snapshot.streaming ? 'running' : 'idle');
|
|
74
38
|
}, [snapshot.streaming]);
|
|
75
|
-
const metroHost = isSim ? getSimulatorMetroHost() : computerHost;
|
|
76
|
-
const metroTarget = useMemo(() => buildMetroTarget(metroHost, metroPort), [metroHost, metroPort]);
|
|
77
|
-
const metroUrls = useMemo(() => buildMetroUrls(metroHost, metroPort), [metroHost, metroPort]);
|
|
78
39
|
const handleHostChange = useCallback(value => {
|
|
79
40
|
setComputerHost(value);
|
|
80
41
|
const target = parseComputerTarget(value);
|
|
81
42
|
if (target) {
|
|
82
|
-
setMetroPort(target.metroPort);
|
|
83
43
|
saveComputerTarget(value).then(savedTarget => {
|
|
84
44
|
if (savedTarget) {
|
|
85
45
|
updateFeatureSettings({
|
|
86
|
-
computerHost: savedTarget.computerHost
|
|
87
|
-
metroPort: savedTarget.metroPort
|
|
46
|
+
computerHost: savedTarget.computerHost
|
|
88
47
|
});
|
|
89
48
|
}
|
|
90
49
|
}).catch(() => {});
|
|
@@ -92,16 +51,6 @@ export function DevConnectTab({
|
|
|
92
51
|
setSyncState(prev => prev === 'failed' ? 'idle' : prev);
|
|
93
52
|
setMessage(null);
|
|
94
53
|
}, [updateFeatureSettings]);
|
|
95
|
-
const handleMetroPortChange = useCallback(value => {
|
|
96
|
-
setMetroPort(value);
|
|
97
|
-
const normalized = normalizePort(value);
|
|
98
|
-
if (normalized) {
|
|
99
|
-
saveMetroPort(normalized).then(() => updateFeatureSettings({
|
|
100
|
-
metroPort: normalized
|
|
101
|
-
})).catch(() => {});
|
|
102
|
-
}
|
|
103
|
-
setMessage(null);
|
|
104
|
-
}, [updateFeatureSettings]);
|
|
105
54
|
const handleDaemonPortChange = useCallback(value => {
|
|
106
55
|
setDaemonPort(value);
|
|
107
56
|
const normalized = normalizePort(value);
|
|
@@ -133,35 +82,10 @@ export function DevConnectTab({
|
|
|
133
82
|
writes.push(saveComputerHost(normalizedHost));
|
|
134
83
|
setComputerHost(normalizedHost);
|
|
135
84
|
}
|
|
136
|
-
const normalizedMetroPort = normalizePort(metroPort);
|
|
137
|
-
if (normalizedMetroPort) {
|
|
138
|
-
patch.metroPort = normalizedMetroPort;
|
|
139
|
-
writes.push(saveMetroPort(normalizedMetroPort));
|
|
140
|
-
setMetroPort(normalizedMetroPort);
|
|
141
|
-
}
|
|
142
|
-
await Promise.all(writes);
|
|
143
|
-
updateFeatureSettings(patch);
|
|
144
|
-
return true;
|
|
145
|
-
}, [computerHost, daemonPort, isSim, metroPort, updateFeatureSettings]);
|
|
146
|
-
const persistMetroSettings = useCallback(async () => {
|
|
147
|
-
if (!metroTarget) {
|
|
148
|
-
setMessage('Enter a valid computer IP and Metro port.');
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
const patch = {
|
|
152
|
-
metroPort: metroTarget.port
|
|
153
|
-
};
|
|
154
|
-
const writes = [saveMetroPort(metroTarget.port)];
|
|
155
|
-
setMetroPort(metroTarget.port);
|
|
156
|
-
if (!isSim) {
|
|
157
|
-
patch.computerHost = metroTarget.host;
|
|
158
|
-
writes.push(saveComputerTarget(metroTarget.hostPort));
|
|
159
|
-
setComputerHost(metroTarget.host);
|
|
160
|
-
}
|
|
161
85
|
await Promise.all(writes);
|
|
162
86
|
updateFeatureSettings(patch);
|
|
163
87
|
return true;
|
|
164
|
-
}, [
|
|
88
|
+
}, [computerHost, daemonPort, isSim, updateFeatureSettings]);
|
|
165
89
|
const validateSettings = useCallback(() => {
|
|
166
90
|
if (!isSim && !normalizeComputerHost(computerHost)) {
|
|
167
91
|
setMessage('Enter your computer IP first.');
|
|
@@ -276,58 +200,7 @@ export function DevConnectTab({
|
|
|
276
200
|
setSending(false);
|
|
277
201
|
}
|
|
278
202
|
}, [configureDaemon, persistConnectionSettings, validateSettings]);
|
|
279
|
-
const applyRemoteBundle = useCallback(async () => {
|
|
280
|
-
if (!metroTarget) {
|
|
281
|
-
setMessage('Enter a valid computer IP and Metro port.');
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
if (!snapshot.nativeMetroAvailable) {
|
|
285
|
-
setMessage(describeMetroFailure({
|
|
286
|
-
reason: 'native_unavailable'
|
|
287
|
-
}));
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
setMetroBusy(true);
|
|
291
|
-
setMessage('Checking Metro...');
|
|
292
|
-
try {
|
|
293
|
-
if (!(await persistMetroSettings())) {
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
const result = await applyMetroBundle(metroTarget.host, metroTarget.port);
|
|
297
|
-
if (result.ok) {
|
|
298
|
-
setMessage(`Using Metro at ${result.hostPort}. Reloading...`);
|
|
299
|
-
} else {
|
|
300
|
-
setMessage(describeMetroFailure(result));
|
|
301
|
-
}
|
|
302
|
-
} finally {
|
|
303
|
-
setMetroBusy(false);
|
|
304
|
-
}
|
|
305
|
-
}, [metroTarget, persistMetroSettings, snapshot.nativeMetroAvailable]);
|
|
306
|
-
const resetRemoteBundle = useCallback(async () => {
|
|
307
|
-
if (!snapshot.nativeMetroAvailable) {
|
|
308
|
-
setMessage(describeMetroFailure({
|
|
309
|
-
reason: 'native_unavailable'
|
|
310
|
-
}));
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
setMetroBusy(true);
|
|
314
|
-
try {
|
|
315
|
-
const result = await resetMetroBundle();
|
|
316
|
-
if (result.ok) {
|
|
317
|
-
setMessage('Metro host reset. Reloading...');
|
|
318
|
-
} else {
|
|
319
|
-
setMessage(describeMetroFailure(result));
|
|
320
|
-
}
|
|
321
|
-
} finally {
|
|
322
|
-
setMetroBusy(false);
|
|
323
|
-
}
|
|
324
|
-
}, [snapshot.nativeMetroAvailable]);
|
|
325
|
-
|
|
326
|
-
// Metro host switching only works in Debug builds. diagData is iOS-populated; when we know
|
|
327
|
-
// it's a Release build, disable the controls (Android reports null → stays enabled).
|
|
328
|
-
const metroReleaseBlocked = diagData ? !diagData.isDebugBuild : false;
|
|
329
203
|
const canConnect = isSim || Boolean(normalizeComputerHost(computerHost)) && Boolean(normalizePort(daemonPort));
|
|
330
|
-
const canUseMetro = Boolean(metroTarget) && snapshot.nativeMetroAvailable && !metroBusy && !metroReleaseBlocked;
|
|
331
204
|
const busy = sending || syncState === 'checking';
|
|
332
205
|
const subnetPrefix = snapshot.subnetPrefix;
|
|
333
206
|
const ipPlaceholder = subnetPrefix ? `${subnetPrefix}...` : '192.168.1.10';
|
|
@@ -342,7 +215,7 @@ export function DevConnectTab({
|
|
|
342
215
|
style: styles.badge,
|
|
343
216
|
children: /*#__PURE__*/_jsxs(Text, {
|
|
344
217
|
style: styles.badgeText,
|
|
345
|
-
children: ["Simulator/emulator - using ",
|
|
218
|
+
children: ["Simulator/emulator - using ", getSimulatorHost()]
|
|
346
219
|
})
|
|
347
220
|
}) : /*#__PURE__*/_jsxs(View, {
|
|
348
221
|
style: styles.section,
|
|
@@ -381,42 +254,20 @@ export function DevConnectTab({
|
|
|
381
254
|
style: styles.section,
|
|
382
255
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
383
256
|
style: styles.label,
|
|
384
|
-
children: "
|
|
385
|
-
}), /*#__PURE__*/
|
|
386
|
-
style: styles.
|
|
387
|
-
children:
|
|
388
|
-
style: styles.
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
autoCapitalize: "none",
|
|
399
|
-
autoCorrect: false,
|
|
400
|
-
keyboardType: "number-pad",
|
|
401
|
-
returnKeyType: "done"
|
|
402
|
-
})]
|
|
403
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
404
|
-
style: styles.portField,
|
|
405
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
406
|
-
style: styles.portLabel,
|
|
407
|
-
children: "Logs"
|
|
408
|
-
}), /*#__PURE__*/_jsx(TextInput, {
|
|
409
|
-
style: styles.portInput,
|
|
410
|
-
value: daemonPort,
|
|
411
|
-
onChangeText: handleDaemonPortChange,
|
|
412
|
-
placeholder: DEFAULT_DAEMON_PORT,
|
|
413
|
-
placeholderTextColor: Colors.textLight,
|
|
414
|
-
autoCapitalize: "none",
|
|
415
|
-
autoCorrect: false,
|
|
416
|
-
keyboardType: "number-pad",
|
|
417
|
-
returnKeyType: "done"
|
|
418
|
-
})]
|
|
419
|
-
})]
|
|
257
|
+
children: "Desktop Logs Port"
|
|
258
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
259
|
+
style: styles.inputRow,
|
|
260
|
+
children: /*#__PURE__*/_jsx(TextInput, {
|
|
261
|
+
style: styles.input,
|
|
262
|
+
value: daemonPort,
|
|
263
|
+
onChangeText: handleDaemonPortChange,
|
|
264
|
+
placeholder: DEFAULT_DAEMON_PORT,
|
|
265
|
+
placeholderTextColor: Colors.textLight,
|
|
266
|
+
autoCapitalize: "none",
|
|
267
|
+
autoCorrect: false,
|
|
268
|
+
keyboardType: "number-pad",
|
|
269
|
+
returnKeyType: "done"
|
|
270
|
+
})
|
|
420
271
|
})]
|
|
421
272
|
}), /*#__PURE__*/_jsxs(View, {
|
|
422
273
|
style: styles.actions,
|
|
@@ -442,153 +293,6 @@ export function DevConnectTab({
|
|
|
442
293
|
}), message ? /*#__PURE__*/_jsx(Text, {
|
|
443
294
|
style: styles.message,
|
|
444
295
|
children: message
|
|
445
|
-
}) : null, /*#__PURE__*/_jsxs(View, {
|
|
446
|
-
style: styles.section,
|
|
447
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
448
|
-
style: styles.sectionTitleRow,
|
|
449
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
450
|
-
style: styles.sectionTitle,
|
|
451
|
-
children: "Remote JS Bundle"
|
|
452
|
-
}), diagData ? /*#__PURE__*/_jsxs(View, {
|
|
453
|
-
style: styles.swizzleBadge,
|
|
454
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
455
|
-
style: [styles.swizzleDot, diagData.isDebugBuild ? styles.dotGreen : styles.dotRed]
|
|
456
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
457
|
-
style: styles.swizzleBadgeText,
|
|
458
|
-
children: diagData.isDebugBuild ? 'debug build' : 'release: disabled'
|
|
459
|
-
})]
|
|
460
|
-
}) : null]
|
|
461
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
462
|
-
style: styles.sectionDesc,
|
|
463
|
-
children: "Starts from the embedded bundle. After you apply a computer IP, hot-reloads from that Metro. Debug builds only \u2014 use Reset to go back to the embedded bundle."
|
|
464
|
-
}), !metroUrls ? /*#__PURE__*/_jsx(View, {
|
|
465
|
-
style: styles.stepCard,
|
|
466
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
467
|
-
style: styles.stepHint,
|
|
468
|
-
children: "Enter your computer IP and Metro port to get started."
|
|
469
|
-
})
|
|
470
|
-
}) : /*#__PURE__*/_jsxs(View, {
|
|
471
|
-
style: styles.stepCard,
|
|
472
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
473
|
-
style: styles.urlRow,
|
|
474
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
475
|
-
style: styles.urlLabel,
|
|
476
|
-
children: "HTTP"
|
|
477
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
478
|
-
style: styles.urlText,
|
|
479
|
-
numberOfLines: 1,
|
|
480
|
-
children: metroUrls.httpUrl
|
|
481
|
-
})]
|
|
482
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
483
|
-
style: styles.urlRow,
|
|
484
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
485
|
-
style: styles.urlLabel,
|
|
486
|
-
children: "Expo"
|
|
487
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
488
|
-
style: styles.urlText,
|
|
489
|
-
numberOfLines: 1,
|
|
490
|
-
children: metroUrls.expUrl
|
|
491
|
-
})]
|
|
492
|
-
})]
|
|
493
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
494
|
-
style: styles.actions,
|
|
495
|
-
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
496
|
-
style: [styles.primaryButton, !canUseMetro && styles.buttonDisabled],
|
|
497
|
-
onPress: applyRemoteBundle,
|
|
498
|
-
disabled: !canUseMetro,
|
|
499
|
-
activeOpacity: 0.75,
|
|
500
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
501
|
-
style: styles.primaryButtonText,
|
|
502
|
-
children: metroBusy ? 'Checking...' : 'Use Metro Bundle'
|
|
503
|
-
})
|
|
504
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
505
|
-
style: [styles.secondaryButton, (!snapshot.nativeMetroAvailable || metroBusy) && styles.buttonDisabled],
|
|
506
|
-
onPress: resetRemoteBundle,
|
|
507
|
-
disabled: !snapshot.nativeMetroAvailable || metroBusy,
|
|
508
|
-
activeOpacity: 0.75,
|
|
509
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
510
|
-
style: styles.secondaryButtonText,
|
|
511
|
-
children: "Reset"
|
|
512
|
-
})
|
|
513
|
-
})]
|
|
514
|
-
}), !snapshot.nativeMetroAvailable ? /*#__PURE__*/_jsx(Text, {
|
|
515
|
-
style: styles.hint,
|
|
516
|
-
children: "Native DevConnect requires pod install / Gradle sync and app rebuild."
|
|
517
|
-
}) : null, metroReleaseBlocked ? /*#__PURE__*/_jsx(Text, {
|
|
518
|
-
style: styles.diagWarning,
|
|
519
|
-
children: "\u26A0 This is a Release build. Metro host switching is disabled \u2014 RN loads the embedded bundle and strips the packager machinery in Release. Run a Debug build to switch hosts."
|
|
520
|
-
}) : null]
|
|
521
|
-
}), snapshot.nativeMetroAvailable && diagData ? /*#__PURE__*/_jsxs(View, {
|
|
522
|
-
style: styles.section,
|
|
523
|
-
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
524
|
-
style: styles.diagHeader,
|
|
525
|
-
onPress: () => {
|
|
526
|
-
setDiagOpen(v => !v);
|
|
527
|
-
refreshDiag();
|
|
528
|
-
},
|
|
529
|
-
activeOpacity: 0.7,
|
|
530
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
531
|
-
style: styles.sectionTitle,
|
|
532
|
-
children: "iOS Bundle Status"
|
|
533
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
534
|
-
style: styles.diagChevron,
|
|
535
|
-
children: diagOpen ? '▲' : '▼'
|
|
536
|
-
})]
|
|
537
|
-
}), diagOpen ? /*#__PURE__*/_jsxs(View, {
|
|
538
|
-
style: styles.diagCard,
|
|
539
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
540
|
-
style: styles.diagRow,
|
|
541
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
542
|
-
style: styles.diagKey,
|
|
543
|
-
children: "AppDelegate"
|
|
544
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
545
|
-
style: styles.diagVal,
|
|
546
|
-
children: diagData.appDelegateClass
|
|
547
|
-
})]
|
|
548
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
549
|
-
style: styles.diagRow,
|
|
550
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
551
|
-
style: styles.diagKey,
|
|
552
|
-
children: "packagerHost"
|
|
553
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
554
|
-
style: styles.diagVal,
|
|
555
|
-
children: diagData.persistedMetroHost ?? '—'
|
|
556
|
-
})]
|
|
557
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
558
|
-
style: styles.diagRow,
|
|
559
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
560
|
-
style: styles.diagKey,
|
|
561
|
-
children: "embedded"
|
|
562
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
563
|
-
style: [styles.diagVal, diagData.hasEmbeddedBundle ? styles.diagGood : styles.diagWarn],
|
|
564
|
-
children: diagData.hasEmbeddedBundle ? 'main.jsbundle' : 'missing'
|
|
565
|
-
})]
|
|
566
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
567
|
-
style: styles.diagRow,
|
|
568
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
569
|
-
style: styles.diagKey,
|
|
570
|
-
children: "build"
|
|
571
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
572
|
-
style: [styles.diagVal, diagData.isDebugBuild ? styles.diagGood : styles.diagWarn],
|
|
573
|
-
children: diagData.isDebugBuild ? 'Debug' : 'Release'
|
|
574
|
-
})]
|
|
575
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
576
|
-
style: styles.diagRow,
|
|
577
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
578
|
-
style: styles.diagKey,
|
|
579
|
-
children: "embedded-first"
|
|
580
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
581
|
-
style: [styles.diagVal, diagData.embeddedFirstHookInstalled ? styles.diagGood : styles.diagWarn],
|
|
582
|
-
children: diagData.embeddedFirstHookInstalled ? 'active' : 'inactive'
|
|
583
|
-
})]
|
|
584
|
-
}), !diagData.embeddedFirstHookInstalled ? /*#__PURE__*/_jsxs(Text, {
|
|
585
|
-
style: styles.diagWarning,
|
|
586
|
-
children: ["\u26A0 Embedded-first hook not active (bundleRoot=", diagData.bundleRootHookInstalled ? 'Y' : 'N', "). Rebuild after pod install. Without it, Debug may still try Metro on launch."]
|
|
587
|
-
}) : diagData.hasEmbeddedBundle === false ? /*#__PURE__*/_jsx(Text, {
|
|
588
|
-
style: styles.diagWarning,
|
|
589
|
-
children: "\u26A0 main.jsbundle is missing from the app package. Build with an embedded bundle (e.g. export/bundle) or cold start cannot use offline JS."
|
|
590
|
-
}) : null]
|
|
591
|
-
}) : null]
|
|
592
296
|
}) : null]
|
|
593
297
|
})
|
|
594
298
|
});
|
|
@@ -619,18 +323,6 @@ const styles = StyleSheet.create({
|
|
|
619
323
|
section: {
|
|
620
324
|
marginBottom: 14
|
|
621
325
|
},
|
|
622
|
-
sectionTitle: {
|
|
623
|
-
fontSize: 14,
|
|
624
|
-
fontWeight: '600',
|
|
625
|
-
color: Colors.text,
|
|
626
|
-
marginBottom: 4
|
|
627
|
-
},
|
|
628
|
-
sectionDesc: {
|
|
629
|
-
fontSize: 12,
|
|
630
|
-
color: Colors.textSecondary,
|
|
631
|
-
marginBottom: 10,
|
|
632
|
-
lineHeight: 17
|
|
633
|
-
},
|
|
634
326
|
label: {
|
|
635
327
|
fontSize: 13,
|
|
636
328
|
fontWeight: '500',
|
|
@@ -661,29 +353,6 @@ const styles = StyleSheet.create({
|
|
|
661
353
|
color: Colors.text,
|
|
662
354
|
fontFamily: 'Courier'
|
|
663
355
|
},
|
|
664
|
-
portRow: {
|
|
665
|
-
flexDirection: 'row',
|
|
666
|
-
gap: 10
|
|
667
|
-
},
|
|
668
|
-
portField: {
|
|
669
|
-
flex: 1
|
|
670
|
-
},
|
|
671
|
-
portLabel: {
|
|
672
|
-
fontSize: 11,
|
|
673
|
-
color: Colors.textSecondary,
|
|
674
|
-
marginBottom: 4
|
|
675
|
-
},
|
|
676
|
-
portInput: {
|
|
677
|
-
backgroundColor: Colors.surface,
|
|
678
|
-
borderWidth: 1,
|
|
679
|
-
borderColor: Colors.border,
|
|
680
|
-
borderRadius: 8,
|
|
681
|
-
paddingHorizontal: 12,
|
|
682
|
-
paddingVertical: 9,
|
|
683
|
-
fontSize: 13,
|
|
684
|
-
color: Colors.text,
|
|
685
|
-
fontFamily: 'Courier'
|
|
686
|
-
},
|
|
687
356
|
actions: {
|
|
688
357
|
flexDirection: 'row',
|
|
689
358
|
gap: 10,
|
|
@@ -726,127 +395,6 @@ const styles = StyleSheet.create({
|
|
|
726
395
|
lineHeight: 17,
|
|
727
396
|
color: Colors.textSecondary,
|
|
728
397
|
marginBottom: 12
|
|
729
|
-
},
|
|
730
|
-
hint: {
|
|
731
|
-
fontSize: 12,
|
|
732
|
-
color: Colors.textLight,
|
|
733
|
-
lineHeight: 17
|
|
734
|
-
},
|
|
735
|
-
stepCard: {
|
|
736
|
-
backgroundColor: Colors.surface,
|
|
737
|
-
borderWidth: 1,
|
|
738
|
-
borderColor: Colors.border,
|
|
739
|
-
borderRadius: 10,
|
|
740
|
-
padding: 12,
|
|
741
|
-
marginBottom: 8
|
|
742
|
-
},
|
|
743
|
-
stepHint: {
|
|
744
|
-
fontSize: 12,
|
|
745
|
-
color: Colors.textSecondary,
|
|
746
|
-
lineHeight: 17
|
|
747
|
-
},
|
|
748
|
-
urlLabel: {
|
|
749
|
-
minWidth: 40,
|
|
750
|
-
fontSize: 10,
|
|
751
|
-
fontWeight: '600',
|
|
752
|
-
color: Colors.primary,
|
|
753
|
-
backgroundColor: `${Colors.primary}15`,
|
|
754
|
-
paddingHorizontal: 6,
|
|
755
|
-
paddingVertical: 2,
|
|
756
|
-
borderRadius: 4,
|
|
757
|
-
marginRight: 8,
|
|
758
|
-
textAlign: 'center'
|
|
759
|
-
},
|
|
760
|
-
urlRow: {
|
|
761
|
-
flexDirection: 'row',
|
|
762
|
-
alignItems: 'center',
|
|
763
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
764
|
-
borderBottomColor: Colors.border,
|
|
765
|
-
paddingVertical: 7
|
|
766
|
-
},
|
|
767
|
-
urlText: {
|
|
768
|
-
flex: 1,
|
|
769
|
-
fontSize: 13,
|
|
770
|
-
fontFamily: 'Courier',
|
|
771
|
-
color: Colors.text
|
|
772
|
-
},
|
|
773
|
-
sectionTitleRow: {
|
|
774
|
-
flexDirection: 'row',
|
|
775
|
-
alignItems: 'center',
|
|
776
|
-
justifyContent: 'space-between',
|
|
777
|
-
marginBottom: 4
|
|
778
|
-
},
|
|
779
|
-
swizzleBadge: {
|
|
780
|
-
flexDirection: 'row',
|
|
781
|
-
alignItems: 'center',
|
|
782
|
-
gap: 4,
|
|
783
|
-
paddingHorizontal: 7,
|
|
784
|
-
paddingVertical: 3,
|
|
785
|
-
borderRadius: 10,
|
|
786
|
-
backgroundColor: Colors.surface,
|
|
787
|
-
borderWidth: 1,
|
|
788
|
-
borderColor: Colors.border
|
|
789
|
-
},
|
|
790
|
-
swizzleDot: {
|
|
791
|
-
width: 6,
|
|
792
|
-
height: 6,
|
|
793
|
-
borderRadius: 3
|
|
794
|
-
},
|
|
795
|
-
dotGreen: {
|
|
796
|
-
backgroundColor: '#34C759'
|
|
797
|
-
},
|
|
798
|
-
dotRed: {
|
|
799
|
-
backgroundColor: '#FF3B30'
|
|
800
|
-
},
|
|
801
|
-
swizzleBadgeText: {
|
|
802
|
-
fontSize: 11,
|
|
803
|
-
color: Colors.textSecondary,
|
|
804
|
-
fontFamily: 'Courier'
|
|
805
|
-
},
|
|
806
|
-
diagHeader: {
|
|
807
|
-
flexDirection: 'row',
|
|
808
|
-
alignItems: 'center',
|
|
809
|
-
justifyContent: 'space-between',
|
|
810
|
-
marginBottom: 6
|
|
811
|
-
},
|
|
812
|
-
diagChevron: {
|
|
813
|
-
fontSize: 12,
|
|
814
|
-
color: Colors.textSecondary
|
|
815
|
-
},
|
|
816
|
-
diagCard: {
|
|
817
|
-
backgroundColor: Colors.surface,
|
|
818
|
-
borderWidth: 1,
|
|
819
|
-
borderColor: Colors.border,
|
|
820
|
-
borderRadius: 10,
|
|
821
|
-
padding: 10
|
|
822
|
-
},
|
|
823
|
-
diagRow: {
|
|
824
|
-
flexDirection: 'row',
|
|
825
|
-
justifyContent: 'space-between',
|
|
826
|
-
paddingVertical: 4
|
|
827
|
-
},
|
|
828
|
-
diagKey: {
|
|
829
|
-
fontSize: 12,
|
|
830
|
-
color: Colors.textSecondary,
|
|
831
|
-
fontFamily: 'Courier'
|
|
832
|
-
},
|
|
833
|
-
diagVal: {
|
|
834
|
-
fontSize: 12,
|
|
835
|
-
color: Colors.text,
|
|
836
|
-
fontFamily: 'Courier',
|
|
837
|
-
fontWeight: '600'
|
|
838
|
-
},
|
|
839
|
-
diagGood: {
|
|
840
|
-
color: '#34C759'
|
|
841
|
-
},
|
|
842
|
-
diagWarn: {
|
|
843
|
-
color: '#FF9500'
|
|
844
|
-
},
|
|
845
|
-
diagWarning: {
|
|
846
|
-
marginTop: 10,
|
|
847
|
-
fontSize: 11,
|
|
848
|
-
color: '#FF9500',
|
|
849
|
-
lineHeight: 16
|
|
850
398
|
}
|
|
851
399
|
});
|
|
852
400
|
//# sourceMappingURL=DevConnectTab.js.map
|