@capybara-devtools/core 0.5.0 → 0.5.1
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/client.d.ts.map +1 -1
- package/dist/client.js +20 -2
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +40 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +35 -0
- package/dist/init.js.map +1 -0
- package/dist/plugins/console.d.ts.map +1 -1
- package/dist/plugins/console.js +105 -9
- package/dist/plugins/console.js.map +1 -1
- package/dist/plugins/network/body.d.ts +9 -0
- package/dist/plugins/network/body.d.ts.map +1 -0
- package/dist/plugins/network/body.js +114 -0
- package/dist/plugins/network/body.js.map +1 -0
- package/dist/plugins/network/failure.d.ts +16 -0
- package/dist/plugins/network/failure.d.ts.map +1 -0
- package/dist/plugins/network/failure.js +73 -0
- package/dist/plugins/network/failure.js.map +1 -0
- package/dist/plugins/network/fetch.d.ts +12 -0
- package/dist/plugins/network/fetch.d.ts.map +1 -0
- package/dist/plugins/network/fetch.js +159 -0
- package/dist/plugins/network/fetch.js.map +1 -0
- package/dist/plugins/network/settings.d.ts +24 -0
- package/dist/plugins/network/settings.d.ts.map +1 -0
- package/dist/plugins/network/settings.js +26 -0
- package/dist/plugins/network/settings.js.map +1 -0
- package/dist/plugins/network/xhr.d.ts +4 -0
- package/dist/plugins/network/xhr.d.ts.map +1 -0
- package/dist/plugins/network/xhr.js +214 -0
- package/dist/plugins/network/xhr.js.map +1 -0
- package/dist/plugins/network.d.ts +2 -15
- package/dist/plugins/network.d.ts.map +1 -1
- package/dist/plugins/network.js +5 -518
- package/dist/plugins/network.js.map +1 -1
- package/dist/plugins/state/context-names.d.ts +13 -0
- package/dist/plugins/state/context-names.d.ts.map +1 -0
- package/dist/plugins/state/context-names.js +280 -0
- package/dist/plugins/state/context-names.js.map +1 -0
- package/dist/plugins/state/context.d.ts +0 -89
- package/dist/plugins/state/context.d.ts.map +1 -1
- package/dist/plugins/state/context.js +3 -474
- package/dist/plugins/state/context.js.map +1 -1
- package/dist/plugins/state/engine.d.ts +5 -0
- package/dist/plugins/state/engine.d.ts.map +1 -1
- package/dist/plugins/state/engine.js +12 -2
- package/dist/plugins/state/engine.js.map +1 -1
- package/dist/plugins/state/fibers.d.ts +75 -0
- package/dist/plugins/state/fibers.d.ts.map +1 -0
- package/dist/plugins/state/fibers.js +92 -0
- package/dist/plugins/state/fibers.js.map +1 -0
- package/dist/plugins/state/index.d.ts +5 -0
- package/dist/plugins/state/index.d.ts.map +1 -1
- package/dist/plugins/state/index.js.map +1 -1
- package/dist/plugins/state/mobx.d.ts +22 -0
- package/dist/plugins/state/mobx.d.ts.map +1 -0
- package/dist/plugins/state/mobx.js +69 -0
- package/dist/plugins/state/mobx.js.map +1 -0
- package/dist/plugins/state/react-hook.d.ts +19 -0
- package/dist/plugins/state/react-hook.d.ts.map +1 -0
- package/dist/plugins/state/react-hook.js +100 -0
- package/dist/plugins/state/react-hook.js.map +1 -0
- package/dist/plugins/state/redux.d.ts +2 -0
- package/dist/plugins/state/redux.d.ts.map +1 -1
- package/dist/plugins/state/redux.js +2 -2
- package/dist/plugins/state/redux.js.map +1 -1
- package/dist/plugins/state/xstate.d.ts +26 -0
- package/dist/plugins/state/xstate.d.ts.map +1 -0
- package/dist/plugins/state/xstate.js +85 -0
- package/dist/plugins/state/xstate.js.map +1 -0
- package/dist/plugins/storage.d.ts +1 -1
- package/dist/plugins/storage.d.ts.map +1 -1
- package/dist/plugins/storage.js +5 -7
- package/dist/plugins/storage.js.map +1 -1
- package/dist/serialize.d.ts.map +1 -1
- package/dist/serialize.js +1 -0
- package/dist/serialize.js.map +1 -1
- package/package.json +7 -5
- package/src/client.ts +19 -2
- package/src/index.ts +8 -2
- package/src/init.ts +66 -0
- package/src/plugins/console.ts +103 -10
- package/src/plugins/network/body.ts +114 -0
- package/src/plugins/network/failure.ts +79 -0
- package/src/plugins/network/fetch.ts +169 -0
- package/src/plugins/network/settings.ts +48 -0
- package/src/plugins/network/xhr.ts +223 -0
- package/src/plugins/network.ts +8 -572
- package/src/plugins/state/context-names.ts +265 -0
- package/src/plugins/state/context.ts +3 -532
- package/src/plugins/state/engine.ts +12 -2
- package/src/plugins/state/fibers.ts +160 -0
- package/src/plugins/state/index.ts +2 -0
- package/src/plugins/state/mobx.ts +80 -0
- package/src/plugins/state/react-hook.ts +98 -0
- package/src/plugins/state/redux.ts +2 -2
- package/src/plugins/state/xstate.ts +94 -0
- package/src/plugins/storage.ts +13 -8
- package/src/serialize.ts +2 -1
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
const COMPONENT_TAGS = new Set([0, 1, 11, 14, 15]);
|
|
2
|
+
export function contextName(context) {
|
|
3
|
+
try {
|
|
4
|
+
const name = context.displayName;
|
|
5
|
+
return typeof name === 'string' && name !== '' ? name : undefined;
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The component that rendered the provider: its owner, which development builds keep, else the closest one above.
|
|
13
|
+
* `owned` keeps to the owner, for an element created outside any render (e.g. passed to `root.render()`) has none.
|
|
14
|
+
*/
|
|
15
|
+
export function ownerName(fiber, owned = false) {
|
|
16
|
+
try {
|
|
17
|
+
for (let owner = fiber._debugOwner, hops = 0; owner != null && hops < 20; hops++) {
|
|
18
|
+
// A Server Component owner is plain info with a name.
|
|
19
|
+
if (!('tag' in owner))
|
|
20
|
+
return typeof owner.name === 'string' && owner.name !== '' ? owner.name : undefined;
|
|
21
|
+
const name = componentName(owner);
|
|
22
|
+
if (name !== undefined)
|
|
23
|
+
return name;
|
|
24
|
+
owner = owner._debugOwner;
|
|
25
|
+
}
|
|
26
|
+
if (owned)
|
|
27
|
+
return undefined;
|
|
28
|
+
for (let node = fiber.return, hops = 0; node != null && hops < 50; node = node.return, hops++) {
|
|
29
|
+
if (!COMPONENT_TAGS.has(node.tag))
|
|
30
|
+
continue;
|
|
31
|
+
const name = componentName(node);
|
|
32
|
+
if (name !== undefined)
|
|
33
|
+
return name;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// a getter that threw: numbered instead
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
function componentName(fiber) {
|
|
42
|
+
if (!COMPONENT_TAGS.has(fiber.tag))
|
|
43
|
+
return undefined;
|
|
44
|
+
// memo() and forwardRef() wrap the function, sometimes one inside the other.
|
|
45
|
+
let type = fiber.elementType ?? fiber.type;
|
|
46
|
+
for (let depth = 0; type != null && depth < 3; depth++) {
|
|
47
|
+
const name = type.displayName ?? (typeof type === 'function' ? type.name : undefined);
|
|
48
|
+
// Bundlers rename clashing functions with a suffix, e.g. Vite's pre-bundling turns SWRConfig into SWRConfig$1.
|
|
49
|
+
if (typeof name === 'string' && name !== '')
|
|
50
|
+
return name.replace(/\$\d+$/, '') || name;
|
|
51
|
+
if (typeof type !== 'object')
|
|
52
|
+
return undefined;
|
|
53
|
+
type = type.render ?? type.type;
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// Library contexts
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
/** Contexts that libraries name, by display name. */
|
|
61
|
+
const LIBRARY_CONTEXTS = new Map(Object.entries({
|
|
62
|
+
ReactRedux: 'react-redux',
|
|
63
|
+
TextAncestorContext: 'React Native',
|
|
64
|
+
RootTagContext: 'React Native',
|
|
65
|
+
ScrollViewContext: 'React Native',
|
|
66
|
+
VirtualizedListContext: 'React Native',
|
|
67
|
+
ImageAnalyticsTagContext: 'React Native',
|
|
68
|
+
SafeAreaInsetsContext: 'react-native-safe-area-context',
|
|
69
|
+
SafeAreaFrameContext: 'react-native-safe-area-context',
|
|
70
|
+
LinkingContext: 'React Navigation',
|
|
71
|
+
LocaleDirContext: 'React Navigation',
|
|
72
|
+
UnhandledLinkingContext: 'React Navigation',
|
|
73
|
+
HeaderBackContext: 'React Navigation',
|
|
74
|
+
HeaderHeightContext: 'React Navigation',
|
|
75
|
+
HeaderShownContext: 'React Navigation',
|
|
76
|
+
NavigatorContext: 'Expo Router',
|
|
77
|
+
RouteNode: 'Expo Router',
|
|
78
|
+
}));
|
|
79
|
+
/** Where React Navigation keeps the contexts it names, so that two copies of it share them. */
|
|
80
|
+
const REACT_NAVIGATION_CONTEXTS = '__react_navigation__elements_contexts';
|
|
81
|
+
/** Library components that render providers, by the names their code gives them. Names an app might use are left out. */
|
|
82
|
+
const LIBRARY_COMPONENTS = new Map(Object.entries({
|
|
83
|
+
QueryClientProvider: 'TanStack Query',
|
|
84
|
+
QueryErrorResetBoundary: 'TanStack Query',
|
|
85
|
+
PersistQueryClientProvider: 'TanStack Query',
|
|
86
|
+
HydrationBoundary: 'TanStack Query',
|
|
87
|
+
SWRConfig: 'SWR',
|
|
88
|
+
BaseNavigationContainer: 'React Navigation',
|
|
89
|
+
NavigationContainerInner: 'React Navigation',
|
|
90
|
+
NavigationIndependentTree: 'React Navigation',
|
|
91
|
+
NavigationProvider: 'React Navigation',
|
|
92
|
+
NavigationStateListenerProvider: 'React Navigation',
|
|
93
|
+
PreventRemoveProvider: 'React Navigation',
|
|
94
|
+
EnsureSingleNavigator: 'React Navigation',
|
|
95
|
+
SceneView: 'React Navigation',
|
|
96
|
+
ServerContainer: 'React Navigation',
|
|
97
|
+
FrameSizeProvider: 'React Navigation',
|
|
98
|
+
AnimatedHeaderHeightProvider: 'React Navigation',
|
|
99
|
+
BottomTabView: 'React Navigation',
|
|
100
|
+
CardContainerInner: 'React Navigation',
|
|
101
|
+
DrawerViewBase: 'React Navigation',
|
|
102
|
+
NativeStackView: 'React Navigation',
|
|
103
|
+
MaterialTopTabView: 'React Navigation',
|
|
104
|
+
NavigationContent: 'React Navigation',
|
|
105
|
+
PanGestureHandler: 'React Navigation',
|
|
106
|
+
ExpoRoot: 'Expo Router',
|
|
107
|
+
ContextNavigator: 'Expo Router',
|
|
108
|
+
InnerRoot: 'Expo Router',
|
|
109
|
+
RootModalProvider: 'Expo Router',
|
|
110
|
+
LinkPreviewContextProvider: 'Expo Router',
|
|
111
|
+
NativeTabsNavigator: 'Expo Router',
|
|
112
|
+
SlotNavigator: 'Expo Router',
|
|
113
|
+
SplitViewNavigator: 'Expo Router',
|
|
114
|
+
ExperimentalStackNavigator: 'Expo Router',
|
|
115
|
+
ZoomTransitionSourceContextProvider: 'Expo Router',
|
|
116
|
+
ZoomTransitionTargetContextProvider: 'Expo Router',
|
|
117
|
+
// Expo Router 58, which carries its own copy of React Navigation.
|
|
118
|
+
RoutingQueueProvider: 'Expo Router',
|
|
119
|
+
RemovalEventEmitterRegistryProvider: 'Expo Router',
|
|
120
|
+
RoutesWithRemovalPreventedProvider: 'Expo Router',
|
|
121
|
+
PreventRemovalProvider: 'Expo Router',
|
|
122
|
+
GuardContextProvider: 'Expo Router',
|
|
123
|
+
NavigationActivityProvider: 'Expo Router',
|
|
124
|
+
StandardRouterNavigator: 'Expo Router',
|
|
125
|
+
NativeTabsNavigatorWrapper: 'Expo Router',
|
|
126
|
+
NativeTabsContent: 'Expo Router',
|
|
127
|
+
NativeStackNavigatorContent: 'Expo Router',
|
|
128
|
+
ExperimentalStackNavigatorContent: 'Expo Router',
|
|
129
|
+
HeaderToolbarHostBase: 'Expo Router',
|
|
130
|
+
StackToolbarHeader: 'Expo Router',
|
|
131
|
+
StackToolbarBottom: 'Expo Router',
|
|
132
|
+
NativeToolbarMenu: 'Expo Router',
|
|
133
|
+
LinkWithPreview: 'Expo Router',
|
|
134
|
+
HrefPreview: 'Expo Router',
|
|
135
|
+
PreviewForRootHrefState: 'Expo Router',
|
|
136
|
+
InnerRouter: 'Expo Router',
|
|
137
|
+
FocusedHead: 'Expo Router',
|
|
138
|
+
HeadShim: 'Expo Router',
|
|
139
|
+
WebSafeAreaProvider: 'Expo Router',
|
|
140
|
+
ServerRoot: 'Expo Router',
|
|
141
|
+
ServerRouter: 'Expo Router',
|
|
142
|
+
ServerDocument: 'Expo Router',
|
|
143
|
+
SafeAreaProvider: 'react-native-safe-area-context',
|
|
144
|
+
ScreenStack: 'react-native-screens',
|
|
145
|
+
ScreenStackItem: 'react-native-screens',
|
|
146
|
+
InnerScreen: 'react-native-screens',
|
|
147
|
+
GestureDetectorProvider: 'react-native-screens',
|
|
148
|
+
ReanimatedScreenProvider: 'react-native-screens',
|
|
149
|
+
ReanimatedNativeStackScreen: 'react-native-screens',
|
|
150
|
+
GestureHandlerRootView: 'react-native-gesture-handler',
|
|
151
|
+
InterceptingGestureDetector: 'react-native-gesture-handler',
|
|
152
|
+
ScrollViewResponderProvider: 'react-native-gesture-handler',
|
|
153
|
+
SkipEntering: 'react-native-reanimated',
|
|
154
|
+
AppContainer: 'React Native',
|
|
155
|
+
}));
|
|
156
|
+
/** Expo Router names each route's component after the route, e.g. `Route(index)`. */
|
|
157
|
+
const EXPO_ROUTE = /^Route\(.*\)$/;
|
|
158
|
+
/**
|
|
159
|
+
* Library components whose names an app might use too, recognized by the component that rendered them: Expo
|
|
160
|
+
* Router's `Content` comes from ContextNavigator, its `Route` from a route's own component.
|
|
161
|
+
*/
|
|
162
|
+
const LIBRARY_COMPONENTS_BY_OWNER = new Map([
|
|
163
|
+
['Content', (owner) => owner === 'ContextNavigator'],
|
|
164
|
+
['Route', (owner) => EXPO_ROUTE.test(owner)],
|
|
165
|
+
]);
|
|
166
|
+
const NAVIGATION_COLORS = ['primary', 'background', 'card', 'text', 'border', 'notification'];
|
|
167
|
+
/** A React Navigation theme, which its ThemeContext holds; an app's ThemeContext usually holds something else. */
|
|
168
|
+
function isNavigationTheme(value) {
|
|
169
|
+
const colors = value.colors;
|
|
170
|
+
return typeof value.dark === 'boolean' && colors != null && NAVIGATION_COLORS.every((key) => typeof colors[key] === 'string');
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Expo Router's layouts (Stack, Tabs, Drawer…) carry `Screen` and `Protected` as statics, and some are anonymous
|
|
174
|
+
* arrow functions, so the name of the app's layout that renders them would be taken for theirs.
|
|
175
|
+
*/
|
|
176
|
+
function ownedByExpoRouterLayout(fiber) {
|
|
177
|
+
const owner = fiber._debugOwner;
|
|
178
|
+
if (owner == null || !('tag' in owner))
|
|
179
|
+
return false;
|
|
180
|
+
for (let type = owner.elementType ?? owner.type, depth = 0; type != null && depth < 3; depth++) {
|
|
181
|
+
if (typeof type.Screen === 'function' && typeof type.Protected === 'function')
|
|
182
|
+
return true;
|
|
183
|
+
if (typeof type !== 'object')
|
|
184
|
+
return false;
|
|
185
|
+
type = type.render ?? type.type;
|
|
186
|
+
}
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
/** The name of the component that rendered the owner: one step past `ownerName(fiber, true)`. */
|
|
190
|
+
function ownerOfOwnerName(fiber) {
|
|
191
|
+
for (let owner = fiber._debugOwner, hops = 0; owner != null && 'tag' in owner && hops < 20; hops++) {
|
|
192
|
+
if (componentName(owner) !== undefined)
|
|
193
|
+
return ownerName(owner, true);
|
|
194
|
+
owner = owner._debugOwner;
|
|
195
|
+
}
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The library a context comes from, or undefined for the app's own. Runs once per store. Only the owner counts, not
|
|
200
|
+
* a component above: an app's provider passed to `root.render()` inside a library's has no owner.
|
|
201
|
+
*/
|
|
202
|
+
export function vendorOf(fiber, context, value) {
|
|
203
|
+
try {
|
|
204
|
+
const redux = globalThis[Symbol.for('react-redux-context')];
|
|
205
|
+
if (redux instanceof Map)
|
|
206
|
+
for (const known of redux.values())
|
|
207
|
+
if (known === context)
|
|
208
|
+
return 'react-redux';
|
|
209
|
+
const navigation = globalThis[REACT_NAVIGATION_CONTEXTS];
|
|
210
|
+
if (navigation instanceof Map)
|
|
211
|
+
for (const known of navigation.values())
|
|
212
|
+
if (known === context)
|
|
213
|
+
return 'React Navigation';
|
|
214
|
+
// Bundlers number names they had to rename, e.g. `SWRConfig$1`.
|
|
215
|
+
const plain = (text) => text?.replace(/(?:\$|_)\d+$/, '');
|
|
216
|
+
const name = plain(contextName(context));
|
|
217
|
+
if (value !== null && typeof value === 'object') {
|
|
218
|
+
const v = value;
|
|
219
|
+
if (typeof v.getQueryCache === 'function' && typeof v.getMutationCache === 'function')
|
|
220
|
+
return 'TanStack Query';
|
|
221
|
+
const cache = v.cache;
|
|
222
|
+
if (typeof v.mutate === 'function' && cache != null && typeof cache.get === 'function' && typeof cache.set === 'function') {
|
|
223
|
+
return 'SWR';
|
|
224
|
+
}
|
|
225
|
+
if (name === 'ThemeContext' && isNavigationTheme(v))
|
|
226
|
+
return 'React Navigation';
|
|
227
|
+
}
|
|
228
|
+
if (ownedByExpoRouterLayout(fiber))
|
|
229
|
+
return 'Expo Router';
|
|
230
|
+
const owner = plain(ownerName(fiber, true));
|
|
231
|
+
if (owner === undefined)
|
|
232
|
+
return LIBRARY_CONTEXTS.get(name ?? '') ?? sourcePackage(fiber);
|
|
233
|
+
const byOwner = LIBRARY_COMPONENTS_BY_OWNER.get(owner);
|
|
234
|
+
const byName = LIBRARY_CONTEXTS.get(name ?? '') ??
|
|
235
|
+
LIBRARY_COMPONENTS.get(owner) ??
|
|
236
|
+
(EXPO_ROUTE.test(owner) || byOwner?.(plain(ownerOfOwnerName(fiber)) ?? '') ? 'Expo Router' : undefined);
|
|
237
|
+
return byName ?? sourcePackage(fiber);
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
return undefined;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The package whose code created the provider element, from where React says it was created. Web only: React
|
|
245
|
+
* Native's stacks name the bundle rather than files.
|
|
246
|
+
*/
|
|
247
|
+
function sourcePackage(fiber) {
|
|
248
|
+
let path;
|
|
249
|
+
const source = fiber._debugSource;
|
|
250
|
+
if (typeof source?.fileName === 'string') {
|
|
251
|
+
path = source.fileName;
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
// React Native's frames name the bundle, never a file: not worth formatting the stack for.
|
|
255
|
+
if (typeof navigator === 'object' && navigator?.product === 'ReactNative')
|
|
256
|
+
return undefined;
|
|
257
|
+
const stack = fiber._debugStack?.stack;
|
|
258
|
+
if (typeof stack !== 'string' || stack.includes('UnknownOwner'))
|
|
259
|
+
return undefined;
|
|
260
|
+
// The first frame is React's jsxDEV or createElement; the next is the code that created the element.
|
|
261
|
+
const frame = stack.split('\n').filter((line) => /:\d+:\d+\)?\s*$/.test(line))[1];
|
|
262
|
+
path = frame && /((?:[a-z][\w+.-]*:\/\/|\/)[^\s()]+?)(?::\d+){1,2}\)?\s*$/i.exec(frame)?.[1]?.replace(/[?#].*$/, '');
|
|
263
|
+
}
|
|
264
|
+
if (path === undefined)
|
|
265
|
+
return undefined;
|
|
266
|
+
// Turbopack names chunks after the path they hold, with underscores for slashes.
|
|
267
|
+
if (/\/node_modules_[^/]*$/.test(path))
|
|
268
|
+
return 'a dependency';
|
|
269
|
+
const at = path.lastIndexOf('node_modules/');
|
|
270
|
+
if (at < 0)
|
|
271
|
+
return undefined;
|
|
272
|
+
const rest = path.slice(at + 'node_modules/'.length);
|
|
273
|
+
// Vite serves dependencies as `.vite/deps/<name>.js`, with `@scope_name` for scoped ones.
|
|
274
|
+
const vite = /^\.vite\/deps\/([^/]+?)\.js$/.exec(rest)?.[1];
|
|
275
|
+
if (vite !== undefined)
|
|
276
|
+
return vite.startsWith('chunk-') ? 'a dependency' : vite.replace(/^(@[^_]+)_/, '$1/');
|
|
277
|
+
const parts = rest.split('/');
|
|
278
|
+
return (parts[0]?.startsWith('@') ? `${parts[0]}/${parts[1]}` : parts[0]) || 'a dependency';
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=context-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context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AE,EAAE,CAAC,CAAC;IACvH,CAAC;IACD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzC,iFAAiF;IACjF,IAAI,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,cAAc,CAAC;IAC9D,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAC7C,IAAI,EAAE,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACrD,0FAA0F;IAC1F,MAAM,IAAI,GAAG,8BAA8B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5D,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC9G,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC;AAC9F,CAAC"}
|
|
@@ -1,94 +1,5 @@
|
|
|
1
1
|
import type { StateStoreInfo } from '@capybara-devtools/protocol';
|
|
2
2
|
import type { PluginContext } from '../../client.js';
|
|
3
|
-
/** A React fiber, as far as Capybara reads one. */
|
|
4
|
-
export interface Fiber {
|
|
5
|
-
tag: number;
|
|
6
|
-
key?: string | null;
|
|
7
|
-
type: any;
|
|
8
|
-
/** memo() keeps the wrapper here and the function in `type`. */
|
|
9
|
-
elementType?: any;
|
|
10
|
-
return: Fiber | null;
|
|
11
|
-
child: Fiber | null;
|
|
12
|
-
sibling: Fiber | null;
|
|
13
|
-
alternate: Fiber | null;
|
|
14
|
-
memoizedProps: any;
|
|
15
|
-
memoizedState?: any;
|
|
16
|
-
/** Children this fiber removed in the commit that made it. */
|
|
17
|
-
deletions?: Fiber[] | null;
|
|
18
|
-
_debugOwner?: unknown;
|
|
19
|
-
/** React 19: where the element was created. */
|
|
20
|
-
_debugStack?: unknown;
|
|
21
|
-
/** React 18 with the JSX source transform. */
|
|
22
|
-
_debugSource?: unknown;
|
|
23
|
-
}
|
|
24
|
-
/** What React hands `onCommitFiberRoot`; `current` is the HostRoot fiber of the tree just committed. */
|
|
25
|
-
export interface FiberRoot {
|
|
26
|
-
current: Fiber;
|
|
27
|
-
}
|
|
28
|
-
/** Where a walk cut short by its budget goes on from. */
|
|
29
|
-
export interface WalkCursor {
|
|
30
|
-
top: Fiber;
|
|
31
|
-
node: Fiber;
|
|
32
|
-
/** Ancestors of `node` below `top`, outermost first. */
|
|
33
|
-
stack: Fiber[];
|
|
34
|
-
}
|
|
35
|
-
export interface ProviderHit {
|
|
36
|
-
fiber: Fiber;
|
|
37
|
-
/** The context object, the same for every provider of one context. */
|
|
38
|
-
context: unknown;
|
|
39
|
-
value: unknown;
|
|
40
|
-
/** Neither this fiber nor its alternate was in `seen` before. */
|
|
41
|
-
first: boolean;
|
|
42
|
-
}
|
|
43
|
-
export interface WalkProvidersOptions {
|
|
44
|
-
/**
|
|
45
|
-
* Right after a commit: go only into subtrees whose children changed in it, and report known providers whose
|
|
46
|
-
* value changed too. Without it, every fiber is visited and only providers missing from `seen` are reported.
|
|
47
|
-
*/
|
|
48
|
-
changed?: boolean;
|
|
49
|
-
/** Return after about this many milliseconds, with `next` to go on from. Default: no limit. */
|
|
50
|
-
budget?: number;
|
|
51
|
-
/** Return once this many providers are reported, with `next` to go on from. Default: no limit. */
|
|
52
|
-
limit?: number;
|
|
53
|
-
from?: WalkCursor | null;
|
|
54
|
-
/** Called on every fiber visited, e.g. to look for stores in hooks. */
|
|
55
|
-
visit?: (fiber: Fiber) => void;
|
|
56
|
-
/** Clock for `budget`. Default `performance.now`, else `Date.now`. */
|
|
57
|
-
now?: () => number;
|
|
58
|
-
}
|
|
59
|
-
export interface WalkProvidersResult {
|
|
60
|
-
providers: ProviderHit[];
|
|
61
|
-
visited: number;
|
|
62
|
-
/** With `changed`: a fiber visited removed children in the commit, so some provider may be gone. */
|
|
63
|
-
removed: boolean;
|
|
64
|
-
/** Set when the budget ran out first. */
|
|
65
|
-
next: WalkCursor | null;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Finds context providers (tag 10) under `root`, a FiberRoot or a fiber. `seen` maps each provider fiber, and its
|
|
69
|
-
* alternate, to the last value reported, and is updated as providers are reported.
|
|
70
|
-
*
|
|
71
|
-
* Self-contained, like the engine: the Metro bridge runs it from its source inside apps without the SDK. Iterative
|
|
72
|
-
* with a stack of its own rather than `return` pointers, which may lead to the other copy of a parent.
|
|
73
|
-
*/
|
|
74
|
-
export declare function walkProviders(root: object, seen: WeakMap<object, unknown>, options?: WalkProvidersOptions): WalkProvidersResult;
|
|
75
|
-
/** React DevTools' global hook, as far as Capybara uses it. */
|
|
76
|
-
export interface ReactHook {
|
|
77
|
-
isDisabled?: unknown;
|
|
78
|
-
renderers?: unknown;
|
|
79
|
-
getFiberRoots?: (rendererID: unknown) => Iterable<unknown>;
|
|
80
|
-
onCommitFiberRoot?: unknown;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Has `onCommit` called after each commit React reports to the React DevTools global hook. An existing hook keeps
|
|
84
|
-
* its object, which React holds on to: only its `onCommitFiberRoot` property is wrapped, the original called
|
|
85
|
-
* first. Without a hook, installs a minimal one, which only works when this runs before react-dom loads.
|
|
86
|
-
* Returns the undo, which leaves a wrapper someone else wrapped since in place, passing calls on.
|
|
87
|
-
*/
|
|
88
|
-
export declare function installReactHook(onCommit: (root: FiberRoot) => void): {
|
|
89
|
-
hook: ReactHook | undefined;
|
|
90
|
-
undo: () => void;
|
|
91
|
-
};
|
|
92
3
|
export interface ContextTracker {
|
|
93
4
|
/** The store's info as it is now; the engine keeps the one it was first given. */
|
|
94
5
|
info(store: StateStoreInfo): StateStoreInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/plugins/state/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/plugins/state/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA4DrD,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CAAC;IAC5C,IAAI,IAAI,IAAI,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,cAAc,CAiT1F"}
|