bippy 0.2.11 → 0.2.12
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-4DXMRM7J.cjs → chunk-AREN6L74.cjs} +7 -28
- package/dist/chunk-EQDYOXOH.js +13 -0
- package/dist/{chunk-HRNPTAGF.js → chunk-Q5GNWPUS.js} +7 -26
- package/dist/chunk-WAO3TF75.cjs +15 -0
- package/dist/core-DkN3hFCY.d.cts +261 -0
- package/dist/core-DkN3hFCY.d.ts +261 -0
- package/dist/core.cjs +57 -57
- package/dist/core.d.cts +3 -195
- package/dist/core.d.ts +3 -195
- package/dist/core.js +1 -1
- package/dist/index.cjs +74 -74
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.global.js +9 -0
- package/dist/index.js +2 -2
- package/dist/inspect.cjs +55 -55
- package/dist/inspect.js +2 -2
- package/dist/sw.cjs +43 -26
- package/dist/sw.js +43 -26
- package/package.json +8 -2
- package/dist/chunk-6TJRMCM3.js +0 -1
- package/dist/chunk-YZYCWAB2.cjs +0 -2
- package/dist/sw.d.cts +0 -70
- package/dist/sw.d.ts +0 -70
- package/dist/sw.global.js +0 -9
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
4
3
|
/**
|
|
5
4
|
* @license bippy
|
|
6
5
|
*
|
|
@@ -11,7 +10,7 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
|
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
// src/rdt-hook.ts
|
|
14
|
-
var version = "0.2.
|
|
13
|
+
var version = "0.2.12";
|
|
15
14
|
var BIPPY_INSTRUMENTATION_STRING = `bippy-${version}`;
|
|
16
15
|
var NO_OP = () => {
|
|
17
16
|
};
|
|
@@ -98,36 +97,17 @@ var getRDTHook = (onActive) => {
|
|
|
98
97
|
patchRDTHook(onActive);
|
|
99
98
|
return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
100
99
|
};
|
|
101
|
-
var
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
let path = url;
|
|
106
|
-
if (!path) {
|
|
107
|
-
path = "./sw.js";
|
|
108
|
-
if ((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-4DXMRM7J.cjs', document.baseURI).href)).includes(".vite/deps")) {
|
|
109
|
-
path = "../../bippy/dist/sw.js";
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
const url2 = new URL(path, (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-4DXMRM7J.cjs', document.baseURI).href)));
|
|
114
|
-
const res = await fetch(url2, { method: "HEAD" });
|
|
115
|
-
if (res.ok) {
|
|
116
|
-
await navigator.serviceWorker.register(url2, {
|
|
117
|
-
// scope: '/',
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
} catch {
|
|
121
|
-
}
|
|
100
|
+
var isClientEnvironment = () => {
|
|
101
|
+
return Boolean(
|
|
102
|
+
typeof window !== "undefined" && (window.document?.createElement || window.navigator?.product === "ReactNative")
|
|
103
|
+
);
|
|
122
104
|
};
|
|
123
105
|
try {
|
|
124
|
-
if (
|
|
125
|
-
(window.document?.createElement || window.navigator?.product === "ReactNative")) {
|
|
106
|
+
if (isClientEnvironment()) {
|
|
126
107
|
installRDTHook();
|
|
127
108
|
}
|
|
128
109
|
} catch {
|
|
129
110
|
}
|
|
130
|
-
var INSTALL_HOOK_SCRIPT_STRING = "(()=>{try{var t=()=>{};const n=new Map;let o=0;globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__={checkDCE:t,supportsFiber:!0,supportsFlight:!0,hasUnsupportedRendererAttached:!1,renderers:n,onCommitFiberRoot:t,onCommitFiberUnmount:t,onPostCommitFiberRoot:t,inject(t){var e=++o;return n.set(e,t),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__._instrumentationIsActive=!0,e},_instrumentationIsActive:!1}}catch{}})()";
|
|
131
111
|
|
|
132
112
|
// src/core.ts
|
|
133
113
|
var FunctionComponentTag = 0;
|
|
@@ -748,7 +728,6 @@ exports.HostHoistableTag = HostHoistableTag;
|
|
|
748
728
|
exports.HostRootTag = HostRootTag;
|
|
749
729
|
exports.HostSingletonTag = HostSingletonTag;
|
|
750
730
|
exports.HostTextTag = HostTextTag;
|
|
751
|
-
exports.INSTALL_HOOK_SCRIPT_STRING = INSTALL_HOOK_SCRIPT_STRING;
|
|
752
731
|
exports.LegacyHiddenComponentTag = LegacyHiddenComponentTag;
|
|
753
732
|
exports.MemoComponentTag = MemoComponentTag;
|
|
754
733
|
exports.OffscreenComponentTag = OffscreenComponentTag;
|
|
@@ -774,6 +753,7 @@ exports.hasMemoCache = hasMemoCache;
|
|
|
774
753
|
exports.hasRDTHook = hasRDTHook;
|
|
775
754
|
exports.installRDTHook = installRDTHook;
|
|
776
755
|
exports.instrument = instrument;
|
|
756
|
+
exports.isClientEnvironment = isClientEnvironment;
|
|
777
757
|
exports.isCompositeFiber = isCompositeFiber;
|
|
778
758
|
exports.isHostFiber = isHostFiber;
|
|
779
759
|
exports.isInstrumentationActive = isInstrumentationActive;
|
|
@@ -784,7 +764,6 @@ exports.isValidFiber = isValidFiber;
|
|
|
784
764
|
exports.mountFiberRecursively = mountFiberRecursively;
|
|
785
765
|
exports.onCommitFiberRoot = onCommitFiberRoot;
|
|
786
766
|
exports.patchRDTHook = patchRDTHook;
|
|
787
|
-
exports.registerServiceWorker = registerServiceWorker;
|
|
788
767
|
exports.secure = secure;
|
|
789
768
|
exports.setFiberId = setFiberId;
|
|
790
769
|
exports.shouldFilterFiber = shouldFilterFiber;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license bippy
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Aiden Bai, Million Software, Inc.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// src/install-hook-script-string.ts
|
|
11
|
+
var INSTALL_HOOK_SCRIPT_STRING = "(()=>{try{var t=()=>{};const n=new Map;let o=0;globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__={checkDCE:t,supportsFiber:!0,supportsFlight:!0,hasUnsupportedRendererAttached:!1,renderers:n,onCommitFiberRoot:t,onCommitFiberUnmount:t,onPostCommitFiberRoot:t,inject(t){var e=++o;return n.set(e,t),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__._instrumentationIsActive=!0,e},_instrumentationIsActive:!1,_script:!0}}catch{}})()";
|
|
12
|
+
|
|
13
|
+
export { INSTALL_HOOK_SCRIPT_STRING };
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
// src/rdt-hook.ts
|
|
11
|
-
var version = "0.2.
|
|
11
|
+
var version = "0.2.12";
|
|
12
12
|
var BIPPY_INSTRUMENTATION_STRING = `bippy-${version}`;
|
|
13
13
|
var NO_OP = () => {
|
|
14
14
|
};
|
|
@@ -95,36 +95,17 @@ var getRDTHook = (onActive) => {
|
|
|
95
95
|
patchRDTHook(onActive);
|
|
96
96
|
return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
97
97
|
};
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
let path = url;
|
|
103
|
-
if (!path) {
|
|
104
|
-
path = "./sw.js";
|
|
105
|
-
if (import.meta.url.includes(".vite/deps")) {
|
|
106
|
-
path = "../../bippy/dist/sw.js";
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
try {
|
|
110
|
-
const url2 = new URL(path, import.meta.url);
|
|
111
|
-
const res = await fetch(url2, { method: "HEAD" });
|
|
112
|
-
if (res.ok) {
|
|
113
|
-
await navigator.serviceWorker.register(url2, {
|
|
114
|
-
// scope: '/',
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
} catch {
|
|
118
|
-
}
|
|
98
|
+
var isClientEnvironment = () => {
|
|
99
|
+
return Boolean(
|
|
100
|
+
typeof window !== "undefined" && (window.document?.createElement || window.navigator?.product === "ReactNative")
|
|
101
|
+
);
|
|
119
102
|
};
|
|
120
103
|
try {
|
|
121
|
-
if (
|
|
122
|
-
(window.document?.createElement || window.navigator?.product === "ReactNative")) {
|
|
104
|
+
if (isClientEnvironment()) {
|
|
123
105
|
installRDTHook();
|
|
124
106
|
}
|
|
125
107
|
} catch {
|
|
126
108
|
}
|
|
127
|
-
var INSTALL_HOOK_SCRIPT_STRING = "(()=>{try{var t=()=>{};const n=new Map;let o=0;globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__={checkDCE:t,supportsFiber:!0,supportsFlight:!0,hasUnsupportedRendererAttached:!1,renderers:n,onCommitFiberRoot:t,onCommitFiberUnmount:t,onPostCommitFiberRoot:t,inject(t){var e=++o;return n.set(e,t),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__._instrumentationIsActive=!0,e},_instrumentationIsActive:!1}}catch{}})()";
|
|
128
109
|
|
|
129
110
|
// src/core.ts
|
|
130
111
|
var FunctionComponentTag = 0;
|
|
@@ -729,4 +710,4 @@ var onCommitFiberRoot = (handler) => {
|
|
|
729
710
|
);
|
|
730
711
|
};
|
|
731
712
|
|
|
732
|
-
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,
|
|
713
|
+
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, LegacyHiddenComponentTag, MemoComponentTag, OffscreenComponentTag, SimpleMemoComponentTag, SuspenseComponentTag, TRANSITIONAL_ELEMENT_TYPE_SYMBOL_STRING, createFiberVisitor, detectReactBuildType, didFiberCommit, didFiberRender, fiberIdMap, getDisplayName, getFiberFromHostInstance, getFiberId, getFiberStack, getMutatedHostFibers, getNearestHostFiber, getNearestHostFibers, getRDTHook, getTimings, getType, hasMemoCache, hasRDTHook, installRDTHook, instrument, isClientEnvironment, isCompositeFiber, isHostFiber, isInstrumentationActive, isReactRefresh, isRealReactDevtools, isValidElement, isValidFiber, mountFiberRecursively, onCommitFiberRoot, patchRDTHook, secure, setFiberId, shouldFilterFiber, traverseContexts, traverseEffects, traverseFiber, traverseProps, traverseRenderedFibers, traverseState, unmountFiber, unmountFiberChildrenRecursively, updateFiberRecursively, version };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license bippy
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Aiden Bai, Million Software, Inc.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// src/install-hook-script-string.ts
|
|
13
|
+
var INSTALL_HOOK_SCRIPT_STRING = "(()=>{try{var t=()=>{};const n=new Map;let o=0;globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__={checkDCE:t,supportsFiber:!0,supportsFlight:!0,hasUnsupportedRendererAttached:!1,renderers:n,onCommitFiberRoot:t,onCommitFiberUnmount:t,onPostCommitFiberRoot:t,inject(t){var e=++o;return n.set(e,t),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__._instrumentationIsActive=!0,e},_instrumentationIsActive:!1,_script:!0}}catch{}})()";
|
|
14
|
+
|
|
15
|
+
exports.INSTALL_HOOK_SCRIPT_STRING = INSTALL_HOOK_SCRIPT_STRING;
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FiberRoot, Fiber as Fiber$1, ReactContext, Lanes } from 'react-reconciler';
|
|
3
|
+
|
|
4
|
+
interface ReactDevToolsGlobalHook {
|
|
5
|
+
checkDCE: (fn: unknown) => void;
|
|
6
|
+
supportsFiber: boolean;
|
|
7
|
+
supportsFlight: boolean;
|
|
8
|
+
renderers: Map<number, ReactRenderer>;
|
|
9
|
+
hasUnsupportedRendererAttached: boolean;
|
|
10
|
+
onCommitFiberRoot: (rendererID: number, root: FiberRoot, priority: void | number) => void;
|
|
11
|
+
onCommitFiberUnmount: (rendererID: number, fiber: Fiber) => void;
|
|
12
|
+
onPostCommitFiberRoot: (rendererID: number, root: FiberRoot) => void;
|
|
13
|
+
inject: (renderer: ReactRenderer) => number;
|
|
14
|
+
_instrumentationSource?: string;
|
|
15
|
+
_instrumentationIsActive?: boolean;
|
|
16
|
+
_sw?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Represents a react-internal Fiber node.
|
|
20
|
+
*/
|
|
21
|
+
type Fiber<T = any> = Omit<Fiber$1, 'stateNode' | 'dependencies' | 'child' | 'sibling' | 'return' | 'alternate' | 'memoizedProps' | 'pendingProps' | 'memoizedState' | 'updateQueue'> & {
|
|
22
|
+
stateNode: T;
|
|
23
|
+
dependencies: Dependencies | null;
|
|
24
|
+
child: Fiber | null;
|
|
25
|
+
sibling: Fiber | null;
|
|
26
|
+
return: Fiber | null;
|
|
27
|
+
alternate: Fiber | null;
|
|
28
|
+
memoizedProps: Props;
|
|
29
|
+
pendingProps: Props;
|
|
30
|
+
memoizedState: MemoizedState;
|
|
31
|
+
updateQueue: {
|
|
32
|
+
lastEffect: Effect | null;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
interface ReactRenderer {
|
|
37
|
+
version: string;
|
|
38
|
+
bundleType: 0 | 1;
|
|
39
|
+
findFiberByHostInstance?: (hostInstance: unknown) => Fiber | null;
|
|
40
|
+
}
|
|
41
|
+
interface ContextDependency<T> {
|
|
42
|
+
context: ReactContext<T>;
|
|
43
|
+
memoizedValue: T;
|
|
44
|
+
observedBits: number;
|
|
45
|
+
next: ContextDependency<unknown> | null;
|
|
46
|
+
}
|
|
47
|
+
interface Dependencies {
|
|
48
|
+
lanes: Lanes;
|
|
49
|
+
firstContext: ContextDependency<unknown> | null;
|
|
50
|
+
}
|
|
51
|
+
interface Effect {
|
|
52
|
+
next: Effect | null;
|
|
53
|
+
create: (...args: unknown[]) => unknown;
|
|
54
|
+
destroy: ((...args: unknown[]) => unknown) | null;
|
|
55
|
+
deps: unknown[] | null;
|
|
56
|
+
tag: number;
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
interface MemoizedState {
|
|
60
|
+
memoizedState: unknown;
|
|
61
|
+
next: MemoizedState | null;
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
}
|
|
64
|
+
interface Props {
|
|
65
|
+
[key: string]: unknown;
|
|
66
|
+
}
|
|
67
|
+
declare global {
|
|
68
|
+
var __REACT_DEVTOOLS_GLOBAL_HOOK__: ReactDevToolsGlobalHook;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare const FunctionComponentTag = 0;
|
|
72
|
+
declare const ClassComponentTag = 1;
|
|
73
|
+
declare const HostRootTag = 3;
|
|
74
|
+
declare const HostComponentTag = 5;
|
|
75
|
+
declare const HostTextTag = 6;
|
|
76
|
+
declare const FragmentTag = 7;
|
|
77
|
+
declare const ContextConsumerTag = 9;
|
|
78
|
+
declare const ForwardRefTag = 11;
|
|
79
|
+
declare const SuspenseComponentTag = 13;
|
|
80
|
+
declare const MemoComponentTag = 14;
|
|
81
|
+
declare const SimpleMemoComponentTag = 15;
|
|
82
|
+
declare const DehydratedSuspenseComponentTag = 18;
|
|
83
|
+
declare const OffscreenComponentTag = 22;
|
|
84
|
+
declare const LegacyHiddenComponentTag = 23;
|
|
85
|
+
declare const HostHoistableTag = 26;
|
|
86
|
+
declare const HostSingletonTag = 27;
|
|
87
|
+
declare const CONCURRENT_MODE_NUMBER = 60111;
|
|
88
|
+
declare const ELEMENT_TYPE_SYMBOL_STRING = "Symbol(react.element)";
|
|
89
|
+
declare const TRANSITIONAL_ELEMENT_TYPE_SYMBOL_STRING = "Symbol(react.transitional.element)";
|
|
90
|
+
declare const CONCURRENT_MODE_SYMBOL_STRING = "Symbol(react.concurrent_mode)";
|
|
91
|
+
declare const DEPRECATED_ASYNC_MODE_SYMBOL_STRING = "Symbol(react.async_mode)";
|
|
92
|
+
/**
|
|
93
|
+
* Returns `true` if object is a React Element.
|
|
94
|
+
*
|
|
95
|
+
* @see https://react.dev/reference/react/isValidElement
|
|
96
|
+
*/
|
|
97
|
+
declare const isValidElement: (element: unknown) => element is React.ReactElement;
|
|
98
|
+
/**
|
|
99
|
+
* Returns `true` if object is a React Fiber.
|
|
100
|
+
*/
|
|
101
|
+
declare const isValidFiber: (fiber: unknown) => fiber is Fiber;
|
|
102
|
+
/**
|
|
103
|
+
* Returns `true` if fiber is a host fiber. Host fibers are DOM nodes in react-dom, `View` in react-native, etc.
|
|
104
|
+
*
|
|
105
|
+
* @see https://reactnative.dev/architecture/glossary#host-view-tree-and-host-view
|
|
106
|
+
*/
|
|
107
|
+
declare const isHostFiber: (fiber: Fiber) => boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Returns `true` if fiber is a composite fiber. Composite fibers are fibers that can render (like functional components, class components, etc.)
|
|
110
|
+
*
|
|
111
|
+
* @see https://reactnative.dev/architecture/glossary#react-composite-components
|
|
112
|
+
*/
|
|
113
|
+
declare const isCompositeFiber: (fiber: Fiber) => boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Traverses up or down a {@link Fiber}'s contexts, return `true` to stop and select the current and previous context value.
|
|
116
|
+
*/
|
|
117
|
+
declare const traverseContexts: (fiber: Fiber, selector: (nextValue: ContextDependency<unknown> | null | undefined, prevValue: ContextDependency<unknown> | null | undefined) => boolean | void) => boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Traverses up or down a {@link Fiber}'s states, return `true` to stop and select the current and previous state value.
|
|
120
|
+
*/
|
|
121
|
+
declare const traverseState: (fiber: Fiber, selector: (nextValue: MemoizedState | null | undefined, prevValue: MemoizedState | null | undefined) => boolean | void) => boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Traverses up or down a {@link Fiber}'s effects that cause state changes, return `true` to stop and select the current and previous effect value.
|
|
124
|
+
*/
|
|
125
|
+
declare const traverseEffects: (fiber: Fiber, selector: (nextValue: Effect | null | undefined, prevValue: Effect | null | undefined) => boolean | void) => boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Traverses up or down a {@link Fiber}'s props, return `true` to stop and select the current and previous props value.
|
|
128
|
+
*/
|
|
129
|
+
declare const traverseProps: (fiber: Fiber, selector: (propName: string, nextValue: unknown, prevValue: unknown) => boolean | void) => boolean;
|
|
130
|
+
/**
|
|
131
|
+
* 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.
|
|
132
|
+
*/
|
|
133
|
+
declare const didFiberRender: (fiber: Fiber) => boolean;
|
|
134
|
+
/**
|
|
135
|
+
* 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.
|
|
136
|
+
*/
|
|
137
|
+
declare const didFiberCommit: (fiber: Fiber) => boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Returns all host {@link Fiber}s that have committed and rendered.
|
|
140
|
+
*/
|
|
141
|
+
declare const getMutatedHostFibers: (fiber: Fiber) => Fiber[];
|
|
142
|
+
/**
|
|
143
|
+
* Returns the stack of {@link Fiber}s from the current fiber to the root fiber.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* [fiber, fiber.return, fiber.return.return, ...]
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
declare const getFiberStack: (fiber: Fiber) => Fiber[];
|
|
151
|
+
/**
|
|
152
|
+
* Returns `true` if the {@link Fiber} should be filtered out during reconciliation.
|
|
153
|
+
*/
|
|
154
|
+
declare const shouldFilterFiber: (fiber: Fiber) => boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Returns the nearest host {@link Fiber} to the current {@link Fiber}.
|
|
157
|
+
*/
|
|
158
|
+
declare const getNearestHostFiber: (fiber: Fiber, ascending?: boolean) => Fiber | null;
|
|
159
|
+
/**
|
|
160
|
+
* Returns all host {@link Fiber}s in the tree that are associated with the current {@link Fiber}.
|
|
161
|
+
*/
|
|
162
|
+
declare const getNearestHostFibers: (fiber: Fiber) => Fiber[];
|
|
163
|
+
/**
|
|
164
|
+
* Traverses up or down a {@link Fiber}, return `true` to stop and select a node.
|
|
165
|
+
*/
|
|
166
|
+
declare const traverseFiber: (fiber: Fiber | null, selector: (node: Fiber) => boolean | void, ascending?: boolean) => Fiber | null;
|
|
167
|
+
/**
|
|
168
|
+
* Returns the timings of the {@link Fiber}.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```ts
|
|
172
|
+
* const { selfTime, totalTime } = getTimings(fiber);
|
|
173
|
+
* console.log(selfTime, totalTime);
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
declare const getTimings: (fiber?: Fiber | null | undefined) => {
|
|
177
|
+
selfTime: number;
|
|
178
|
+
totalTime: number;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Returns `true` if the {@link Fiber} uses React Compiler's memo cache.
|
|
182
|
+
*/
|
|
183
|
+
declare const hasMemoCache: (fiber: Fiber) => boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Returns the type (e.g. component definition) of the {@link Fiber}
|
|
186
|
+
*/
|
|
187
|
+
declare const getType: (type: unknown) => React.ComponentType<unknown> | null;
|
|
188
|
+
/**
|
|
189
|
+
* Returns the display name of the {@link Fiber}.
|
|
190
|
+
*/
|
|
191
|
+
declare const getDisplayName: (type: unknown) => string | null;
|
|
192
|
+
/**
|
|
193
|
+
* Returns the build type of the React renderer.
|
|
194
|
+
*/
|
|
195
|
+
declare const detectReactBuildType: (renderer: ReactRenderer) => "development" | "production";
|
|
196
|
+
/**
|
|
197
|
+
* Returns `true` if bippy's instrumentation is active.
|
|
198
|
+
*/
|
|
199
|
+
declare const isInstrumentationActive: () => boolean;
|
|
200
|
+
type RenderPhase = 'mount' | 'update' | 'unmount';
|
|
201
|
+
type RenderHandler = <S>(fiber: Fiber, phase: RenderPhase, state?: S) => unknown;
|
|
202
|
+
declare const fiberIdMap: WeakMap<Fiber, number>;
|
|
203
|
+
declare const setFiberId: (fiber: Fiber, id?: number) => void;
|
|
204
|
+
declare const getFiberId: (fiber: Fiber) => number;
|
|
205
|
+
declare const mountFiberRecursively: (onRender: RenderHandler, firstChild: Fiber, traverseSiblings: boolean) => void;
|
|
206
|
+
declare const updateFiberRecursively: (onRender: RenderHandler, nextFiber: Fiber, prevFiber: Fiber, parentFiber: Fiber | null) => void;
|
|
207
|
+
declare const unmountFiber: (onRender: RenderHandler, fiber: Fiber) => void;
|
|
208
|
+
declare const unmountFiberChildrenRecursively: (onRender: RenderHandler, fiber: Fiber) => void;
|
|
209
|
+
/**
|
|
210
|
+
* Creates a fiber visitor function. Must pass a fiber root and a render handler.
|
|
211
|
+
* @example
|
|
212
|
+
* traverseRenderedFibers(root, (fiber, phase) => {
|
|
213
|
+
* console.log(phase)
|
|
214
|
+
* })
|
|
215
|
+
*/
|
|
216
|
+
declare const traverseRenderedFibers: (root: FiberRoot, onRender: RenderHandler) => void;
|
|
217
|
+
/**
|
|
218
|
+
* @deprecated use `traverseRenderedFibers` instead
|
|
219
|
+
*/
|
|
220
|
+
declare const createFiberVisitor: ({ onRender, }: {
|
|
221
|
+
onRender: RenderHandler;
|
|
222
|
+
onError: (error: unknown) => unknown;
|
|
223
|
+
}) => (<S>(_rendererID: number, root: FiberRoot | Fiber, _state?: S) => void);
|
|
224
|
+
interface InstrumentationOptions {
|
|
225
|
+
onCommitFiberRoot?: (rendererID: number, root: FiberRoot, priority: void | number) => unknown;
|
|
226
|
+
onCommitFiberUnmount?: (rendererID: number, fiber: Fiber) => unknown;
|
|
227
|
+
onPostCommitFiberRoot?: (rendererID: number, root: FiberRoot) => unknown;
|
|
228
|
+
onActive?: () => unknown;
|
|
229
|
+
name?: string;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Instruments the DevTools hook.
|
|
233
|
+
* @example
|
|
234
|
+
* const hook = instrument({
|
|
235
|
+
* onActive() {
|
|
236
|
+
* console.log('initialized');
|
|
237
|
+
* },
|
|
238
|
+
* onCommitFiberRoot(rendererID, root) {
|
|
239
|
+
* console.log('fiberRoot', root.current)
|
|
240
|
+
* },
|
|
241
|
+
* });
|
|
242
|
+
*/
|
|
243
|
+
declare const instrument: (options: InstrumentationOptions) => ReactDevToolsGlobalHook;
|
|
244
|
+
declare const getFiberFromHostInstance: <T>(hostInstance: T) => Fiber | null;
|
|
245
|
+
declare const secure: (options: InstrumentationOptions, secureOptions?: {
|
|
246
|
+
minReactMajorVersion?: number;
|
|
247
|
+
dangerouslyRunInProduction?: boolean;
|
|
248
|
+
onError?: (error?: unknown) => unknown;
|
|
249
|
+
installCheckTimeout?: number;
|
|
250
|
+
}) => InstrumentationOptions;
|
|
251
|
+
/**
|
|
252
|
+
* a wrapper around the {@link instrument} function that sets the `onCommitFiberRoot` hook.
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* onCommitFiberRoot((root) => {
|
|
256
|
+
* console.log(root.current);
|
|
257
|
+
* });
|
|
258
|
+
*/
|
|
259
|
+
declare const onCommitFiberRoot: (handler: (root: FiberRoot) => void) => ReactDevToolsGlobalHook;
|
|
260
|
+
|
|
261
|
+
export { traverseRenderedFibers as $, traverseFiber as A, getTimings as B, ClassComponentTag as C, DehydratedSuspenseComponentTag as D, ELEMENT_TYPE_SYMBOL_STRING as E, FunctionComponentTag as F, hasMemoCache as G, HostRootTag as H, getType as I, getDisplayName as J, detectReactBuildType as K, LegacyHiddenComponentTag as L, MemoComponentTag as M, isInstrumentationActive as N, OffscreenComponentTag as O, type RenderPhase as P, type RenderHandler as Q, type ReactDevToolsGlobalHook as R, SuspenseComponentTag as S, TRANSITIONAL_ELEMENT_TYPE_SYMBOL_STRING as T, fiberIdMap as U, setFiberId as V, getFiberId as W, mountFiberRecursively as X, updateFiberRecursively as Y, unmountFiber as Z, unmountFiberChildrenRecursively as _, HostComponentTag as a, createFiberVisitor as a0, type InstrumentationOptions as a1, instrument as a2, getFiberFromHostInstance as a3, secure as a4, onCommitFiberRoot as a5, type Fiber as a6, type ReactRenderer as a7, type ContextDependency as a8, type Dependencies as a9, type Effect as aa, type MemoizedState as ab, type Props as ac, HostTextTag as b, FragmentTag as c, ContextConsumerTag as d, ForwardRefTag as e, SimpleMemoComponentTag as f, HostHoistableTag as g, HostSingletonTag as h, CONCURRENT_MODE_NUMBER as i, CONCURRENT_MODE_SYMBOL_STRING as j, DEPRECATED_ASYNC_MODE_SYMBOL_STRING as k, isValidElement as l, isValidFiber as m, isHostFiber as n, isCompositeFiber as o, traverseState as p, traverseEffects as q, traverseProps as r, didFiberRender as s, traverseContexts as t, didFiberCommit as u, getMutatedHostFibers as v, getFiberStack as w, shouldFilterFiber as x, getNearestHostFiber as y, getNearestHostFibers as z };
|