@impakers/debug 1.4.1 → 1.4.2
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/react.js +3 -31
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +3 -31
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -1412,9 +1412,6 @@ function probeComponentSource(fiber) {
|
|
|
1412
1412
|
}
|
|
1413
1413
|
const dispatcher = getReactDispatcher();
|
|
1414
1414
|
if (!dispatcher) {
|
|
1415
|
-
if (typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG) {
|
|
1416
|
-
console.log("[impakers-debug] dispatcher not found, skipping probe");
|
|
1417
|
-
}
|
|
1418
1415
|
sourceProbeCache.set(fn, null);
|
|
1419
1416
|
return null;
|
|
1420
1417
|
}
|
|
@@ -1434,13 +1431,7 @@ function probeComponentSource(fiber) {
|
|
|
1434
1431
|
fn({});
|
|
1435
1432
|
} catch (e) {
|
|
1436
1433
|
if (e instanceof Error && e.stack) {
|
|
1437
|
-
if (typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG) {
|
|
1438
|
-
console.log("[impakers-debug] probe stack:", e.stack);
|
|
1439
|
-
}
|
|
1440
1434
|
const frame = parseComponentFrame(e.stack);
|
|
1441
|
-
if (typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG) {
|
|
1442
|
-
console.log("[impakers-debug] parsed frame:", frame);
|
|
1443
|
-
}
|
|
1444
1435
|
if (frame) {
|
|
1445
1436
|
const cleaned = cleanSourcePath(frame.fileName);
|
|
1446
1437
|
result = {
|
|
@@ -1497,9 +1488,6 @@ function getSourceLocation(element) {
|
|
|
1497
1488
|
};
|
|
1498
1489
|
}
|
|
1499
1490
|
const probed = probeSourceWalk(fiber);
|
|
1500
|
-
if (typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG) {
|
|
1501
|
-
console.log("[impakers-debug] probe result:", probed);
|
|
1502
|
-
}
|
|
1503
1491
|
if (probed) {
|
|
1504
1492
|
return { found: true, source: probed, isReactApp: true, isProduction: false };
|
|
1505
1493
|
}
|
|
@@ -2105,35 +2093,28 @@ async function getSourceMapUrlFromBundle(bundleUrl) {
|
|
|
2105
2093
|
async function loadSourceMap(bundleUrl) {
|
|
2106
2094
|
if (cache2.has(bundleUrl)) return cache2.get(bundleUrl) ?? null;
|
|
2107
2095
|
if (failedUrls.has(bundleUrl)) return null;
|
|
2108
|
-
const debugLog = typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG;
|
|
2109
2096
|
const directMapUrl = bundleUrl.endsWith(".map") ? bundleUrl : `${bundleUrl}.map`;
|
|
2110
2097
|
try {
|
|
2111
2098
|
const res = await fetch(directMapUrl, { cache: "force-cache" });
|
|
2112
|
-
if (debugLog) console.log("[impakers-debug] 1\uCC28 .map fetch:", res.status, directMapUrl);
|
|
2113
2099
|
if (res.ok) {
|
|
2114
2100
|
const rawMap = await res.json();
|
|
2115
2101
|
const traceMap = new AnyMap(rawMap);
|
|
2116
2102
|
cache2.set(bundleUrl, traceMap);
|
|
2117
2103
|
return traceMap;
|
|
2118
2104
|
}
|
|
2119
|
-
} catch
|
|
2120
|
-
if (debugLog) console.log("[impakers-debug] 1\uCC28 .map fetch exception:", e);
|
|
2105
|
+
} catch {
|
|
2121
2106
|
}
|
|
2122
|
-
if (debugLog) console.log("[impakers-debug] 2\uCC28 \uC2DC\uB3C4: JS\uC5D0\uC11C sourceMappingURL \uCD94\uCD9C...");
|
|
2123
2107
|
const actualMapUrl = await getSourceMapUrlFromBundle(bundleUrl);
|
|
2124
|
-
if (debugLog) console.log("[impakers-debug] 2\uCC28 actualMapUrl:", actualMapUrl);
|
|
2125
2108
|
if (actualMapUrl) {
|
|
2126
2109
|
try {
|
|
2127
2110
|
const res = await fetch(actualMapUrl, { cache: "force-cache" });
|
|
2128
|
-
if (debugLog) console.log("[impakers-debug] 2\uCC28 .map fetch:", res.status, actualMapUrl);
|
|
2129
2111
|
if (res.ok) {
|
|
2130
2112
|
const rawMap = await res.json();
|
|
2131
2113
|
const traceMap = new AnyMap(rawMap);
|
|
2132
2114
|
cache2.set(bundleUrl, traceMap);
|
|
2133
2115
|
return traceMap;
|
|
2134
2116
|
}
|
|
2135
|
-
} catch
|
|
2136
|
-
if (debugLog) console.log("[impakers-debug] 2\uCC28 .map fetch exception:", e);
|
|
2117
|
+
} catch {
|
|
2137
2118
|
}
|
|
2138
2119
|
}
|
|
2139
2120
|
failedUrls.add(bundleUrl);
|
|
@@ -3618,13 +3599,7 @@ function DebugWidget({ endpoint, getUser, onHide }) {
|
|
|
3618
3599
|
setHoverInfo(null);
|
|
3619
3600
|
const rawSource = detectSourceFile(elementUnder);
|
|
3620
3601
|
if (rawSource?.includes("/chunks/")) {
|
|
3621
|
-
if (window.__IMPAKERS_DEBUG_LOG) {
|
|
3622
|
-
console.log("[impakers-debug] async resolve start:", rawSource);
|
|
3623
|
-
}
|
|
3624
3602
|
resolveSourceString(rawSource).then((resolved) => {
|
|
3625
|
-
if (window.__IMPAKERS_DEBUG_LOG) {
|
|
3626
|
-
console.log("[impakers-debug] async resolve result:", resolved);
|
|
3627
|
-
}
|
|
3628
3603
|
if (resolved) {
|
|
3629
3604
|
setPendingAnnotation(
|
|
3630
3605
|
(prev) => prev ? {
|
|
@@ -3634,10 +3609,7 @@ function DebugWidget({ endpoint, getUser, onHide }) {
|
|
|
3634
3609
|
} : prev
|
|
3635
3610
|
);
|
|
3636
3611
|
}
|
|
3637
|
-
}).catch((
|
|
3638
|
-
if (window.__IMPAKERS_DEBUG_LOG) {
|
|
3639
|
-
console.log("[impakers-debug] async resolve error:", err);
|
|
3640
|
-
}
|
|
3612
|
+
}).catch(() => {
|
|
3641
3613
|
});
|
|
3642
3614
|
}
|
|
3643
3615
|
};
|