bippy 0.3.23 → 0.3.24
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/experiments/inspect.cjs +8 -9
- package/dist/experiments/inspect.js +3 -4
- package/dist/index.cjs +63 -64
- package/dist/index.d.cts +228 -2
- package/dist/index.d.ts +228 -2
- package/dist/index.iife.js +1 -1
- package/dist/index.js +2 -3
- package/dist/override.cjs +1 -1
- package/dist/override.d.cts +1 -1
- package/dist/override.d.ts +1 -1
- package/dist/override.js +1 -1
- package/dist/{rdt-hook-B0BphmA3.cjs → rdt-hook-CNm8ztq8.cjs} +1 -1
- package/dist/{rdt-hook-Bv59JaNC.js → rdt-hook-DnHW09Oh.js} +2 -2
- package/dist/{source-CgGjiK9R.cjs → source-CSdAtQJ_.cjs} +59 -36
- package/dist/{source-DjV3BlJf.js → source-LNQQC0ZJ.js} +50 -33
- package/dist/source.cjs +4 -4
- package/dist/source.d.cts +3 -2
- package/dist/source.d.ts +3 -2
- package/dist/source.js +4 -5
- package/dist/{core-CX7djQ8N.js → src-DI6VWyXb.js} +5 -1
- package/dist/{core-BgmbcjsU.cjs → src-E_gwlk2_.cjs} +5 -1
- package/dist/{types-jg1j8UIH.d.ts → types-BQYK1_91.d.ts} +7 -0
- package/dist/{types-BeaKz93t.d.cts → types-K8pdIVoh.d.cts} +7 -0
- package/package.json +1 -1
- package/dist/core-D6Ses_Mt.d.cts +0 -229
- package/dist/core-Dd81Cnyx.d.ts +0 -229
- package/dist/core.cjs +0 -83
- package/dist/core.d.cts +0 -3
- package/dist/core.d.ts +0 -3
- package/dist/core.js +0 -12
- package/dist/src-BWXuzTOs.cjs +0 -14
- package/dist/src-ZIuzgdw5.js +0 -14
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import { _renderers
|
|
10
|
-
import { ClassComponentTag, getDisplayName, getType, isCompositeFiber, isHostFiber, traverseFiber } from "./
|
|
9
|
+
import { _renderers, getRDTHook } from "./rdt-hook-DnHW09Oh.js";
|
|
10
|
+
import { ClassComponentTag, getDisplayName, getType, isCompositeFiber, isHostFiber, traverseFiber } from "./src-DI6VWyXb.js";
|
|
11
11
|
|
|
12
12
|
//#region rolldown:runtime
|
|
13
13
|
var __create = Object.create;
|
|
@@ -2277,24 +2277,22 @@ const parseStackFrame = async (frame) => {
|
|
|
2277
2277
|
if (!source.length) return null;
|
|
2278
2278
|
const { file: fileName, line: lineNumber, col: columnNumber = 0 } = source[0];
|
|
2279
2279
|
if (!fileName || !lineNumber) return null;
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
};
|
|
2295
|
-
}
|
|
2280
|
+
const response = await fetch(fileName);
|
|
2281
|
+
if (response.ok) {
|
|
2282
|
+
const content = await response.text();
|
|
2283
|
+
const sourcemap = await getSourceMap(fileName, content);
|
|
2284
|
+
if (sourcemap) {
|
|
2285
|
+
const result = sourcemap.originalPositionFor({
|
|
2286
|
+
line: lineNumber,
|
|
2287
|
+
column: columnNumber
|
|
2288
|
+
});
|
|
2289
|
+
return {
|
|
2290
|
+
fileName: getRemovedFileProtocolPath(sourcemap.file || result.source),
|
|
2291
|
+
lineNumber: result.line,
|
|
2292
|
+
columnNumber: result.column
|
|
2293
|
+
};
|
|
2296
2294
|
}
|
|
2297
|
-
}
|
|
2295
|
+
}
|
|
2298
2296
|
return {
|
|
2299
2297
|
fileName: getRemovedFileProtocolPath(fileName),
|
|
2300
2298
|
lineNumber,
|
|
@@ -2404,17 +2402,33 @@ const getCurrentDispatcher = () => {
|
|
|
2404
2402
|
const rdtHook = getRDTHook();
|
|
2405
2403
|
for (const renderer of [...Array.from(_renderers), ...Array.from(rdtHook.renderers.values())]) {
|
|
2406
2404
|
const currentDispatcherRef = renderer.currentDispatcherRef;
|
|
2407
|
-
if (currentDispatcherRef) return currentDispatcherRef.H
|
|
2405
|
+
if (currentDispatcherRef && typeof currentDispatcherRef === "object") return "H" in currentDispatcherRef ? currentDispatcherRef.H : currentDispatcherRef.current;
|
|
2408
2406
|
}
|
|
2409
2407
|
return null;
|
|
2410
2408
|
};
|
|
2411
2409
|
const setCurrentDispatcher = (value) => {
|
|
2412
2410
|
for (const renderer of _renderers) {
|
|
2413
2411
|
const currentDispatcherRef = renderer.currentDispatcherRef;
|
|
2414
|
-
if (currentDispatcherRef) if ("H" in currentDispatcherRef) currentDispatcherRef.H = value;
|
|
2412
|
+
if (currentDispatcherRef && typeof currentDispatcherRef === "object") if ("H" in currentDispatcherRef) currentDispatcherRef.H = value;
|
|
2415
2413
|
else currentDispatcherRef.current = value;
|
|
2416
2414
|
}
|
|
2417
2415
|
};
|
|
2416
|
+
const formatOwnerStack = (error) => {
|
|
2417
|
+
const prevPrepareStackTrace = Error.prepareStackTrace;
|
|
2418
|
+
Error.prepareStackTrace = void 0;
|
|
2419
|
+
let stack = error.stack;
|
|
2420
|
+
if (!stack) return "";
|
|
2421
|
+
Error.prepareStackTrace = prevPrepareStackTrace;
|
|
2422
|
+
if (stack.startsWith("Error: react-stack-top-frame\n")) stack = stack.slice(29);
|
|
2423
|
+
let idx = stack.indexOf("\n");
|
|
2424
|
+
if (idx !== -1) stack = stack.slice(idx + 1);
|
|
2425
|
+
idx = stack.indexOf("react_stack_bottom_frame");
|
|
2426
|
+
if (idx === -1) idx = stack.indexOf("react-stack-bottom-frame");
|
|
2427
|
+
if (idx !== -1) idx = stack.lastIndexOf("\n", idx);
|
|
2428
|
+
if (idx !== -1) stack = stack.slice(0, idx);
|
|
2429
|
+
else return "";
|
|
2430
|
+
return stack;
|
|
2431
|
+
};
|
|
2418
2432
|
const getFiberSource = async (fiber) => {
|
|
2419
2433
|
const debugSource = fiber._debugSource;
|
|
2420
2434
|
if (debugSource) {
|
|
@@ -2425,24 +2439,27 @@ const getFiberSource = async (fiber) => {
|
|
|
2425
2439
|
columnNumber: "columnNumber" in debugSource && typeof debugSource.columnNumber === "number" ? debugSource.columnNumber : 0
|
|
2426
2440
|
};
|
|
2427
2441
|
}
|
|
2428
|
-
const
|
|
2429
|
-
if (typeof
|
|
2430
|
-
const
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
};
|
|
2442
|
+
const debugStack = fiber._debugStack;
|
|
2443
|
+
if (debugStack instanceof Error && typeof debugStack?.stack === "string") {
|
|
2444
|
+
const frame$1 = formatOwnerStack(debugStack);
|
|
2445
|
+
if (frame$1) try {
|
|
2446
|
+
const source = await parseStackFrame(frame$1);
|
|
2447
|
+
if (source) return source;
|
|
2448
|
+
} catch {}
|
|
2436
2449
|
}
|
|
2437
2450
|
const currentDispatcherRef = getCurrentDispatcher();
|
|
2438
2451
|
if (!currentDispatcherRef) return null;
|
|
2439
|
-
const componentFunction = isHostFiber(fiber) ? getType(traverseFiber(fiber, (
|
|
2440
|
-
if (isCompositeFiber(
|
|
2452
|
+
const componentFunction = isHostFiber(fiber) ? getType(traverseFiber(fiber, (innerFiber) => {
|
|
2453
|
+
if (isCompositeFiber(innerFiber)) return true;
|
|
2441
2454
|
}, true)?.type) : getType(fiber.type);
|
|
2442
2455
|
if (!componentFunction || reentry) return null;
|
|
2443
2456
|
const frame = describeNativeComponentFrame(componentFunction, fiber.tag === ClassComponentTag);
|
|
2444
|
-
|
|
2457
|
+
try {
|
|
2458
|
+
return await parseStackFrame(frame);
|
|
2459
|
+
} catch {
|
|
2460
|
+
return null;
|
|
2461
|
+
}
|
|
2445
2462
|
};
|
|
2446
2463
|
|
|
2447
2464
|
//#endregion
|
|
2448
|
-
export { getCurrentDispatcher, getFiberSource, setCurrentDispatcher };
|
|
2465
|
+
export { formatOwnerStack, getCurrentDispatcher, getFiberSource, setCurrentDispatcher };
|
package/dist/source.cjs
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
const require_source = require('./source-
|
|
10
|
-
require('./rdt-hook-
|
|
11
|
-
require('./
|
|
12
|
-
require('./src-BWXuzTOs.cjs');
|
|
9
|
+
const require_source = require('./source-CSdAtQJ_.cjs');
|
|
10
|
+
require('./rdt-hook-CNm8ztq8.cjs');
|
|
11
|
+
require('./src-E_gwlk2_.cjs');
|
|
13
12
|
|
|
13
|
+
exports.formatOwnerStack = require_source.formatOwnerStack;
|
|
14
14
|
exports.getCurrentDispatcher = require_source.getCurrentDispatcher;
|
|
15
15
|
exports.getFiberSource = require_source.getFiberSource;
|
|
16
16
|
exports.setCurrentDispatcher = require_source.setCurrentDispatcher;
|
package/dist/source.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fiber } from "./types-
|
|
1
|
+
import { Fiber } from "./types-K8pdIVoh.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/source.d.ts
|
|
4
4
|
interface FiberSource {
|
|
@@ -8,7 +8,8 @@ interface FiberSource {
|
|
|
8
8
|
}
|
|
9
9
|
declare const getCurrentDispatcher: () => React.RefObject<unknown> | null;
|
|
10
10
|
declare const setCurrentDispatcher: (value: React.RefObject<unknown> | null) => void;
|
|
11
|
+
declare const formatOwnerStack: (error: Error) => string;
|
|
11
12
|
declare const getFiberSource: (fiber: Fiber) => Promise<FiberSource | null>;
|
|
12
13
|
|
|
13
14
|
//#endregion
|
|
14
|
-
export { FiberSource, getCurrentDispatcher, getFiberSource, setCurrentDispatcher };
|
|
15
|
+
export { FiberSource, formatOwnerStack, getCurrentDispatcher, getFiberSource, setCurrentDispatcher };
|
package/dist/source.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fiber } from "./types-
|
|
1
|
+
import { Fiber } from "./types-BQYK1_91.js";
|
|
2
2
|
|
|
3
3
|
//#region src/source.d.ts
|
|
4
4
|
interface FiberSource {
|
|
@@ -8,7 +8,8 @@ interface FiberSource {
|
|
|
8
8
|
}
|
|
9
9
|
declare const getCurrentDispatcher: () => React.RefObject<unknown> | null;
|
|
10
10
|
declare const setCurrentDispatcher: (value: React.RefObject<unknown> | null) => void;
|
|
11
|
+
declare const formatOwnerStack: (error: Error) => string;
|
|
11
12
|
declare const getFiberSource: (fiber: Fiber) => Promise<FiberSource | null>;
|
|
12
13
|
|
|
13
14
|
//#endregion
|
|
14
|
-
export { FiberSource, getCurrentDispatcher, getFiberSource, setCurrentDispatcher };
|
|
15
|
+
export { FiberSource, formatOwnerStack, getCurrentDispatcher, getFiberSource, setCurrentDispatcher };
|
package/dist/source.js
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import { getCurrentDispatcher, getFiberSource, setCurrentDispatcher } from "./source-
|
|
10
|
-
import "./rdt-hook-
|
|
11
|
-
import "./
|
|
12
|
-
import "./src-ZIuzgdw5.js";
|
|
9
|
+
import { formatOwnerStack, getCurrentDispatcher, getFiberSource, setCurrentDispatcher } from "./source-LNQQC0ZJ.js";
|
|
10
|
+
import "./rdt-hook-DnHW09Oh.js";
|
|
11
|
+
import "./src-DI6VWyXb.js";
|
|
13
12
|
|
|
14
|
-
export { getCurrentDispatcher, getFiberSource, setCurrentDispatcher };
|
|
13
|
+
export { formatOwnerStack, getCurrentDispatcher, getFiberSource, setCurrentDispatcher };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import { BIPPY_INSTRUMENTATION_STRING
|
|
9
|
+
import { BIPPY_INSTRUMENTATION_STRING, getRDTHook, hasRDTHook, isReactRefresh, isRealReactDevtools, safelyInstallRDTHook } from "./rdt-hook-DnHW09Oh.js";
|
|
10
10
|
|
|
11
11
|
//#region src/core.ts
|
|
12
12
|
const FunctionComponentTag = 0;
|
|
@@ -604,5 +604,9 @@ const onCommitFiberRoot = (handler) => {
|
|
|
604
604
|
} }));
|
|
605
605
|
};
|
|
606
606
|
|
|
607
|
+
//#endregion
|
|
608
|
+
//#region src/index.ts
|
|
609
|
+
safelyInstallRDTHook();
|
|
610
|
+
|
|
607
611
|
//#endregion
|
|
608
612
|
export { CONCURRENT_MODE_NUMBER, CONCURRENT_MODE_SYMBOL_STRING, ClassComponentTag, ContextConsumerTag, DEPRECATED_ASYNC_MODE_SYMBOL_STRING, DehydratedSuspenseComponentTag, ELEMENT_TYPE_SYMBOL_STRING, ForwardRefTag, FragmentTag, FunctionComponentTag, HostComponentTag, HostHoistableTag, HostRootTag, HostSingletonTag, HostTextTag, INSTALL_ERROR, LegacyHiddenComponentTag, MemoComponentTag, OffscreenComponentTag, SimpleMemoComponentTag, SuspenseComponentTag, TRANSITIONAL_ELEMENT_TYPE_SYMBOL_STRING, _fiberRoots, areFiberEqual, createFiberVisitor, detectReactBuildType, didFiberCommit, didFiberRender, fiberIdMap, getDisplayName, getFiberFromHostInstance, getFiberId, getFiberStack, getLatestFiber, getMutatedHostFibers, getNearestHostFiber, getNearestHostFibers, getTimings, getType, hasMemoCache, instrument, isCompositeFiber, isHostFiber, isInstrumentationActive, isValidElement, isValidFiber, mountFiberRecursively, onCommitFiberRoot, secure, setFiberId, shouldFilterFiber, traverseContexts, traverseFiber, traverseFiberAsync, traverseFiberSync, traverseProps, traverseRenderedFibers, traverseState, unmountFiber, unmountFiberChildrenRecursively, updateFiberRecursively };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
const require_rdt_hook = require('./rdt-hook-
|
|
9
|
+
const require_rdt_hook = require('./rdt-hook-CNm8ztq8.cjs');
|
|
10
10
|
|
|
11
11
|
//#region src/core.ts
|
|
12
12
|
const FunctionComponentTag = 0;
|
|
@@ -604,6 +604,10 @@ const onCommitFiberRoot = (handler) => {
|
|
|
604
604
|
} }));
|
|
605
605
|
};
|
|
606
606
|
|
|
607
|
+
//#endregion
|
|
608
|
+
//#region src/index.ts
|
|
609
|
+
require_rdt_hook.safelyInstallRDTHook();
|
|
610
|
+
|
|
607
611
|
//#endregion
|
|
608
612
|
Object.defineProperty(exports, 'CONCURRENT_MODE_NUMBER', {
|
|
609
613
|
enumerable: true,
|
|
@@ -32,6 +32,13 @@ type Fiber$1<T = any> = Omit<Fiber, 'stateNode' | 'dependencies' | 'child' | 'si
|
|
|
32
32
|
lastEffect: Effect | null;
|
|
33
33
|
[key: string]: unknown;
|
|
34
34
|
};
|
|
35
|
+
_debugSource?: {
|
|
36
|
+
fileName: string;
|
|
37
|
+
lineNumber: number;
|
|
38
|
+
columnNumber?: number;
|
|
39
|
+
};
|
|
40
|
+
_debugStack?: Error;
|
|
41
|
+
_debugOwner?: Fiber$1;
|
|
35
42
|
};
|
|
36
43
|
interface Family {
|
|
37
44
|
current: unknown;
|
|
@@ -32,6 +32,13 @@ type Fiber$1<T = any> = Omit<Fiber, 'stateNode' | 'dependencies' | 'child' | 'si
|
|
|
32
32
|
lastEffect: Effect | null;
|
|
33
33
|
[key: string]: unknown;
|
|
34
34
|
};
|
|
35
|
+
_debugSource?: {
|
|
36
|
+
fileName: string;
|
|
37
|
+
lineNumber: number;
|
|
38
|
+
columnNumber?: number;
|
|
39
|
+
};
|
|
40
|
+
_debugStack?: Error;
|
|
41
|
+
_debugOwner?: Fiber$1;
|
|
35
42
|
};
|
|
36
43
|
interface Family {
|
|
37
44
|
current: unknown;
|
package/package.json
CHANGED
package/dist/core-D6Ses_Mt.d.cts
DELETED
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { ContextDependency, Fiber, FiberRoot, MemoizedState, ReactDevToolsGlobalHook, ReactRenderer } from "./types-BeaKz93t.cjs";
|
|
2
|
-
import * as React$1 from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/rdt-hook.d.ts
|
|
5
|
-
declare const version: string | undefined;
|
|
6
|
-
declare const BIPPY_INSTRUMENTATION_STRING: string;
|
|
7
|
-
declare const isRealReactDevtools: (rdtHook?: ReactDevToolsGlobalHook) => boolean;
|
|
8
|
-
declare const isReactRefresh: (rdtHook?: ReactDevToolsGlobalHook) => boolean;
|
|
9
|
-
declare const _renderers: Set<ReactRenderer>;
|
|
10
|
-
declare const installRDTHook: (onActive?: () => unknown) => ReactDevToolsGlobalHook;
|
|
11
|
-
declare const patchRDTHook: (onActive?: () => unknown) => void;
|
|
12
|
-
declare const hasRDTHook: () => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Returns the current React DevTools global hook.
|
|
15
|
-
*/
|
|
16
|
-
declare const getRDTHook: (onActive?: () => unknown) => ReactDevToolsGlobalHook;
|
|
17
|
-
declare const isClientEnvironment: () => boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Usually used purely for side effect
|
|
20
|
-
*/
|
|
21
|
-
declare const safelyInstallRDTHook: () => void;
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/core.d.ts
|
|
25
|
-
declare const FunctionComponentTag = 0;
|
|
26
|
-
declare const ClassComponentTag = 1;
|
|
27
|
-
declare const HostRootTag = 3;
|
|
28
|
-
declare const HostComponentTag = 5;
|
|
29
|
-
declare const HostTextTag = 6;
|
|
30
|
-
declare const FragmentTag = 7;
|
|
31
|
-
declare const ContextConsumerTag = 9;
|
|
32
|
-
declare const ForwardRefTag = 11;
|
|
33
|
-
declare const SuspenseComponentTag = 13;
|
|
34
|
-
declare const MemoComponentTag = 14;
|
|
35
|
-
declare const SimpleMemoComponentTag = 15;
|
|
36
|
-
declare const DehydratedSuspenseComponentTag = 18;
|
|
37
|
-
declare const OffscreenComponentTag = 22;
|
|
38
|
-
declare const LegacyHiddenComponentTag = 23;
|
|
39
|
-
declare const HostHoistableTag = 26;
|
|
40
|
-
declare const HostSingletonTag = 27;
|
|
41
|
-
declare const CONCURRENT_MODE_NUMBER = 60111;
|
|
42
|
-
declare const ELEMENT_TYPE_SYMBOL_STRING = "Symbol(react.element)";
|
|
43
|
-
declare const TRANSITIONAL_ELEMENT_TYPE_SYMBOL_STRING = "Symbol(react.transitional.element)";
|
|
44
|
-
declare const CONCURRENT_MODE_SYMBOL_STRING = "Symbol(react.concurrent_mode)";
|
|
45
|
-
declare const DEPRECATED_ASYNC_MODE_SYMBOL_STRING = "Symbol(react.async_mode)";
|
|
46
|
-
/**
|
|
47
|
-
* Returns `true` if object is a React Element.
|
|
48
|
-
*
|
|
49
|
-
* @see https://react.dev/reference/react/isValidElement
|
|
50
|
-
*/
|
|
51
|
-
declare const isValidElement: (element: unknown) => element is React$1.ReactElement;
|
|
52
|
-
/**
|
|
53
|
-
* Returns `true` if object is a React Fiber.
|
|
54
|
-
*/
|
|
55
|
-
declare const isValidFiber: (fiber: unknown) => fiber is Fiber;
|
|
56
|
-
/**
|
|
57
|
-
* Returns `true` if fiber is a host fiber. Host fibers are DOM nodes in react-dom, `View` in react-native, etc.
|
|
58
|
-
*
|
|
59
|
-
* @see https://reactnative.dev/architecture/glossary#host-view-tree-and-host-view
|
|
60
|
-
*/
|
|
61
|
-
declare const isHostFiber: (fiber: Fiber) => boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Returns `true` if fiber is a composite fiber. Composite fibers are fibers that can render (like functional components, class components, etc.)
|
|
64
|
-
*
|
|
65
|
-
* @see https://reactnative.dev/architecture/glossary#react-composite-components
|
|
66
|
-
*/
|
|
67
|
-
declare const isCompositeFiber: (fiber: Fiber) => boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Returns `true` if the two {@link Fiber}s are the same reference
|
|
70
|
-
*/
|
|
71
|
-
declare const areFiberEqual: (fiberA: Fiber, fiberB: Fiber) => boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Traverses up or down a {@link Fiber}'s contexts, return `true` to stop and select the current and previous context value.
|
|
74
|
-
*/
|
|
75
|
-
declare const traverseContexts: (fiber: Fiber, selector: (nextValue: ContextDependency<unknown> | null | undefined, prevValue: ContextDependency<unknown> | null | undefined) => boolean | void) => boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Traverses up or down a {@link Fiber}'s states, return `true` to stop and select the current and previous state value. This stores both state values and effects.
|
|
78
|
-
*/
|
|
79
|
-
declare const traverseState: (fiber: Fiber, selector: (nextValue: MemoizedState | null | undefined, prevValue: MemoizedState | null | undefined) => boolean | void) => boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Traverses up or down a {@link Fiber}'s props, return `true` to stop and select the current and previous props value.
|
|
82
|
-
*/
|
|
83
|
-
declare const traverseProps: (fiber: Fiber, selector: (propName: string, nextValue: unknown, prevValue: unknown) => boolean | void) => boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Returns `true` if the {@link Fiber} has rendered. Note that this does not mean the fiber has rendered in the current commit, just that it has rendered in the past.
|
|
86
|
-
*/
|
|
87
|
-
declare const didFiberRender: (fiber: Fiber) => boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Returns `true` if the {@link Fiber} has committed. Note that this does not mean the fiber has committed in the current commit, just that it has committed in the past.
|
|
90
|
-
*/
|
|
91
|
-
declare const didFiberCommit: (fiber: Fiber) => boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Returns all host {@link Fiber}s that have committed and rendered.
|
|
94
|
-
*/
|
|
95
|
-
declare const getMutatedHostFibers: (fiber: Fiber) => Fiber[];
|
|
96
|
-
/**
|
|
97
|
-
* Returns the stack of {@link Fiber}s from the current fiber to the root fiber.
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* ```ts
|
|
101
|
-
* [fiber, fiber.return, fiber.return.return, ...]
|
|
102
|
-
* ```
|
|
103
|
-
*/
|
|
104
|
-
declare const getFiberStack: (fiber: Fiber) => Fiber[];
|
|
105
|
-
/**
|
|
106
|
-
* Returns `true` if the {@link Fiber} should be filtered out during reconciliation.
|
|
107
|
-
*/
|
|
108
|
-
declare const shouldFilterFiber: (fiber: Fiber) => boolean;
|
|
109
|
-
/**
|
|
110
|
-
* Returns the nearest host {@link Fiber} to the current {@link Fiber}.
|
|
111
|
-
*/
|
|
112
|
-
declare const getNearestHostFiber: (fiber: Fiber, ascending?: boolean) => Fiber | null;
|
|
113
|
-
/**
|
|
114
|
-
* Returns all host {@link Fiber}s in the tree that are associated with the current {@link Fiber}.
|
|
115
|
-
*/
|
|
116
|
-
declare const getNearestHostFibers: (fiber: Fiber) => Fiber[];
|
|
117
|
-
/**
|
|
118
|
-
* Traverses up or down a {@link Fiber}, return `true` to stop and select a node.
|
|
119
|
-
*/
|
|
120
|
-
declare function traverseFiber(fiber: Fiber | null, selector: (node: Fiber) => boolean | void, ascending?: boolean): Fiber | null;
|
|
121
|
-
declare function traverseFiber(fiber: Fiber | null, selector: (node: Fiber) => Promise<boolean | void>, ascending?: boolean): Promise<Fiber | null>;
|
|
122
|
-
declare const traverseFiberSync: (fiber: Fiber | null, selector: (node: Fiber) => boolean | void, ascending?: boolean) => Fiber | null;
|
|
123
|
-
declare const traverseFiberAsync: (fiber: Fiber | null, selector: (node: Fiber) => Promise<boolean | void>, ascending?: boolean) => Promise<Fiber | null>;
|
|
124
|
-
/**
|
|
125
|
-
* Returns the timings of the {@link Fiber}.
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* ```ts
|
|
129
|
-
* const { selfTime, totalTime } = getTimings(fiber);
|
|
130
|
-
* console.log(selfTime, totalTime);
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
declare const getTimings: (fiber?: Fiber | null | undefined) => {
|
|
134
|
-
selfTime: number;
|
|
135
|
-
totalTime: number;
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* Returns `true` if the {@link Fiber} uses React Compiler's memo cache.
|
|
139
|
-
*/
|
|
140
|
-
declare const hasMemoCache: (fiber: Fiber) => boolean;
|
|
141
|
-
/**
|
|
142
|
-
* Returns the type (e.g. component definition) of the {@link Fiber}
|
|
143
|
-
*/
|
|
144
|
-
declare const getType: (type: unknown) => React$1.ComponentType<unknown> | null;
|
|
145
|
-
/**
|
|
146
|
-
* Returns the display name of the {@link Fiber} type.
|
|
147
|
-
*/
|
|
148
|
-
declare const getDisplayName: (type: unknown) => string | null;
|
|
149
|
-
/**
|
|
150
|
-
* Returns the build type of the React renderer.
|
|
151
|
-
*/
|
|
152
|
-
declare const detectReactBuildType: (renderer: ReactRenderer) => "development" | "production";
|
|
153
|
-
/**
|
|
154
|
-
* Returns `true` if bippy's instrumentation is active.
|
|
155
|
-
*/
|
|
156
|
-
declare const isInstrumentationActive: () => boolean;
|
|
157
|
-
/**
|
|
158
|
-
* Returns the latest fiber (since it may be double-buffered).
|
|
159
|
-
*/
|
|
160
|
-
declare const getLatestFiber: (fiber: Fiber) => Fiber;
|
|
161
|
-
type RenderPhase = 'mount' | 'update' | 'unmount';
|
|
162
|
-
type RenderHandler = <S>(fiber: Fiber, phase: RenderPhase, state?: S) => unknown;
|
|
163
|
-
declare const fiberIdMap: WeakMap<Fiber, number>;
|
|
164
|
-
declare const setFiberId: (fiber: Fiber, id?: number) => void;
|
|
165
|
-
declare const getFiberId: (fiber: Fiber) => number;
|
|
166
|
-
declare const mountFiberRecursively: (onRender: RenderHandler, firstChild: Fiber, traverseSiblings: boolean) => void;
|
|
167
|
-
declare const updateFiberRecursively: (onRender: RenderHandler, nextFiber: Fiber, prevFiber: Fiber, parentFiber: Fiber | null) => void;
|
|
168
|
-
declare const unmountFiber: (onRender: RenderHandler, fiber: Fiber) => void;
|
|
169
|
-
declare const unmountFiberChildrenRecursively: (onRender: RenderHandler, fiber: Fiber) => void;
|
|
170
|
-
/**
|
|
171
|
-
* Creates a fiber visitor function. Must pass a fiber root and a render handler.
|
|
172
|
-
* @example
|
|
173
|
-
* traverseRenderedFibers(root, (fiber, phase) => {
|
|
174
|
-
* console.log(phase)
|
|
175
|
-
* })
|
|
176
|
-
*/
|
|
177
|
-
declare const traverseRenderedFibers: (root: FiberRoot, onRender: RenderHandler) => void;
|
|
178
|
-
/**
|
|
179
|
-
* @deprecated use `traverseRenderedFibers` instead
|
|
180
|
-
*/
|
|
181
|
-
declare const createFiberVisitor: ({
|
|
182
|
-
onRender
|
|
183
|
-
}: {
|
|
184
|
-
onRender: RenderHandler;
|
|
185
|
-
onError: (error: unknown) => unknown;
|
|
186
|
-
}) => (<S>(_rendererID: number, root: FiberRoot | Fiber, _state?: S) => void);
|
|
187
|
-
interface InstrumentationOptions {
|
|
188
|
-
onCommitFiberRoot?: (rendererID: number, root: FiberRoot, priority: void | number) => unknown;
|
|
189
|
-
onCommitFiberUnmount?: (rendererID: number, fiber: Fiber) => unknown;
|
|
190
|
-
onPostCommitFiberRoot?: (rendererID: number, root: FiberRoot) => unknown;
|
|
191
|
-
onScheduleFiberRoot?: (rendererID: number, root: FiberRoot, children: React$1.ReactNode) => unknown;
|
|
192
|
-
onActive?: () => unknown;
|
|
193
|
-
name?: string;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Instruments the DevTools hook.
|
|
197
|
-
* @example
|
|
198
|
-
* const hook = instrument({
|
|
199
|
-
* onActive() {
|
|
200
|
-
* console.log('initialized');
|
|
201
|
-
* },
|
|
202
|
-
* onCommitFiberRoot(rendererID, root) {
|
|
203
|
-
* console.log('fiberRoot', root.current)
|
|
204
|
-
* },
|
|
205
|
-
* });
|
|
206
|
-
*/
|
|
207
|
-
declare const instrument: (options: InstrumentationOptions) => ReactDevToolsGlobalHook;
|
|
208
|
-
declare const getFiberFromHostInstance: <T>(hostInstance: T) => Fiber | null;
|
|
209
|
-
declare const INSTALL_ERROR: Error;
|
|
210
|
-
declare const _fiberRoots: Set<any>;
|
|
211
|
-
declare const secure: (options: InstrumentationOptions, secureOptions?: {
|
|
212
|
-
minReactMajorVersion?: number;
|
|
213
|
-
dangerouslyRunInProduction?: boolean;
|
|
214
|
-
onError?: (error?: unknown) => unknown;
|
|
215
|
-
installCheckTimeout?: number;
|
|
216
|
-
isProduction?: boolean;
|
|
217
|
-
}) => InstrumentationOptions;
|
|
218
|
-
/**
|
|
219
|
-
* a wrapper around the {@link instrument} function that sets the `onCommitFiberRoot` hook.
|
|
220
|
-
*
|
|
221
|
-
* @example
|
|
222
|
-
* onCommitFiberRoot((root) => {
|
|
223
|
-
* console.log(root.current);
|
|
224
|
-
* });
|
|
225
|
-
*/
|
|
226
|
-
declare const onCommitFiberRoot: (handler: (root: FiberRoot) => void) => ReactDevToolsGlobalHook;
|
|
227
|
-
|
|
228
|
-
//#endregion
|
|
229
|
-
export { BIPPY_INSTRUMENTATION_STRING, CONCURRENT_MODE_NUMBER, CONCURRENT_MODE_SYMBOL_STRING, ClassComponentTag, ContextConsumerTag, DEPRECATED_ASYNC_MODE_SYMBOL_STRING, DehydratedSuspenseComponentTag, ELEMENT_TYPE_SYMBOL_STRING, ForwardRefTag, FragmentTag, FunctionComponentTag, HostComponentTag, HostHoistableTag, HostRootTag, HostSingletonTag, HostTextTag, INSTALL_ERROR, InstrumentationOptions, LegacyHiddenComponentTag, MemoComponentTag, OffscreenComponentTag, RenderHandler, RenderPhase, SimpleMemoComponentTag, SuspenseComponentTag, TRANSITIONAL_ELEMENT_TYPE_SYMBOL_STRING, _fiberRoots, _renderers, areFiberEqual, createFiberVisitor, detectReactBuildType, didFiberCommit, didFiberRender, fiberIdMap, getDisplayName, getFiberFromHostInstance, getFiberId, getFiberStack, getLatestFiber, getMutatedHostFibers, getNearestHostFiber, getNearestHostFibers, getRDTHook, getTimings, getType, hasMemoCache, hasRDTHook, installRDTHook, instrument, isClientEnvironment, isCompositeFiber, isHostFiber, isInstrumentationActive, isReactRefresh, isRealReactDevtools, isValidElement, isValidFiber, mountFiberRecursively, onCommitFiberRoot, patchRDTHook, safelyInstallRDTHook, secure, setFiberId, shouldFilterFiber, traverseContexts, traverseFiber, traverseFiberAsync, traverseFiberSync, traverseProps, traverseRenderedFibers, traverseState, unmountFiber, unmountFiberChildrenRecursively, updateFiberRecursively, version };
|