@swmansion/argent 0.34.1-next.33 → 0.34.1-next.34
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/cli-cmds.mjs +1 -1
- package/dist/installer.mjs +1 -1
- package/dist/tool-server.cjs +29 -18
- package/package.json +1 -1
package/dist/cli-cmds.mjs
CHANGED
|
@@ -36256,7 +36256,7 @@ function isCi(env = process.env) {
|
|
|
36256
36256
|
var SESSION_ID2 = randomUUID5();
|
|
36257
36257
|
function readCliVersion() {
|
|
36258
36258
|
if (true) {
|
|
36259
|
-
return "0.34.1-next.
|
|
36259
|
+
return "0.34.1-next.34";
|
|
36260
36260
|
}
|
|
36261
36261
|
return "0.0.0";
|
|
36262
36262
|
}
|
package/dist/installer.mjs
CHANGED
|
@@ -16942,7 +16942,7 @@ function isCi(env = process.env) {
|
|
|
16942
16942
|
var SESSION_ID = randomUUID4();
|
|
16943
16943
|
function readCliVersion() {
|
|
16944
16944
|
if (true) {
|
|
16945
|
-
return "0.34.1-next.
|
|
16945
|
+
return "0.34.1-next.34";
|
|
16946
16946
|
}
|
|
16947
16947
|
return "0.0.0";
|
|
16948
16948
|
}
|
package/dist/tool-server.cjs
CHANGED
|
@@ -101440,7 +101440,7 @@ function isCi(env = process.env) {
|
|
|
101440
101440
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
101441
101441
|
function readCliVersion() {
|
|
101442
101442
|
if (true) {
|
|
101443
|
-
return "0.34.1-next.
|
|
101443
|
+
return "0.34.1-next.34";
|
|
101444
101444
|
}
|
|
101445
101445
|
return "0.0.0";
|
|
101446
101446
|
}
|
|
@@ -170911,12 +170911,12 @@ async function parseCpuFile(filePath, targetPid = null) {
|
|
|
170911
170911
|
}
|
|
170912
170912
|
}
|
|
170913
170913
|
async function parseHangsFile(filePath) {
|
|
170914
|
-
if (!filePath) return
|
|
170914
|
+
if (!filePath) return null;
|
|
170915
170915
|
try {
|
|
170916
170916
|
const xml = await import_fs8.promises.readFile(filePath, "utf8");
|
|
170917
|
-
return parseHangsXml(xml);
|
|
170917
|
+
return /<node(?=[\s/>])/.test(xml) ? parseHangsXml(xml) : null;
|
|
170918
170918
|
} catch {
|
|
170919
|
-
return
|
|
170919
|
+
return null;
|
|
170920
170920
|
}
|
|
170921
170921
|
}
|
|
170922
170922
|
async function parseLeaksFile(filePath) {
|
|
@@ -171273,12 +171273,13 @@ function aggregateLeaks(rawLeaks) {
|
|
|
171273
171273
|
|
|
171274
171274
|
// ../tool-server/src/utils/ios-profiler/pipeline/index.ts
|
|
171275
171275
|
async function runIosProfilerPipeline(files, options = {}) {
|
|
171276
|
-
const [cpuSamples,
|
|
171276
|
+
const [cpuSamples, hangsTable, rawLeaks] = await Promise.all([
|
|
171277
171277
|
parseCpuFile(files.cpu ?? null, options.cpuFilterPid ?? null),
|
|
171278
171278
|
parseHangsFile(files.hangs ?? null),
|
|
171279
171279
|
parseLeaksFile(files.leaks ?? null)
|
|
171280
171280
|
]);
|
|
171281
171281
|
for (const sample of cpuSamples) sample.stack = withAppCallsThroughArgent(sample.stack);
|
|
171282
|
+
const rawHangs = hangsTable ?? [];
|
|
171282
171283
|
const suspensions = options.appSuspensions != null ? suspendedTimeInHangs(rawHangs, options.appSuspensions) : null;
|
|
171283
171284
|
const correlated = correlateHangsWithCpu(rawHangs, cpuSamples, suspensions?.suspendedNs);
|
|
171284
171285
|
const { hangSampleTimestamps } = correlated;
|
|
@@ -171292,6 +171293,7 @@ async function runIosProfilerPipeline(files, options = {}) {
|
|
|
171292
171293
|
bottlenecks,
|
|
171293
171294
|
cpuSamples,
|
|
171294
171295
|
uiHangs,
|
|
171296
|
+
hangsRecorded: hangsTable !== null,
|
|
171295
171297
|
cpuHotspots,
|
|
171296
171298
|
memoryLeaks,
|
|
171297
171299
|
toolingCpuMs: {
|
|
@@ -173101,9 +173103,8 @@ async function analyzeNativeProfilerIos(api) {
|
|
|
173101
173103
|
error_kind: "validation"
|
|
173102
173104
|
});
|
|
173103
173105
|
}
|
|
173104
|
-
const [cpuMissing,
|
|
173106
|
+
const [cpuMissing, leaksMissing] = await Promise.all([
|
|
173105
173107
|
checkExportFileMissing(api.exportedFiles.cpu ?? null),
|
|
173106
|
-
checkExportFileMissing(api.exportedFiles.hangs ?? null),
|
|
173107
173108
|
checkExportFileMissing(api.exportedFiles.leaks ?? null)
|
|
173108
173109
|
]);
|
|
173109
173110
|
const appSuspensions = api.platform === "macos" ? api.appSuspensions : null;
|
|
@@ -173111,6 +173112,7 @@ async function analyzeNativeProfilerIos(api) {
|
|
|
173111
173112
|
bottlenecks,
|
|
173112
173113
|
cpuSamples,
|
|
173113
173114
|
uiHangs,
|
|
173115
|
+
hangsRecorded,
|
|
173114
173116
|
cpuHotspots,
|
|
173115
173117
|
memoryLeaks,
|
|
173116
173118
|
toolingCpuMs,
|
|
@@ -173124,6 +173126,7 @@ async function analyzeNativeProfilerIos(api) {
|
|
|
173124
173126
|
api.parsedData = {
|
|
173125
173127
|
cpuSamples,
|
|
173126
173128
|
uiHangs,
|
|
173129
|
+
hangsRecorded,
|
|
173127
173130
|
cpuHotspots,
|
|
173128
173131
|
memoryLeaks,
|
|
173129
173132
|
leaksRecorded,
|
|
@@ -173146,8 +173149,9 @@ async function analyzeNativeProfilerIos(api) {
|
|
|
173146
173149
|
}
|
|
173147
173150
|
if (!api.exportedFiles.hangs) {
|
|
173148
173151
|
exportErrors.hangs = skipped ?? "Hangs export failed \u2014 no potential-hangs table found in trace.";
|
|
173149
|
-
} else if (
|
|
173150
|
-
|
|
173152
|
+
} else if (!hangsRecorded) {
|
|
173153
|
+
const hangsMissing = await checkExportFileMissing(api.exportedFiles.hangs);
|
|
173154
|
+
exportErrors.hangs = hangsMissing ? `Hangs export ${hangsMissing} \u2014 no hang data could be analyzed. Re-run native-profiler-stop.` : `Could not read a potential-hangs table from \`${api.exportedFiles.hangs}\`.`;
|
|
173151
173155
|
}
|
|
173152
173156
|
if (api.exportedFiles.leaks && leaksMissing) {
|
|
173153
173157
|
exportErrors.leaks = `Leaks export ${leaksMissing} \u2014 the trace export claims it succeeded but the file is gone or unreadable, so no leak data could be analyzed. Re-run native-profiler-stop.`;
|
|
@@ -179175,6 +179179,7 @@ Fails if no CPU profile is stored; run react-profiler-stop (and ideally react-pr
|
|
|
179175
179179
|
init_zod();
|
|
179176
179180
|
init_src2();
|
|
179177
179181
|
init_device_info();
|
|
179182
|
+
var HANGS_NOT_RECORDED = "_No UI hang data was recorded._";
|
|
179178
179183
|
var stackQueryMode = {
|
|
179179
179184
|
hang_stacks: "hang stacks",
|
|
179180
179185
|
function_callers: "function callers",
|
|
@@ -179303,7 +179308,7 @@ function renderFunctionCallersIos(cpuSamples, functionName, topN2) {
|
|
|
179303
179308
|
}
|
|
179304
179309
|
return lines.join("\n");
|
|
179305
179310
|
}
|
|
179306
|
-
function renderThreadBreakdownIos(cpuSamples, cpuHotspots, threadFilter, topN2) {
|
|
179311
|
+
function renderThreadBreakdownIos(cpuSamples, cpuHotspots, threadFilter, topN2, hangsRecorded = true) {
|
|
179307
179312
|
const threadWeight = /* @__PURE__ */ new Map();
|
|
179308
179313
|
const threadSamples = /* @__PURE__ */ new Map();
|
|
179309
179314
|
for (const sample of cpuSamples) {
|
|
@@ -179319,10 +179324,10 @@ function renderThreadBreakdownIos(cpuSamples, cpuHotspots, threadFilter, topN2)
|
|
|
179319
179324
|
}
|
|
179320
179325
|
const lines = [
|
|
179321
179326
|
`## Thread CPU Breakdown${threadFilter ? ` (filter: "${threadFilter}")` : ""}`,
|
|
179322
|
-
""
|
|
179323
|
-
"| Thread | Weight (ms) | % | Samples |",
|
|
179324
|
-
"|---|---|---|---|"
|
|
179327
|
+
""
|
|
179325
179328
|
];
|
|
179329
|
+
if (!hangsRecorded) lines.push(HANGS_NOT_RECORDED, "");
|
|
179330
|
+
lines.push("| Thread | Weight (ms) | % | Samples |", "|---|---|---|---|");
|
|
179326
179331
|
for (const [thread, weight] of sorted) {
|
|
179327
179332
|
const weightMs = Math.round(weight / 1e6);
|
|
179328
179333
|
const pct = totalWeight > 0 ? (weight / totalWeight * 100).toFixed(1) : "0";
|
|
@@ -179340,8 +179345,9 @@ function renderThreadBreakdownIos(cpuSamples, cpuHotspots, threadFilter, topN2)
|
|
|
179340
179345
|
lines.push("| Function | Weight (ms) | % | During Hang |");
|
|
179341
179346
|
lines.push("|---|---|---|---|");
|
|
179342
179347
|
for (const h of threadHotspots.slice(0, topN2)) {
|
|
179348
|
+
const hangStatus = hangsRecorded ? h.duringHang ? "Yes" : "No" : "Not recorded";
|
|
179343
179349
|
lines.push(
|
|
179344
|
-
`| \`${escapeMarkdownTableCell(demangleSymbol(h.dominantFunction))}\` | ${h.totalWeightMs} | ${h.weightPercentage}% | ${
|
|
179350
|
+
`| \`${escapeMarkdownTableCell(demangleSymbol(h.dominantFunction))}\` | ${h.totalWeightMs} | ${h.weightPercentage}% | ${hangStatus} |`
|
|
179345
179351
|
);
|
|
179346
179352
|
}
|
|
179347
179353
|
}
|
|
@@ -179408,6 +179414,7 @@ async function executeIos(api, params) {
|
|
|
179408
179414
|
error_kind: "validation"
|
|
179409
179415
|
});
|
|
179410
179416
|
}
|
|
179417
|
+
if (!data.hangsRecorded) return HANGS_NOT_RECORDED;
|
|
179411
179418
|
return renderHangStacksIos(data.cpuSamples, data.uiHangs, params.hang_index, params.top_n);
|
|
179412
179419
|
}
|
|
179413
179420
|
case "function_callers": {
|
|
@@ -179426,7 +179433,8 @@ async function executeIos(api, params) {
|
|
|
179426
179433
|
data.cpuSamples,
|
|
179427
179434
|
data.cpuHotspots,
|
|
179428
179435
|
params.thread,
|
|
179429
|
-
params.top_n
|
|
179436
|
+
params.top_n,
|
|
179437
|
+
data.hangsRecorded
|
|
179430
179438
|
);
|
|
179431
179439
|
case "leak_stacks":
|
|
179432
179440
|
return renderLeakStacksIos(
|
|
@@ -179633,6 +179641,7 @@ Fails if either react-profiler-analyze or native-profiler-analyze has not been c
|
|
|
179633
179641
|
);
|
|
179634
179642
|
}
|
|
179635
179643
|
let uiHangs;
|
|
179644
|
+
let hangsRecorded = true;
|
|
179636
179645
|
let memoryLeaks;
|
|
179637
179646
|
let leaksRecorded;
|
|
179638
179647
|
if (nativeApi.platform === "android") {
|
|
@@ -179661,6 +179670,7 @@ Fails if either react-profiler-analyze or native-profiler-analyze has not been c
|
|
|
179661
179670
|
});
|
|
179662
179671
|
}
|
|
179663
179672
|
uiHangs = nativeApi.parsedData.uiHangs;
|
|
179673
|
+
hangsRecorded = nativeApi.parsedData.hangsRecorded;
|
|
179664
179674
|
memoryLeaks = nativeApi.parsedData.memoryLeaks;
|
|
179665
179675
|
leaksRecorded = nativeApi.parsedData.leaksRecorded;
|
|
179666
179676
|
}
|
|
@@ -179759,7 +179769,7 @@ Fails if either react-profiler-analyze or native-profiler-analyze has not been c
|
|
|
179759
179769
|
"React Profiler + Native Profiler \u2014 Cross-Tool Correlation",
|
|
179760
179770
|
"",
|
|
179761
179771
|
`**React Profiler:** ${nonMarginCommits.length} hot commits `,
|
|
179762
|
-
`**Native Profiler:** ${uiHangs.length} hangs, ` + (leaksRecorded ? `${memoryLeaks.length} leaks` : `leaks not recorded`),
|
|
179772
|
+
`**Native Profiler:** ${hangsRecorded ? `${uiHangs.length} hangs` : "hangs not recorded"}, ` + (leaksRecorded ? `${memoryLeaks.length} leaks` : `leaks not recorded`),
|
|
179763
179773
|
"",
|
|
179764
179774
|
`**Clock offset:** React started ${(Math.abs(reactWallStart - nativeWallStart) / 1e3).toFixed(1)}s ${reactWallStart > nativeWallStart ? "after" : "before"} native profiler`,
|
|
179765
179775
|
""
|
|
@@ -180220,12 +180230,13 @@ async function loadNativeSession(debugDir, sessionId, api, appProcessOverride) {
|
|
|
180220
180230
|
path56.join(debugDir, `native-profiler-${sessionId}.trace`)
|
|
180221
180231
|
);
|
|
180222
180232
|
const appSuspensions = metadata?.appSuspensions ?? null;
|
|
180223
|
-
const { cpuSamples, uiHangs, cpuHotspots, memoryLeaks } = await runIosProfilerPipeline(files, {
|
|
180233
|
+
const { cpuSamples, uiHangs, hangsRecorded, cpuHotspots, memoryLeaks } = await runIosProfilerPipeline(files, {
|
|
180224
180234
|
appSuspensions
|
|
180225
180235
|
});
|
|
180226
180236
|
api.parsedData = {
|
|
180227
180237
|
cpuSamples,
|
|
180228
180238
|
uiHangs,
|
|
180239
|
+
hangsRecorded,
|
|
180229
180240
|
cpuHotspots,
|
|
180230
180241
|
memoryLeaks,
|
|
180231
180242
|
// Stop writes no raw_leaks.xml when the trace had no Leaks table.
|
|
@@ -180246,7 +180257,7 @@ async function loadNativeSession(debugDir, sessionId, api, appProcessOverride) {
|
|
|
180246
180257
|
`Loaded native profiler session \`${sessionId}\`.`,
|
|
180247
180258
|
"",
|
|
180248
180259
|
`- CPU samples: ${cpuSamples.length}`,
|
|
180249
|
-
`- UI hangs: ${
|
|
180260
|
+
`- UI hangs: ${hangsRecorded ? uiHangs.length : "not recorded"}`,
|
|
180250
180261
|
`- CPU hotspots: ${cpuHotspots.length}`,
|
|
180251
180262
|
`- Memory leaks: ${files.leaks ? memoryLeaks.length : "not recorded"}`,
|
|
180252
180263
|
"",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swmansion/argent",
|
|
3
|
-
"version": "0.34.1-next.
|
|
3
|
+
"version": "0.34.1-next.34",
|
|
4
4
|
"mcpName": "io.github.software-mansion/argent",
|
|
5
5
|
"description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
|
|
6
6
|
"license": "Apache-2.0",
|