bippy 0.3.9 → 0.3.10
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/{chunk-SKK6GXB7.js → chunk-B7AJTWUW.js} +56 -50
- package/dist/{chunk-VTSZL2N7.js → chunk-BUHBG5FJ.js} +1 -1
- package/dist/{chunk-2GLAKWER.js → chunk-GA5TCJWK.js} +1 -1
- package/dist/{chunk-2KDFRTOV.cjs → chunk-L7REJPUK.cjs} +2 -2
- package/dist/{chunk-HIA3K5FI.cjs → chunk-OXTRHN64.cjs} +1 -1
- package/dist/{chunk-BT7NXVMI.cjs → chunk-YKMFKTYB.cjs} +64 -58
- package/dist/core.cjs +70 -70
- package/dist/core.js +1 -1
- package/dist/experiments/inspect.cjs +10 -10
- package/dist/experiments/inspect.js +3 -3
- package/dist/index.cjs +71 -71
- package/dist/index.global.js +1 -1
- package/dist/index.js +2 -2
- package/dist/jsx-runtime.cjs +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/source.cjs +73 -73
- package/dist/source.global.js +2 -2
- package/dist/source.js +3 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRDTHook, isHostFiber, getType, traverseFiber, isCompositeFiber, ClassComponentTag, getDisplayName } from './chunk-
|
|
1
|
+
import { getRDTHook, isHostFiber, getType, traverseFiber, isCompositeFiber, ClassComponentTag, getDisplayName } from './chunk-GA5TCJWK.js';
|
|
2
2
|
import { __commonJS, __toESM } from './chunk-EPG3GO3H.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
@@ -2079,65 +2079,71 @@ var describeNativeComponentFrame = (fn, construct, currentDispatcherRef) => {
|
|
|
2079
2079
|
const previousDispatcher = currentDispatcherRef.current;
|
|
2080
2080
|
currentDispatcherRef.current = null;
|
|
2081
2081
|
const prevLogs = disableLogs();
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
};
|
|
2090
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
2091
|
-
set: () => {
|
|
2082
|
+
try {
|
|
2083
|
+
const RunInRootFrame = {
|
|
2084
|
+
DetermineComponentFrameRoot() {
|
|
2085
|
+
let control;
|
|
2086
|
+
try {
|
|
2087
|
+
if (construct) {
|
|
2088
|
+
const Fake = function() {
|
|
2092
2089
|
throw Error();
|
|
2090
|
+
};
|
|
2091
|
+
Object.defineProperty(Fake.prototype, "props", {
|
|
2092
|
+
// biome-ignore lint/complexity/useArrowFunction: OK
|
|
2093
|
+
set: function() {
|
|
2094
|
+
throw Error();
|
|
2095
|
+
}
|
|
2096
|
+
});
|
|
2097
|
+
if (typeof Reflect === "object" && Reflect.construct) {
|
|
2098
|
+
try {
|
|
2099
|
+
Reflect.construct(Fake, []);
|
|
2100
|
+
} catch (x) {
|
|
2101
|
+
control = x;
|
|
2102
|
+
}
|
|
2103
|
+
Reflect.construct(fn, [], Fake);
|
|
2104
|
+
} else {
|
|
2105
|
+
try {
|
|
2106
|
+
Fake.call();
|
|
2107
|
+
} catch (x) {
|
|
2108
|
+
control = x;
|
|
2109
|
+
}
|
|
2110
|
+
fn.call(Fake.prototype);
|
|
2093
2111
|
}
|
|
2094
|
-
});
|
|
2095
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
|
2096
|
-
try {
|
|
2097
|
-
Reflect.construct(Fake, []);
|
|
2098
|
-
} catch (x) {
|
|
2099
|
-
control = x;
|
|
2100
|
-
}
|
|
2101
|
-
Reflect.construct(fn, [], Fake);
|
|
2102
2112
|
} else {
|
|
2103
2113
|
try {
|
|
2104
|
-
|
|
2114
|
+
throw Error();
|
|
2105
2115
|
} catch (x) {
|
|
2106
2116
|
control = x;
|
|
2107
2117
|
}
|
|
2108
|
-
fn
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
} catch (x) {
|
|
2114
|
-
control = x;
|
|
2118
|
+
const maybePromise = fn();
|
|
2119
|
+
if (maybePromise && typeof maybePromise.catch === "function") {
|
|
2120
|
+
maybePromise.catch(() => {
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2115
2123
|
}
|
|
2116
|
-
|
|
2117
|
-
if (
|
|
2118
|
-
|
|
2119
|
-
});
|
|
2124
|
+
} catch (sample) {
|
|
2125
|
+
if (sample && control && typeof sample.stack === "string") {
|
|
2126
|
+
return [sample.stack, control.stack];
|
|
2120
2127
|
}
|
|
2121
2128
|
}
|
|
2122
|
-
|
|
2123
|
-
if (sample instanceof Error && control && control.stack && sample.stack) {
|
|
2124
|
-
return [sample.stack, control.stack];
|
|
2125
|
-
}
|
|
2129
|
+
return [null, null];
|
|
2126
2130
|
}
|
|
2127
|
-
|
|
2131
|
+
};
|
|
2132
|
+
RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
2133
|
+
const namePropDescriptor = Object.getOwnPropertyDescriptor(
|
|
2134
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
|
2135
|
+
"name"
|
|
2136
|
+
);
|
|
2137
|
+
if (namePropDescriptor?.configurable) {
|
|
2138
|
+
Object.defineProperty(
|
|
2139
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
|
2140
|
+
// Configurable properties can be updated even if its writable descriptor
|
|
2141
|
+
// is set to `false`.
|
|
2142
|
+
// $FlowFixMe[cannot-write]
|
|
2143
|
+
"name",
|
|
2144
|
+
{ value: "DetermineComponentFrameRoot" }
|
|
2145
|
+
);
|
|
2128
2146
|
}
|
|
2129
|
-
};
|
|
2130
|
-
RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
2131
|
-
const namePropDescriptor = Object.getOwnPropertyDescriptor(
|
|
2132
|
-
RunInRootFrame.DetermineComponentFrameRoot,
|
|
2133
|
-
"name"
|
|
2134
|
-
);
|
|
2135
|
-
if (namePropDescriptor?.configurable) {
|
|
2136
|
-
Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", {
|
|
2137
|
-
value: "DetermineComponentFrameRoot"
|
|
2138
|
-
});
|
|
2139
|
-
}
|
|
2140
|
-
try {
|
|
2141
2147
|
const [sampleStack, controlStack] = RunInRootFrame.DetermineComponentFrameRoot();
|
|
2142
2148
|
if (sampleStack && controlStack) {
|
|
2143
2149
|
const sampleLines = sampleStack.split("\n");
|
|
@@ -2181,7 +2187,7 @@ ${sampleLines[s].replace(" at new ", " at ")}`;
|
|
|
2181
2187
|
} finally {
|
|
2182
2188
|
reentry = false;
|
|
2183
2189
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
2184
|
-
currentDispatcherRef.
|
|
2190
|
+
currentDispatcherRef.H = previousDispatcher;
|
|
2185
2191
|
reenableLogs(prevLogs);
|
|
2186
2192
|
}
|
|
2187
2193
|
const name = fn ? getDisplayName(fn) : "";
|
|
@@ -2224,7 +2230,7 @@ var getFiberSource = async (fiber) => {
|
|
|
2224
2230
|
if (isCompositeFiber(f)) return true;
|
|
2225
2231
|
},
|
|
2226
2232
|
true
|
|
2227
|
-
)
|
|
2233
|
+
)?.type
|
|
2228
2234
|
) : getType(fiber.type);
|
|
2229
2235
|
if (!componentFunction || reentry) {
|
|
2230
2236
|
return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOXTRHN64_cjs = require('./chunk-OXTRHN64.cjs');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @license bippy
|
|
@@ -12,4 +12,4 @@ var chunkHIA3K5FI_cjs = require('./chunk-HIA3K5FI.cjs');
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
// src/index.ts
|
|
15
|
-
|
|
15
|
+
chunkOXTRHN64_cjs.safelyInstallRDTHook();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOXTRHN64_cjs = require('./chunk-OXTRHN64.cjs');
|
|
4
4
|
var chunkAQ674A4M_cjs = require('./chunk-AQ674A4M.cjs');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
|
|
@@ -2085,65 +2085,71 @@ var describeNativeComponentFrame = (fn, construct, currentDispatcherRef) => {
|
|
|
2085
2085
|
const previousDispatcher = currentDispatcherRef.current;
|
|
2086
2086
|
currentDispatcherRef.current = null;
|
|
2087
2087
|
const prevLogs = disableLogs();
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
};
|
|
2096
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
2097
|
-
set: () => {
|
|
2088
|
+
try {
|
|
2089
|
+
const RunInRootFrame = {
|
|
2090
|
+
DetermineComponentFrameRoot() {
|
|
2091
|
+
let control;
|
|
2092
|
+
try {
|
|
2093
|
+
if (construct) {
|
|
2094
|
+
const Fake = function() {
|
|
2098
2095
|
throw Error();
|
|
2096
|
+
};
|
|
2097
|
+
Object.defineProperty(Fake.prototype, "props", {
|
|
2098
|
+
// biome-ignore lint/complexity/useArrowFunction: OK
|
|
2099
|
+
set: function() {
|
|
2100
|
+
throw Error();
|
|
2101
|
+
}
|
|
2102
|
+
});
|
|
2103
|
+
if (typeof Reflect === "object" && Reflect.construct) {
|
|
2104
|
+
try {
|
|
2105
|
+
Reflect.construct(Fake, []);
|
|
2106
|
+
} catch (x) {
|
|
2107
|
+
control = x;
|
|
2108
|
+
}
|
|
2109
|
+
Reflect.construct(fn, [], Fake);
|
|
2110
|
+
} else {
|
|
2111
|
+
try {
|
|
2112
|
+
Fake.call();
|
|
2113
|
+
} catch (x) {
|
|
2114
|
+
control = x;
|
|
2115
|
+
}
|
|
2116
|
+
fn.call(Fake.prototype);
|
|
2099
2117
|
}
|
|
2100
|
-
});
|
|
2101
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
|
2102
|
-
try {
|
|
2103
|
-
Reflect.construct(Fake, []);
|
|
2104
|
-
} catch (x) {
|
|
2105
|
-
control = x;
|
|
2106
|
-
}
|
|
2107
|
-
Reflect.construct(fn, [], Fake);
|
|
2108
2118
|
} else {
|
|
2109
2119
|
try {
|
|
2110
|
-
|
|
2120
|
+
throw Error();
|
|
2111
2121
|
} catch (x) {
|
|
2112
2122
|
control = x;
|
|
2113
2123
|
}
|
|
2114
|
-
fn
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
} catch (x) {
|
|
2120
|
-
control = x;
|
|
2124
|
+
const maybePromise = fn();
|
|
2125
|
+
if (maybePromise && typeof maybePromise.catch === "function") {
|
|
2126
|
+
maybePromise.catch(() => {
|
|
2127
|
+
});
|
|
2128
|
+
}
|
|
2121
2129
|
}
|
|
2122
|
-
|
|
2123
|
-
if (
|
|
2124
|
-
|
|
2125
|
-
});
|
|
2130
|
+
} catch (sample) {
|
|
2131
|
+
if (sample && control && typeof sample.stack === "string") {
|
|
2132
|
+
return [sample.stack, control.stack];
|
|
2126
2133
|
}
|
|
2127
2134
|
}
|
|
2128
|
-
|
|
2129
|
-
if (sample instanceof Error && control && control.stack && sample.stack) {
|
|
2130
|
-
return [sample.stack, control.stack];
|
|
2131
|
-
}
|
|
2135
|
+
return [null, null];
|
|
2132
2136
|
}
|
|
2133
|
-
|
|
2137
|
+
};
|
|
2138
|
+
RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
2139
|
+
const namePropDescriptor = Object.getOwnPropertyDescriptor(
|
|
2140
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
|
2141
|
+
"name"
|
|
2142
|
+
);
|
|
2143
|
+
if (namePropDescriptor?.configurable) {
|
|
2144
|
+
Object.defineProperty(
|
|
2145
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
|
2146
|
+
// Configurable properties can be updated even if its writable descriptor
|
|
2147
|
+
// is set to `false`.
|
|
2148
|
+
// $FlowFixMe[cannot-write]
|
|
2149
|
+
"name",
|
|
2150
|
+
{ value: "DetermineComponentFrameRoot" }
|
|
2151
|
+
);
|
|
2134
2152
|
}
|
|
2135
|
-
};
|
|
2136
|
-
RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
2137
|
-
const namePropDescriptor = Object.getOwnPropertyDescriptor(
|
|
2138
|
-
RunInRootFrame.DetermineComponentFrameRoot,
|
|
2139
|
-
"name"
|
|
2140
|
-
);
|
|
2141
|
-
if (namePropDescriptor?.configurable) {
|
|
2142
|
-
Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", {
|
|
2143
|
-
value: "DetermineComponentFrameRoot"
|
|
2144
|
-
});
|
|
2145
|
-
}
|
|
2146
|
-
try {
|
|
2147
2153
|
const [sampleStack, controlStack] = RunInRootFrame.DetermineComponentFrameRoot();
|
|
2148
2154
|
if (sampleStack && controlStack) {
|
|
2149
2155
|
const sampleLines = sampleStack.split("\n");
|
|
@@ -2172,7 +2178,7 @@ var describeNativeComponentFrame = (fn, construct, currentDispatcherRef) => {
|
|
|
2172
2178
|
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
2173
2179
|
let frame = `
|
|
2174
2180
|
${sampleLines[s].replace(" at new ", " at ")}`;
|
|
2175
|
-
const displayName =
|
|
2181
|
+
const displayName = chunkOXTRHN64_cjs.getDisplayName(fn);
|
|
2176
2182
|
if (displayName && frame.includes("<anonymous>")) {
|
|
2177
2183
|
frame = frame.replace("<anonymous>", displayName);
|
|
2178
2184
|
}
|
|
@@ -2187,10 +2193,10 @@ ${sampleLines[s].replace(" at new ", " at ")}`;
|
|
|
2187
2193
|
} finally {
|
|
2188
2194
|
reentry = false;
|
|
2189
2195
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
2190
|
-
currentDispatcherRef.
|
|
2196
|
+
currentDispatcherRef.H = previousDispatcher;
|
|
2191
2197
|
reenableLogs(prevLogs);
|
|
2192
2198
|
}
|
|
2193
|
-
const name = fn ?
|
|
2199
|
+
const name = fn ? chunkOXTRHN64_cjs.getDisplayName(fn) : "";
|
|
2194
2200
|
const syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
2195
2201
|
return syntheticFrame;
|
|
2196
2202
|
};
|
|
@@ -2212,7 +2218,7 @@ var getFiberSource = async (fiber) => {
|
|
|
2212
2218
|
if (fiber.memoizedProps?.__source) {
|
|
2213
2219
|
return fiber.memoizedProps.__source;
|
|
2214
2220
|
}
|
|
2215
|
-
const rdtHook =
|
|
2221
|
+
const rdtHook = chunkOXTRHN64_cjs.getRDTHook();
|
|
2216
2222
|
let currentDispatcherRef = ReactSharedInternals?.ReactCurrentDispatcher || ReactSharedInternals?.H;
|
|
2217
2223
|
for (const renderer of rdtHook.renderers.values()) {
|
|
2218
2224
|
currentDispatcherRef = renderer.currentDispatcherRef;
|
|
@@ -2223,21 +2229,21 @@ var getFiberSource = async (fiber) => {
|
|
|
2223
2229
|
if (!currentDispatcherRef) {
|
|
2224
2230
|
return null;
|
|
2225
2231
|
}
|
|
2226
|
-
const componentFunction =
|
|
2227
|
-
|
|
2232
|
+
const componentFunction = chunkOXTRHN64_cjs.isHostFiber(fiber) ? chunkOXTRHN64_cjs.getType(
|
|
2233
|
+
chunkOXTRHN64_cjs.traverseFiber(
|
|
2228
2234
|
fiber,
|
|
2229
2235
|
(f) => {
|
|
2230
|
-
if (
|
|
2236
|
+
if (chunkOXTRHN64_cjs.isCompositeFiber(f)) return true;
|
|
2231
2237
|
},
|
|
2232
2238
|
true
|
|
2233
|
-
)
|
|
2234
|
-
) :
|
|
2239
|
+
)?.type
|
|
2240
|
+
) : chunkOXTRHN64_cjs.getType(fiber.type);
|
|
2235
2241
|
if (!componentFunction || reentry) {
|
|
2236
2242
|
return null;
|
|
2237
2243
|
}
|
|
2238
2244
|
const frame = describeNativeComponentFrame(
|
|
2239
2245
|
componentFunction,
|
|
2240
|
-
fiber.tag ===
|
|
2246
|
+
fiber.tag === chunkOXTRHN64_cjs.ClassComponentTag,
|
|
2241
2247
|
ReactSharedInternals
|
|
2242
2248
|
);
|
|
2243
2249
|
return parseStackFrame(frame);
|