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
|
@@ -10,66 +10,30 @@ var _colors = require("../../ui/theme/colors");
|
|
|
10
10
|
var _DaemonClient = require("../../utils/DaemonClient");
|
|
11
11
|
var _devConnectUtils = require("./devConnectUtils");
|
|
12
12
|
var _devConnectPreferences = require("./devConnectPreferences");
|
|
13
|
-
var _nativeDevConnect = require("./nativeDevConnect");
|
|
14
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
const CONNECTION_TIMEOUT_MS = 2000;
|
|
17
|
-
function
|
|
16
|
+
function getSimulatorHost() {
|
|
18
17
|
return _reactNative.Platform.OS === 'android' ? '10.0.2.2' : 'localhost';
|
|
19
18
|
}
|
|
20
|
-
function describeMetroFailure(result) {
|
|
21
|
-
if (result.reason === 'native_unavailable') {
|
|
22
|
-
return 'Native DevConnect not installed. Rebuild app after installing native module.';
|
|
23
|
-
}
|
|
24
|
-
if (result.reason === 'metro_unreachable') {
|
|
25
|
-
return result.error ? `Metro not reachable: ${result.error}` : 'Metro not reachable. Start Metro on that port.';
|
|
26
|
-
}
|
|
27
|
-
if (result.reason === 'fetch_unavailable') {
|
|
28
|
-
return 'Cannot check Metro because fetch is unavailable.';
|
|
29
|
-
}
|
|
30
|
-
if (result.reason === 'invalid_target') {
|
|
31
|
-
return 'Enter a valid computer IP and Metro port.';
|
|
32
|
-
}
|
|
33
|
-
return result.error ? `Metro switch failed: ${result.error}` : 'Metro switch failed.';
|
|
34
|
-
}
|
|
35
19
|
function DevConnectTab({
|
|
36
20
|
snapshot,
|
|
37
21
|
feature
|
|
38
22
|
}) {
|
|
39
23
|
const inputRef = (0, _react.useRef)(null);
|
|
40
24
|
const [computerHost, setComputerHost] = (0, _react.useState)(snapshot.computerHost);
|
|
41
|
-
const [metroPort, setMetroPort] = (0, _react.useState)(snapshot.metroPort);
|
|
42
25
|
const [daemonPort, setDaemonPort] = (0, _react.useState)(snapshot.daemonPort);
|
|
43
26
|
const [streaming, setStreaming] = (0, _react.useState)(snapshot.streaming);
|
|
44
27
|
const [syncState, setSyncState] = (0, _react.useState)(snapshot.streaming ? 'running' : 'idle');
|
|
45
28
|
const [message, setMessage] = (0, _react.useState)(null);
|
|
46
29
|
const [sending, setSending] = (0, _react.useState)(false);
|
|
47
|
-
const [metroBusy, setMetroBusy] = (0, _react.useState)(false);
|
|
48
|
-
const [diagData, setDiagData] = (0, _react.useState)(null);
|
|
49
|
-
const [diagOpen, setDiagOpen] = (0, _react.useState)(false);
|
|
50
30
|
const isSim = snapshot.isSimulator;
|
|
51
31
|
const updateFeatureSettings = (0, _react.useCallback)(patch => {
|
|
52
32
|
feature.updateSettings?.(patch);
|
|
53
33
|
}, [feature]);
|
|
54
|
-
(0, _react.useEffect)(() => {
|
|
55
|
-
(0, _nativeDevConnect.getNativeDiagnostics)().then(result => {
|
|
56
|
-
if (result) {
|
|
57
|
-
setDiagData(result);
|
|
58
|
-
console.info(`[DevConnect] debugBuild=${result.isDebugBuild} appDelegate=${result.appDelegateClass} persistedHost=${result.persistedMetroHost ?? 'none'}`);
|
|
59
|
-
}
|
|
60
|
-
}).catch(() => {});
|
|
61
|
-
}, []);
|
|
62
|
-
const refreshDiag = (0, _react.useCallback)(() => {
|
|
63
|
-
(0, _nativeDevConnect.getNativeDiagnostics)().then(result => {
|
|
64
|
-
if (result) setDiagData(result);
|
|
65
|
-
}).catch(() => {});
|
|
66
|
-
}, []);
|
|
67
34
|
(0, _react.useEffect)(() => {
|
|
68
35
|
setComputerHost(snapshot.computerHost);
|
|
69
36
|
}, [snapshot.computerHost]);
|
|
70
|
-
(0, _react.useEffect)(() => {
|
|
71
|
-
setMetroPort(snapshot.metroPort);
|
|
72
|
-
}, [snapshot.metroPort]);
|
|
73
37
|
(0, _react.useEffect)(() => {
|
|
74
38
|
setDaemonPort(snapshot.daemonPort);
|
|
75
39
|
}, [snapshot.daemonPort]);
|
|
@@ -77,19 +41,14 @@ function DevConnectTab({
|
|
|
77
41
|
setStreaming(snapshot.streaming);
|
|
78
42
|
setSyncState(snapshot.streaming ? 'running' : 'idle');
|
|
79
43
|
}, [snapshot.streaming]);
|
|
80
|
-
const metroHost = isSim ? getSimulatorMetroHost() : computerHost;
|
|
81
|
-
const metroTarget = (0, _react.useMemo)(() => (0, _devConnectUtils.buildMetroTarget)(metroHost, metroPort), [metroHost, metroPort]);
|
|
82
|
-
const metroUrls = (0, _react.useMemo)(() => (0, _devConnectUtils.buildMetroUrls)(metroHost, metroPort), [metroHost, metroPort]);
|
|
83
44
|
const handleHostChange = (0, _react.useCallback)(value => {
|
|
84
45
|
setComputerHost(value);
|
|
85
46
|
const target = (0, _devConnectUtils.parseComputerTarget)(value);
|
|
86
47
|
if (target) {
|
|
87
|
-
setMetroPort(target.metroPort);
|
|
88
48
|
(0, _devConnectPreferences.saveComputerTarget)(value).then(savedTarget => {
|
|
89
49
|
if (savedTarget) {
|
|
90
50
|
updateFeatureSettings({
|
|
91
|
-
computerHost: savedTarget.computerHost
|
|
92
|
-
metroPort: savedTarget.metroPort
|
|
51
|
+
computerHost: savedTarget.computerHost
|
|
93
52
|
});
|
|
94
53
|
}
|
|
95
54
|
}).catch(() => {});
|
|
@@ -97,16 +56,6 @@ function DevConnectTab({
|
|
|
97
56
|
setSyncState(prev => prev === 'failed' ? 'idle' : prev);
|
|
98
57
|
setMessage(null);
|
|
99
58
|
}, [updateFeatureSettings]);
|
|
100
|
-
const handleMetroPortChange = (0, _react.useCallback)(value => {
|
|
101
|
-
setMetroPort(value);
|
|
102
|
-
const normalized = (0, _devConnectUtils.normalizePort)(value);
|
|
103
|
-
if (normalized) {
|
|
104
|
-
(0, _devConnectPreferences.saveMetroPort)(normalized).then(() => updateFeatureSettings({
|
|
105
|
-
metroPort: normalized
|
|
106
|
-
})).catch(() => {});
|
|
107
|
-
}
|
|
108
|
-
setMessage(null);
|
|
109
|
-
}, [updateFeatureSettings]);
|
|
110
59
|
const handleDaemonPortChange = (0, _react.useCallback)(value => {
|
|
111
60
|
setDaemonPort(value);
|
|
112
61
|
const normalized = (0, _devConnectUtils.normalizePort)(value);
|
|
@@ -138,35 +87,10 @@ function DevConnectTab({
|
|
|
138
87
|
writes.push((0, _devConnectPreferences.saveComputerHost)(normalizedHost));
|
|
139
88
|
setComputerHost(normalizedHost);
|
|
140
89
|
}
|
|
141
|
-
const normalizedMetroPort = (0, _devConnectUtils.normalizePort)(metroPort);
|
|
142
|
-
if (normalizedMetroPort) {
|
|
143
|
-
patch.metroPort = normalizedMetroPort;
|
|
144
|
-
writes.push((0, _devConnectPreferences.saveMetroPort)(normalizedMetroPort));
|
|
145
|
-
setMetroPort(normalizedMetroPort);
|
|
146
|
-
}
|
|
147
|
-
await Promise.all(writes);
|
|
148
|
-
updateFeatureSettings(patch);
|
|
149
|
-
return true;
|
|
150
|
-
}, [computerHost, daemonPort, isSim, metroPort, updateFeatureSettings]);
|
|
151
|
-
const persistMetroSettings = (0, _react.useCallback)(async () => {
|
|
152
|
-
if (!metroTarget) {
|
|
153
|
-
setMessage('Enter a valid computer IP and Metro port.');
|
|
154
|
-
return false;
|
|
155
|
-
}
|
|
156
|
-
const patch = {
|
|
157
|
-
metroPort: metroTarget.port
|
|
158
|
-
};
|
|
159
|
-
const writes = [(0, _devConnectPreferences.saveMetroPort)(metroTarget.port)];
|
|
160
|
-
setMetroPort(metroTarget.port);
|
|
161
|
-
if (!isSim) {
|
|
162
|
-
patch.computerHost = metroTarget.host;
|
|
163
|
-
writes.push((0, _devConnectPreferences.saveComputerTarget)(metroTarget.hostPort));
|
|
164
|
-
setComputerHost(metroTarget.host);
|
|
165
|
-
}
|
|
166
90
|
await Promise.all(writes);
|
|
167
91
|
updateFeatureSettings(patch);
|
|
168
92
|
return true;
|
|
169
|
-
}, [
|
|
93
|
+
}, [computerHost, daemonPort, isSim, updateFeatureSettings]);
|
|
170
94
|
const validateSettings = (0, _react.useCallback)(() => {
|
|
171
95
|
if (!isSim && !(0, _devConnectUtils.normalizeComputerHost)(computerHost)) {
|
|
172
96
|
setMessage('Enter your computer IP first.');
|
|
@@ -281,58 +205,7 @@ function DevConnectTab({
|
|
|
281
205
|
setSending(false);
|
|
282
206
|
}
|
|
283
207
|
}, [configureDaemon, persistConnectionSettings, validateSettings]);
|
|
284
|
-
const applyRemoteBundle = (0, _react.useCallback)(async () => {
|
|
285
|
-
if (!metroTarget) {
|
|
286
|
-
setMessage('Enter a valid computer IP and Metro port.');
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
if (!snapshot.nativeMetroAvailable) {
|
|
290
|
-
setMessage(describeMetroFailure({
|
|
291
|
-
reason: 'native_unavailable'
|
|
292
|
-
}));
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
setMetroBusy(true);
|
|
296
|
-
setMessage('Checking Metro...');
|
|
297
|
-
try {
|
|
298
|
-
if (!(await persistMetroSettings())) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
const result = await (0, _nativeDevConnect.applyMetroBundle)(metroTarget.host, metroTarget.port);
|
|
302
|
-
if (result.ok) {
|
|
303
|
-
setMessage(`Using Metro at ${result.hostPort}. Reloading...`);
|
|
304
|
-
} else {
|
|
305
|
-
setMessage(describeMetroFailure(result));
|
|
306
|
-
}
|
|
307
|
-
} finally {
|
|
308
|
-
setMetroBusy(false);
|
|
309
|
-
}
|
|
310
|
-
}, [metroTarget, persistMetroSettings, snapshot.nativeMetroAvailable]);
|
|
311
|
-
const resetRemoteBundle = (0, _react.useCallback)(async () => {
|
|
312
|
-
if (!snapshot.nativeMetroAvailable) {
|
|
313
|
-
setMessage(describeMetroFailure({
|
|
314
|
-
reason: 'native_unavailable'
|
|
315
|
-
}));
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
setMetroBusy(true);
|
|
319
|
-
try {
|
|
320
|
-
const result = await (0, _nativeDevConnect.resetMetroBundle)();
|
|
321
|
-
if (result.ok) {
|
|
322
|
-
setMessage('Metro host reset. Reloading...');
|
|
323
|
-
} else {
|
|
324
|
-
setMessage(describeMetroFailure(result));
|
|
325
|
-
}
|
|
326
|
-
} finally {
|
|
327
|
-
setMetroBusy(false);
|
|
328
|
-
}
|
|
329
|
-
}, [snapshot.nativeMetroAvailable]);
|
|
330
|
-
|
|
331
|
-
// Metro host switching only works in Debug builds. diagData is iOS-populated; when we know
|
|
332
|
-
// it's a Release build, disable the controls (Android reports null → stays enabled).
|
|
333
|
-
const metroReleaseBlocked = diagData ? !diagData.isDebugBuild : false;
|
|
334
208
|
const canConnect = isSim || Boolean((0, _devConnectUtils.normalizeComputerHost)(computerHost)) && Boolean((0, _devConnectUtils.normalizePort)(daemonPort));
|
|
335
|
-
const canUseMetro = Boolean(metroTarget) && snapshot.nativeMetroAvailable && !metroBusy && !metroReleaseBlocked;
|
|
336
209
|
const busy = sending || syncState === 'checking';
|
|
337
210
|
const subnetPrefix = snapshot.subnetPrefix;
|
|
338
211
|
const ipPlaceholder = subnetPrefix ? `${subnetPrefix}...` : '192.168.1.10';
|
|
@@ -347,7 +220,7 @@ function DevConnectTab({
|
|
|
347
220
|
style: styles.badge,
|
|
348
221
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
349
222
|
style: styles.badgeText,
|
|
350
|
-
children: ["Simulator/emulator - using ",
|
|
223
|
+
children: ["Simulator/emulator - using ", getSimulatorHost()]
|
|
351
224
|
})
|
|
352
225
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
353
226
|
style: styles.section,
|
|
@@ -386,42 +259,20 @@ function DevConnectTab({
|
|
|
386
259
|
style: styles.section,
|
|
387
260
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
388
261
|
style: styles.label,
|
|
389
|
-
children: "
|
|
390
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
391
|
-
style: styles.
|
|
392
|
-
children:
|
|
393
|
-
style: styles.
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
autoCapitalize: "none",
|
|
404
|
-
autoCorrect: false,
|
|
405
|
-
keyboardType: "number-pad",
|
|
406
|
-
returnKeyType: "done"
|
|
407
|
-
})]
|
|
408
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
409
|
-
style: styles.portField,
|
|
410
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
411
|
-
style: styles.portLabel,
|
|
412
|
-
children: "Logs"
|
|
413
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
414
|
-
style: styles.portInput,
|
|
415
|
-
value: daemonPort,
|
|
416
|
-
onChangeText: handleDaemonPortChange,
|
|
417
|
-
placeholder: _devConnectUtils.DEFAULT_DAEMON_PORT,
|
|
418
|
-
placeholderTextColor: _colors.Colors.textLight,
|
|
419
|
-
autoCapitalize: "none",
|
|
420
|
-
autoCorrect: false,
|
|
421
|
-
keyboardType: "number-pad",
|
|
422
|
-
returnKeyType: "done"
|
|
423
|
-
})]
|
|
424
|
-
})]
|
|
262
|
+
children: "Desktop Logs Port"
|
|
263
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
264
|
+
style: styles.inputRow,
|
|
265
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
266
|
+
style: styles.input,
|
|
267
|
+
value: daemonPort,
|
|
268
|
+
onChangeText: handleDaemonPortChange,
|
|
269
|
+
placeholder: _devConnectUtils.DEFAULT_DAEMON_PORT,
|
|
270
|
+
placeholderTextColor: _colors.Colors.textLight,
|
|
271
|
+
autoCapitalize: "none",
|
|
272
|
+
autoCorrect: false,
|
|
273
|
+
keyboardType: "number-pad",
|
|
274
|
+
returnKeyType: "done"
|
|
275
|
+
})
|
|
425
276
|
})]
|
|
426
277
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
427
278
|
style: styles.actions,
|
|
@@ -447,153 +298,6 @@ function DevConnectTab({
|
|
|
447
298
|
}), message ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
448
299
|
style: styles.message,
|
|
449
300
|
children: message
|
|
450
|
-
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
451
|
-
style: styles.section,
|
|
452
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
453
|
-
style: styles.sectionTitleRow,
|
|
454
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
455
|
-
style: styles.sectionTitle,
|
|
456
|
-
children: "Remote JS Bundle"
|
|
457
|
-
}), diagData ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
458
|
-
style: styles.swizzleBadge,
|
|
459
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
460
|
-
style: [styles.swizzleDot, diagData.isDebugBuild ? styles.dotGreen : styles.dotRed]
|
|
461
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
462
|
-
style: styles.swizzleBadgeText,
|
|
463
|
-
children: diagData.isDebugBuild ? 'debug build' : 'release: disabled'
|
|
464
|
-
})]
|
|
465
|
-
}) : null]
|
|
466
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
467
|
-
style: styles.sectionDesc,
|
|
468
|
-
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."
|
|
469
|
-
}), !metroUrls ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
470
|
-
style: styles.stepCard,
|
|
471
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
472
|
-
style: styles.stepHint,
|
|
473
|
-
children: "Enter your computer IP and Metro port to get started."
|
|
474
|
-
})
|
|
475
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
476
|
-
style: styles.stepCard,
|
|
477
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
478
|
-
style: styles.urlRow,
|
|
479
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
480
|
-
style: styles.urlLabel,
|
|
481
|
-
children: "HTTP"
|
|
482
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
483
|
-
style: styles.urlText,
|
|
484
|
-
numberOfLines: 1,
|
|
485
|
-
children: metroUrls.httpUrl
|
|
486
|
-
})]
|
|
487
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
488
|
-
style: styles.urlRow,
|
|
489
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
490
|
-
style: styles.urlLabel,
|
|
491
|
-
children: "Expo"
|
|
492
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
493
|
-
style: styles.urlText,
|
|
494
|
-
numberOfLines: 1,
|
|
495
|
-
children: metroUrls.expUrl
|
|
496
|
-
})]
|
|
497
|
-
})]
|
|
498
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
499
|
-
style: styles.actions,
|
|
500
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
501
|
-
style: [styles.primaryButton, !canUseMetro && styles.buttonDisabled],
|
|
502
|
-
onPress: applyRemoteBundle,
|
|
503
|
-
disabled: !canUseMetro,
|
|
504
|
-
activeOpacity: 0.75,
|
|
505
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
506
|
-
style: styles.primaryButtonText,
|
|
507
|
-
children: metroBusy ? 'Checking...' : 'Use Metro Bundle'
|
|
508
|
-
})
|
|
509
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
510
|
-
style: [styles.secondaryButton, (!snapshot.nativeMetroAvailable || metroBusy) && styles.buttonDisabled],
|
|
511
|
-
onPress: resetRemoteBundle,
|
|
512
|
-
disabled: !snapshot.nativeMetroAvailable || metroBusy,
|
|
513
|
-
activeOpacity: 0.75,
|
|
514
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
515
|
-
style: styles.secondaryButtonText,
|
|
516
|
-
children: "Reset"
|
|
517
|
-
})
|
|
518
|
-
})]
|
|
519
|
-
}), !snapshot.nativeMetroAvailable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
520
|
-
style: styles.hint,
|
|
521
|
-
children: "Native DevConnect requires pod install / Gradle sync and app rebuild."
|
|
522
|
-
}) : null, metroReleaseBlocked ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
523
|
-
style: styles.diagWarning,
|
|
524
|
-
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."
|
|
525
|
-
}) : null]
|
|
526
|
-
}), snapshot.nativeMetroAvailable && diagData ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
527
|
-
style: styles.section,
|
|
528
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
529
|
-
style: styles.diagHeader,
|
|
530
|
-
onPress: () => {
|
|
531
|
-
setDiagOpen(v => !v);
|
|
532
|
-
refreshDiag();
|
|
533
|
-
},
|
|
534
|
-
activeOpacity: 0.7,
|
|
535
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
536
|
-
style: styles.sectionTitle,
|
|
537
|
-
children: "iOS Bundle Status"
|
|
538
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
539
|
-
style: styles.diagChevron,
|
|
540
|
-
children: diagOpen ? '▲' : '▼'
|
|
541
|
-
})]
|
|
542
|
-
}), diagOpen ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
543
|
-
style: styles.diagCard,
|
|
544
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
545
|
-
style: styles.diagRow,
|
|
546
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
547
|
-
style: styles.diagKey,
|
|
548
|
-
children: "AppDelegate"
|
|
549
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
550
|
-
style: styles.diagVal,
|
|
551
|
-
children: diagData.appDelegateClass
|
|
552
|
-
})]
|
|
553
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
554
|
-
style: styles.diagRow,
|
|
555
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
556
|
-
style: styles.diagKey,
|
|
557
|
-
children: "packagerHost"
|
|
558
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
559
|
-
style: styles.diagVal,
|
|
560
|
-
children: diagData.persistedMetroHost ?? '—'
|
|
561
|
-
})]
|
|
562
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
563
|
-
style: styles.diagRow,
|
|
564
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
565
|
-
style: styles.diagKey,
|
|
566
|
-
children: "embedded"
|
|
567
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
568
|
-
style: [styles.diagVal, diagData.hasEmbeddedBundle ? styles.diagGood : styles.diagWarn],
|
|
569
|
-
children: diagData.hasEmbeddedBundle ? 'main.jsbundle' : 'missing'
|
|
570
|
-
})]
|
|
571
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
572
|
-
style: styles.diagRow,
|
|
573
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
574
|
-
style: styles.diagKey,
|
|
575
|
-
children: "build"
|
|
576
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
577
|
-
style: [styles.diagVal, diagData.isDebugBuild ? styles.diagGood : styles.diagWarn],
|
|
578
|
-
children: diagData.isDebugBuild ? 'Debug' : 'Release'
|
|
579
|
-
})]
|
|
580
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
581
|
-
style: styles.diagRow,
|
|
582
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
583
|
-
style: styles.diagKey,
|
|
584
|
-
children: "embedded-first"
|
|
585
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
586
|
-
style: [styles.diagVal, diagData.embeddedFirstHookInstalled ? styles.diagGood : styles.diagWarn],
|
|
587
|
-
children: diagData.embeddedFirstHookInstalled ? 'active' : 'inactive'
|
|
588
|
-
})]
|
|
589
|
-
}), !diagData.embeddedFirstHookInstalled ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
590
|
-
style: styles.diagWarning,
|
|
591
|
-
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."]
|
|
592
|
-
}) : diagData.hasEmbeddedBundle === false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
593
|
-
style: styles.diagWarning,
|
|
594
|
-
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."
|
|
595
|
-
}) : null]
|
|
596
|
-
}) : null]
|
|
597
301
|
}) : null]
|
|
598
302
|
})
|
|
599
303
|
});
|
|
@@ -624,18 +328,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
624
328
|
section: {
|
|
625
329
|
marginBottom: 14
|
|
626
330
|
},
|
|
627
|
-
sectionTitle: {
|
|
628
|
-
fontSize: 14,
|
|
629
|
-
fontWeight: '600',
|
|
630
|
-
color: _colors.Colors.text,
|
|
631
|
-
marginBottom: 4
|
|
632
|
-
},
|
|
633
|
-
sectionDesc: {
|
|
634
|
-
fontSize: 12,
|
|
635
|
-
color: _colors.Colors.textSecondary,
|
|
636
|
-
marginBottom: 10,
|
|
637
|
-
lineHeight: 17
|
|
638
|
-
},
|
|
639
331
|
label: {
|
|
640
332
|
fontSize: 13,
|
|
641
333
|
fontWeight: '500',
|
|
@@ -666,29 +358,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
666
358
|
color: _colors.Colors.text,
|
|
667
359
|
fontFamily: 'Courier'
|
|
668
360
|
},
|
|
669
|
-
portRow: {
|
|
670
|
-
flexDirection: 'row',
|
|
671
|
-
gap: 10
|
|
672
|
-
},
|
|
673
|
-
portField: {
|
|
674
|
-
flex: 1
|
|
675
|
-
},
|
|
676
|
-
portLabel: {
|
|
677
|
-
fontSize: 11,
|
|
678
|
-
color: _colors.Colors.textSecondary,
|
|
679
|
-
marginBottom: 4
|
|
680
|
-
},
|
|
681
|
-
portInput: {
|
|
682
|
-
backgroundColor: _colors.Colors.surface,
|
|
683
|
-
borderWidth: 1,
|
|
684
|
-
borderColor: _colors.Colors.border,
|
|
685
|
-
borderRadius: 8,
|
|
686
|
-
paddingHorizontal: 12,
|
|
687
|
-
paddingVertical: 9,
|
|
688
|
-
fontSize: 13,
|
|
689
|
-
color: _colors.Colors.text,
|
|
690
|
-
fontFamily: 'Courier'
|
|
691
|
-
},
|
|
692
361
|
actions: {
|
|
693
362
|
flexDirection: 'row',
|
|
694
363
|
gap: 10,
|
|
@@ -731,127 +400,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
731
400
|
lineHeight: 17,
|
|
732
401
|
color: _colors.Colors.textSecondary,
|
|
733
402
|
marginBottom: 12
|
|
734
|
-
},
|
|
735
|
-
hint: {
|
|
736
|
-
fontSize: 12,
|
|
737
|
-
color: _colors.Colors.textLight,
|
|
738
|
-
lineHeight: 17
|
|
739
|
-
},
|
|
740
|
-
stepCard: {
|
|
741
|
-
backgroundColor: _colors.Colors.surface,
|
|
742
|
-
borderWidth: 1,
|
|
743
|
-
borderColor: _colors.Colors.border,
|
|
744
|
-
borderRadius: 10,
|
|
745
|
-
padding: 12,
|
|
746
|
-
marginBottom: 8
|
|
747
|
-
},
|
|
748
|
-
stepHint: {
|
|
749
|
-
fontSize: 12,
|
|
750
|
-
color: _colors.Colors.textSecondary,
|
|
751
|
-
lineHeight: 17
|
|
752
|
-
},
|
|
753
|
-
urlLabel: {
|
|
754
|
-
minWidth: 40,
|
|
755
|
-
fontSize: 10,
|
|
756
|
-
fontWeight: '600',
|
|
757
|
-
color: _colors.Colors.primary,
|
|
758
|
-
backgroundColor: `${_colors.Colors.primary}15`,
|
|
759
|
-
paddingHorizontal: 6,
|
|
760
|
-
paddingVertical: 2,
|
|
761
|
-
borderRadius: 4,
|
|
762
|
-
marginRight: 8,
|
|
763
|
-
textAlign: 'center'
|
|
764
|
-
},
|
|
765
|
-
urlRow: {
|
|
766
|
-
flexDirection: 'row',
|
|
767
|
-
alignItems: 'center',
|
|
768
|
-
borderBottomWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
769
|
-
borderBottomColor: _colors.Colors.border,
|
|
770
|
-
paddingVertical: 7
|
|
771
|
-
},
|
|
772
|
-
urlText: {
|
|
773
|
-
flex: 1,
|
|
774
|
-
fontSize: 13,
|
|
775
|
-
fontFamily: 'Courier',
|
|
776
|
-
color: _colors.Colors.text
|
|
777
|
-
},
|
|
778
|
-
sectionTitleRow: {
|
|
779
|
-
flexDirection: 'row',
|
|
780
|
-
alignItems: 'center',
|
|
781
|
-
justifyContent: 'space-between',
|
|
782
|
-
marginBottom: 4
|
|
783
|
-
},
|
|
784
|
-
swizzleBadge: {
|
|
785
|
-
flexDirection: 'row',
|
|
786
|
-
alignItems: 'center',
|
|
787
|
-
gap: 4,
|
|
788
|
-
paddingHorizontal: 7,
|
|
789
|
-
paddingVertical: 3,
|
|
790
|
-
borderRadius: 10,
|
|
791
|
-
backgroundColor: _colors.Colors.surface,
|
|
792
|
-
borderWidth: 1,
|
|
793
|
-
borderColor: _colors.Colors.border
|
|
794
|
-
},
|
|
795
|
-
swizzleDot: {
|
|
796
|
-
width: 6,
|
|
797
|
-
height: 6,
|
|
798
|
-
borderRadius: 3
|
|
799
|
-
},
|
|
800
|
-
dotGreen: {
|
|
801
|
-
backgroundColor: '#34C759'
|
|
802
|
-
},
|
|
803
|
-
dotRed: {
|
|
804
|
-
backgroundColor: '#FF3B30'
|
|
805
|
-
},
|
|
806
|
-
swizzleBadgeText: {
|
|
807
|
-
fontSize: 11,
|
|
808
|
-
color: _colors.Colors.textSecondary,
|
|
809
|
-
fontFamily: 'Courier'
|
|
810
|
-
},
|
|
811
|
-
diagHeader: {
|
|
812
|
-
flexDirection: 'row',
|
|
813
|
-
alignItems: 'center',
|
|
814
|
-
justifyContent: 'space-between',
|
|
815
|
-
marginBottom: 6
|
|
816
|
-
},
|
|
817
|
-
diagChevron: {
|
|
818
|
-
fontSize: 12,
|
|
819
|
-
color: _colors.Colors.textSecondary
|
|
820
|
-
},
|
|
821
|
-
diagCard: {
|
|
822
|
-
backgroundColor: _colors.Colors.surface,
|
|
823
|
-
borderWidth: 1,
|
|
824
|
-
borderColor: _colors.Colors.border,
|
|
825
|
-
borderRadius: 10,
|
|
826
|
-
padding: 10
|
|
827
|
-
},
|
|
828
|
-
diagRow: {
|
|
829
|
-
flexDirection: 'row',
|
|
830
|
-
justifyContent: 'space-between',
|
|
831
|
-
paddingVertical: 4
|
|
832
|
-
},
|
|
833
|
-
diagKey: {
|
|
834
|
-
fontSize: 12,
|
|
835
|
-
color: _colors.Colors.textSecondary,
|
|
836
|
-
fontFamily: 'Courier'
|
|
837
|
-
},
|
|
838
|
-
diagVal: {
|
|
839
|
-
fontSize: 12,
|
|
840
|
-
color: _colors.Colors.text,
|
|
841
|
-
fontFamily: 'Courier',
|
|
842
|
-
fontWeight: '600'
|
|
843
|
-
},
|
|
844
|
-
diagGood: {
|
|
845
|
-
color: '#34C759'
|
|
846
|
-
},
|
|
847
|
-
diagWarn: {
|
|
848
|
-
color: '#FF9500'
|
|
849
|
-
},
|
|
850
|
-
diagWarning: {
|
|
851
|
-
marginTop: 10,
|
|
852
|
-
fontSize: 11,
|
|
853
|
-
color: '#FF9500',
|
|
854
|
-
lineHeight: 16
|
|
855
403
|
}
|
|
856
404
|
});
|
|
857
405
|
//# sourceMappingURL=DevConnectTab.js.map
|