@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.js
CHANGED
|
@@ -1446,9 +1446,6 @@ function probeComponentSource(fiber) {
|
|
|
1446
1446
|
}
|
|
1447
1447
|
const dispatcher = getReactDispatcher();
|
|
1448
1448
|
if (!dispatcher) {
|
|
1449
|
-
if (typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG) {
|
|
1450
|
-
console.log("[impakers-debug] dispatcher not found, skipping probe");
|
|
1451
|
-
}
|
|
1452
1449
|
sourceProbeCache.set(fn, null);
|
|
1453
1450
|
return null;
|
|
1454
1451
|
}
|
|
@@ -1468,13 +1465,7 @@ function probeComponentSource(fiber) {
|
|
|
1468
1465
|
fn({});
|
|
1469
1466
|
} catch (e) {
|
|
1470
1467
|
if (e instanceof Error && e.stack) {
|
|
1471
|
-
if (typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG) {
|
|
1472
|
-
console.log("[impakers-debug] probe stack:", e.stack);
|
|
1473
|
-
}
|
|
1474
1468
|
const frame = parseComponentFrame(e.stack);
|
|
1475
|
-
if (typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG) {
|
|
1476
|
-
console.log("[impakers-debug] parsed frame:", frame);
|
|
1477
|
-
}
|
|
1478
1469
|
if (frame) {
|
|
1479
1470
|
const cleaned = cleanSourcePath(frame.fileName);
|
|
1480
1471
|
result = {
|
|
@@ -1531,9 +1522,6 @@ function getSourceLocation(element) {
|
|
|
1531
1522
|
};
|
|
1532
1523
|
}
|
|
1533
1524
|
const probed = probeSourceWalk(fiber);
|
|
1534
|
-
if (typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG) {
|
|
1535
|
-
console.log("[impakers-debug] probe result:", probed);
|
|
1536
|
-
}
|
|
1537
1525
|
if (probed) {
|
|
1538
1526
|
return { found: true, source: probed, isReactApp: true, isProduction: false };
|
|
1539
1527
|
}
|
|
@@ -2139,35 +2127,28 @@ async function getSourceMapUrlFromBundle(bundleUrl) {
|
|
|
2139
2127
|
async function loadSourceMap(bundleUrl) {
|
|
2140
2128
|
if (cache2.has(bundleUrl)) return cache2.get(bundleUrl) ?? null;
|
|
2141
2129
|
if (failedUrls.has(bundleUrl)) return null;
|
|
2142
|
-
const debugLog = typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG;
|
|
2143
2130
|
const directMapUrl = bundleUrl.endsWith(".map") ? bundleUrl : `${bundleUrl}.map`;
|
|
2144
2131
|
try {
|
|
2145
2132
|
const res = await fetch(directMapUrl, { cache: "force-cache" });
|
|
2146
|
-
if (debugLog) console.log("[impakers-debug] 1\uCC28 .map fetch:", res.status, directMapUrl);
|
|
2147
2133
|
if (res.ok) {
|
|
2148
2134
|
const rawMap = await res.json();
|
|
2149
2135
|
const traceMap = new import_trace_mapping.AnyMap(rawMap);
|
|
2150
2136
|
cache2.set(bundleUrl, traceMap);
|
|
2151
2137
|
return traceMap;
|
|
2152
2138
|
}
|
|
2153
|
-
} catch
|
|
2154
|
-
if (debugLog) console.log("[impakers-debug] 1\uCC28 .map fetch exception:", e);
|
|
2139
|
+
} catch {
|
|
2155
2140
|
}
|
|
2156
|
-
if (debugLog) console.log("[impakers-debug] 2\uCC28 \uC2DC\uB3C4: JS\uC5D0\uC11C sourceMappingURL \uCD94\uCD9C...");
|
|
2157
2141
|
const actualMapUrl = await getSourceMapUrlFromBundle(bundleUrl);
|
|
2158
|
-
if (debugLog) console.log("[impakers-debug] 2\uCC28 actualMapUrl:", actualMapUrl);
|
|
2159
2142
|
if (actualMapUrl) {
|
|
2160
2143
|
try {
|
|
2161
2144
|
const res = await fetch(actualMapUrl, { cache: "force-cache" });
|
|
2162
|
-
if (debugLog) console.log("[impakers-debug] 2\uCC28 .map fetch:", res.status, actualMapUrl);
|
|
2163
2145
|
if (res.ok) {
|
|
2164
2146
|
const rawMap = await res.json();
|
|
2165
2147
|
const traceMap = new import_trace_mapping.AnyMap(rawMap);
|
|
2166
2148
|
cache2.set(bundleUrl, traceMap);
|
|
2167
2149
|
return traceMap;
|
|
2168
2150
|
}
|
|
2169
|
-
} catch
|
|
2170
|
-
if (debugLog) console.log("[impakers-debug] 2\uCC28 .map fetch exception:", e);
|
|
2151
|
+
} catch {
|
|
2171
2152
|
}
|
|
2172
2153
|
}
|
|
2173
2154
|
failedUrls.add(bundleUrl);
|
|
@@ -3652,13 +3633,7 @@ function DebugWidget({ endpoint, getUser, onHide }) {
|
|
|
3652
3633
|
setHoverInfo(null);
|
|
3653
3634
|
const rawSource = detectSourceFile(elementUnder);
|
|
3654
3635
|
if (rawSource?.includes("/chunks/")) {
|
|
3655
|
-
if (window.__IMPAKERS_DEBUG_LOG) {
|
|
3656
|
-
console.log("[impakers-debug] async resolve start:", rawSource);
|
|
3657
|
-
}
|
|
3658
3636
|
resolveSourceString(rawSource).then((resolved) => {
|
|
3659
|
-
if (window.__IMPAKERS_DEBUG_LOG) {
|
|
3660
|
-
console.log("[impakers-debug] async resolve result:", resolved);
|
|
3661
|
-
}
|
|
3662
3637
|
if (resolved) {
|
|
3663
3638
|
setPendingAnnotation(
|
|
3664
3639
|
(prev) => prev ? {
|
|
@@ -3668,10 +3643,7 @@ function DebugWidget({ endpoint, getUser, onHide }) {
|
|
|
3668
3643
|
} : prev
|
|
3669
3644
|
);
|
|
3670
3645
|
}
|
|
3671
|
-
}).catch((
|
|
3672
|
-
if (window.__IMPAKERS_DEBUG_LOG) {
|
|
3673
|
-
console.log("[impakers-debug] async resolve error:", err);
|
|
3674
|
-
}
|
|
3646
|
+
}).catch(() => {
|
|
3675
3647
|
});
|
|
3676
3648
|
}
|
|
3677
3649
|
};
|