sidakram-bippy 0.2.24

Sign up to get free protection for your applications and to get access to all the features.
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2024 Aiden Bai, Million Software, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,617 @@
1
+ > [!WARNING]
2
+ > ⚠️⚠️⚠️ **this project may break production apps and cause unexpected behavior** ⚠️⚠️⚠️
3
+ >
4
+ > this project uses react internals, which can change at any time. it is not recommended to depend on internals unless you really, _really_ have to. by proceeding, you acknowledge the risk of breaking your own code or apps that use your code.
5
+
6
+ # <img src="https://github.com/aidenybai/bippy/blob/main/.github/assets/bippy.png?raw=true" width="60" align="center" /> bippy
7
+
8
+ [![size](https://img.shields.io/bundlephobia/minzip/bippy?label=gzip&style=flat&colorA=000000&colorB=000000)](https://bundlephobia.com/package/bippy)
9
+ [![version](https://img.shields.io/npm/v/bippy?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/bippy)
10
+ [![downloads](https://img.shields.io/npm/dt/bippy.svg?style=flat&colorA=000000&colorB=000000)](https://npmjs.com/package/bippy)
11
+
12
+ bippy is a toolkit to **hack into react internals**
13
+
14
+ by default, you cannot access react internals. bippy bypasses this by "pretending" to be react devtools, giving you access to the fiber tree and other internals.
15
+
16
+ - works outside of react – no react code modification needed
17
+ - utility functions that work across modern react (v17-19)
18
+ - no prior react source code knowledge required
19
+
20
+ ```jsx
21
+ import { onCommitFiberRoot, traverseFiber } from 'bippy';
22
+
23
+ onCommitFiberRoot((root) => {
24
+ traverseFiber(root.current, (fiber) => {
25
+ // prints every fiber in the current React tree
26
+ console.log('fiber:', fiber);
27
+ });
28
+ });
29
+ ```
30
+
31
+ ## how it works & motivation
32
+
33
+ bippy allows you to **access** and **use** react fibers **outside** of react components.
34
+
35
+ a react fiber is a "unit of execution." this means react will do something based on the data in a fiber. each fiber either represents a composite (function/class component) or a host (dom element).
36
+
37
+ > here is a [live visualization](https://jser.pro/ddir/rie?reactVersion=18.3.1&snippetKey=hq8jm2ylzb9u8eh468) of what the fiber tree looks like, and here is a [deep dive article](https://jser.dev/2023-07-18-how-react-rerenders/).
38
+
39
+ fibers are useful because they contain information about the react app (component props, state, contexts, etc.). a simplified version of a fiber looks roughly like this:
40
+
41
+ ```typescript
42
+ interface Fiber {
43
+ // component type (function/class)
44
+ type: any;
45
+
46
+ child: Fiber | null;
47
+ sibling: Fiber | null;
48
+
49
+ // stateNode is the host fiber (e.g. DOM element)
50
+ stateNode: Node | null;
51
+
52
+ // parent fiber
53
+ return: Fiber | null;
54
+
55
+ // the previous or current version of the fiber
56
+ alternate: Fiber | null;
57
+
58
+ // saved props input
59
+ memoizedProps: any;
60
+
61
+ // state (useState, useReducer, useSES, etc.)
62
+ memoizedState: any;
63
+
64
+ // contexts (useContext)
65
+ dependencies: Dependencies | null;
66
+
67
+ // effects (useEffect, useLayoutEffect, etc.)
68
+ updateQueue: any;
69
+ }
70
+ ```
71
+
72
+ here, the `child`, `sibling`, and `return` properties are pointers to other fibers in the tree.
73
+
74
+ additionally, `memoizedProps`, `memoizedState`, and `dependencies` are the fiber's props, state, and contexts.
75
+
76
+ while all of the information is there, it's not super easy to work with, and changes frequently across different versions of react. bippy simplifies this by providing utility functions like:
77
+
78
+ - `traverseRenderedFibers` to detect renders and `traverseFiber` to traverse the overall fiber tree
79
+ - _(instead of `child`, `sibling`, and `return` pointers)_
80
+ - `traverseProps`, `traverseState`, and `traverseContexts` to traverse the fiber's props, state, and contexts
81
+ - _(instead of `memoizedProps`, `memoizedState`, and `dependencies`)_
82
+
83
+ however, fibers aren't directly accessible by the user. so, we have to hack our way around to accessing it.
84
+
85
+ luckily, react [reads from a property](https://github.com/facebook/react/blob/6a4b46cd70d2672bc4be59dcb5b8dede22ed0cef/packages/react-reconciler/src/reactFiberDevToolsHook.js#L48) in the window object: `window.__REACT_DEVTOOLS_GLOBAL_HOOK__` and runs handlers on it when certain events happen. this property must exist before react's bundle is executed. this is intended for react devtools, but we can use it to our advantage.
86
+
87
+ here's what it roughly looks like:
88
+
89
+ ```typescript
90
+ interface __REACT_DEVTOOLS_GLOBAL_HOOK__ {
91
+ // list of renderers (react-dom, react-native, etc.)
92
+ renderers: Map<RendererID, reactRenderer>;
93
+
94
+ // called when react has rendered everything for an update and the fiber tree is fully built and ready to
95
+ // apply changes to the host tree (e.g. DOM mutations)
96
+ onCommitFiberRoot: (
97
+ rendererID: RendererID,
98
+ root: FiberRoot,
99
+ commitPriority?: number
100
+ ) => void;
101
+
102
+ // called when effects run
103
+ onPostCommitFiberRoot: (rendererID: RendererID, root: FiberRoot) => void;
104
+
105
+ // called when a specific fiber unmounts
106
+ onCommitFiberUnmount: (rendererID: RendererID, fiber: Fiber) => void;
107
+ }
108
+ ```
109
+
110
+ bippy works by monkey-patching `window.__REACT_DEVTOOLS_GLOBAL_HOOK__` with our own custom handlers. bippy simplifies this by providing utility functions like:
111
+
112
+ - `instrument` to safely patch `window.__REACT_DEVTOOLS_GLOBAL_HOOK__`
113
+ - _(instead of directly mutating `onCommitFiberRoot`, ...)_
114
+ - `secure` to wrap your handlers in a try/catch and determine if handlers are safe to run
115
+ - _(instead of rawdogging `window.__REACT_DEVTOOLS_GLOBAL_HOOK__` handlers, which may crash your app)_
116
+ - `traverseRenderedFibers` to traverse the fiber tree and determine which fibers have actually rendered
117
+ - _(instead of `child`, `sibling`, and `return` pointers)_
118
+ - `traverseFiber` to traverse the fiber tree, regardless of whether it has rendered
119
+ - _(instead of `child`, `sibling`, and `return` pointers)_
120
+ - `setFiberId` / `getFiberId` to set and get a fiber's id
121
+ - _(instead of anonymous fibers with no identity)_
122
+
123
+ ## how to use
124
+
125
+ you can either install via a npm (recommended) or a script tag.
126
+
127
+ this package should be imported before a React app runs. this will add a special object to the global which is used by React for providing its internals to the tool for analysis (React Devtools does the same). as soon as React library is loaded and attached to the tool, bippy starts collecting data about what is going on in React's internals.
128
+
129
+ ```shell
130
+ npm install bippy
131
+ ```
132
+
133
+ or, use via script tag:
134
+
135
+ ```html
136
+ <script src="https://unpkg.com/bippy"></script>
137
+ ```
138
+
139
+ > this will cause bippy to be accessible under a `window.Bippy` global.
140
+
141
+ next, you can use the api to get data about the fiber tree. below is a (useful) subset of the api. for the full api, read the [source code](https://github.com/aidenybai/bippy/blob/main/src/core.ts).
142
+
143
+ ### onCommitFiberRoot
144
+
145
+ a utility function that wraps the `instrument` function and sets the `onCommitFiberRoot` hook.
146
+
147
+ ```typescript
148
+ import { onCommitFiberRoot } from 'bippy';
149
+
150
+ onCommitFiberRoot((root) => {
151
+ console.log('root ready to commit', root);
152
+ });
153
+ ```
154
+
155
+ ### instrument
156
+
157
+ > the underlying implementation for the `onCommitFiberRoot()` function. this is optional, unless you want to plug into more less common, advanced functionality.
158
+
159
+ patches `window.__REACT_DEVTOOLS_GLOBAL_HOOK__` with your handlers. must be imported before react, and must be initialized to properly run any other methods.
160
+
161
+ > use with the `secure` function to prevent uncaught errors from crashing your app.
162
+
163
+ ```typescript
164
+ import { instrument, secure } from 'bippy'; // must be imported BEFORE react
165
+ import * as React from 'react';
166
+
167
+ instrument(
168
+ secure({
169
+ onCommitFiberRoot(rendererID, root) {
170
+ console.log('root ready to commit', root);
171
+ },
172
+ onPostCommitFiberRoot(rendererID, root) {
173
+ console.log('root with effects committed', root);
174
+ },
175
+ onCommitFiberUnmount(rendererID, fiber) {
176
+ console.log('fiber unmounted', fiber);
177
+ },
178
+ })
179
+ );
180
+ ```
181
+
182
+ ### getRDTHook
183
+
184
+ returns the `window.__REACT_DEVTOOLS_GLOBAL_HOOK__` object. great for advanced use cases, such as accessing or modifying the `renderers` property.
185
+
186
+ ```typescript
187
+ import { getRDTHook } from 'bippy';
188
+
189
+ const hook = getRDTHook();
190
+ console.log(hook);
191
+ ```
192
+
193
+ ### traverseRenderedFibers
194
+
195
+ not every fiber in the fiber tree renders. `traverseRenderedFibers` allows you to traverse the fiber tree and determine which fibers have actually rendered.
196
+
197
+ ```typescript
198
+ import { instrument, secure, traverseRenderedFibers } from 'bippy'; // must be imported BEFORE react
199
+ import * as React from 'react';
200
+
201
+ instrument(
202
+ secure({
203
+ onCommitFiberRoot(rendererID, root) {
204
+ traverseRenderedFibers(root, (fiber) => {
205
+ console.log('fiber rendered', fiber);
206
+ });
207
+ },
208
+ })
209
+ );
210
+ ```
211
+
212
+ ### traverseFiber
213
+
214
+ calls a callback on every fiber in the fiber tree.
215
+
216
+ ```typescript
217
+ import { instrument, secure, traverseFiber } from 'bippy'; // must be imported BEFORE react
218
+ import * as React from 'react';
219
+
220
+ instrument(
221
+ secure({
222
+ onCommitFiberRoot(rendererID, root) {
223
+ traverseFiber(root.current, (fiber) => {
224
+ console.log(fiber);
225
+ });
226
+ },
227
+ })
228
+ );
229
+ ```
230
+
231
+ ### traverseProps
232
+
233
+ traverses the props of a fiber.
234
+
235
+ ```typescript
236
+ import { traverseProps } from 'bippy';
237
+
238
+ // ...
239
+
240
+ traverseProps(fiber, (propName, next, prev) => {
241
+ console.log(propName, next, prev);
242
+ });
243
+ ```
244
+
245
+ ### traverseState
246
+
247
+ traverses the state (useState, useReducer, etc.) and effects that set state of a fiber.
248
+
249
+ ```typescript
250
+ import { traverseState } from 'bippy';
251
+
252
+ // ...
253
+
254
+ traverseState(fiber, (next, prev) => {
255
+ console.log(next, prev);
256
+ });
257
+ ```
258
+
259
+ ### traverseContexts
260
+
261
+ traverses the contexts (useContext) of a fiber.
262
+
263
+ ```typescript
264
+ import { traverseContexts } from 'bippy';
265
+
266
+ // ...
267
+
268
+ traverseContexts(fiber, (next, prev) => {
269
+ console.log(next, prev);
270
+ });
271
+ ```
272
+
273
+ ### setFiberId / getFiberId
274
+
275
+ set and get a persistent identity for a fiber. by default, fibers are anonymous and have no identity.
276
+
277
+ ```typescript
278
+ import { setFiberId, getFiberId } from 'bippy';
279
+
280
+ // ...
281
+
282
+ setFiberId(fiber);
283
+ console.log('unique id for fiber:', getFiberId(fiber));
284
+ ```
285
+
286
+ ### isHostFiber
287
+
288
+ returns `true` if the fiber is a host fiber (e.g., a DOM node in react-dom).
289
+
290
+ ```typescript
291
+ import { isHostFiber } from 'bippy';
292
+
293
+ if (isHostFiber(fiber)) {
294
+ console.log('fiber is a host fiber');
295
+ }
296
+ ```
297
+
298
+ ### isCompositeFiber
299
+
300
+ returns `true` if the fiber is a composite fiber. composite fibers represent class components, function components, memoized components, and so on (anything that can actually render output).
301
+
302
+ ```typescript
303
+ import { isCompositeFiber } from 'bippy';
304
+
305
+ if (isCompositeFiber(fiber)) {
306
+ console.log('fiber is a composite fiber');
307
+ }
308
+ ```
309
+
310
+ ### getDisplayName
311
+
312
+ returns the display name of the fiber's component, falling back to the component's function or class name if available.
313
+
314
+ ```typescript
315
+ import { getDisplayName } from 'bippy';
316
+
317
+ console.log(getDisplayName(fiber));
318
+ ```
319
+
320
+ ### getType
321
+
322
+ returns the underlying type (the component definition) for a given fiber. for example, this could be a function component or class component.
323
+
324
+ ```jsx
325
+ import { getType } from 'bippy';
326
+ import { memo } from 'react';
327
+
328
+ const RealComponent = () => {
329
+ return <div>hello</div>;
330
+ };
331
+ const MemoizedComponent = memo(() => {
332
+ return <div>hello</div>;
333
+ });
334
+
335
+ console.log(getType(fiberForMemoizedComponent) === RealComponent);
336
+ ```
337
+
338
+ ### getNearestHostFiber / getNearestHostFibers
339
+
340
+ getNearestHostFiber returns the closest host fiber above or below a given fiber. getNearestHostFibers(fiber) returns all host fibers associated with the provided fiber and its subtree.
341
+
342
+ ```jsx
343
+ import { getNearestHostFiber, getNearestHostFibers } from 'bippy';
344
+
345
+ // ...
346
+
347
+ function Component() {
348
+ return (
349
+ <>
350
+ <div>hello</div>
351
+ <div>world</div>
352
+ </>
353
+ );
354
+ }
355
+
356
+ console.log(getNearestHostFiber(fiberForComponent)); // <div>hello</div>
357
+ console.log(getNearestHostFibers(fiberForComponent)); // [<div>hello</div>, <div>world</div>]
358
+ ```
359
+
360
+ ### getTimings
361
+
362
+ returns the self and total render times for the fiber.
363
+
364
+ ```typescript
365
+ // timings don't exist in react production builds
366
+ if (fiber.actualDuration !== undefined) {
367
+ const { selfTime, totalTime } = getTimings(fiber);
368
+ console.log(selfTime, totalTime);
369
+ }
370
+ ```
371
+
372
+ ### getFiberStack
373
+
374
+ returns an array representing the stack of fibers from the current fiber up to the root.
375
+
376
+ ```typescript
377
+ [fiber, fiber.return, fiber.return.return, ...]
378
+ ```
379
+
380
+ ### getMutatedHostFibers
381
+
382
+ returns an array of all host fibers that have committed and rendered in the provided fiber's subtree.
383
+
384
+ ```typescript
385
+ import { getMutatedHostFibers } from 'bippy';
386
+
387
+ console.log(getMutatedHostFibers(fiber));
388
+ ```
389
+
390
+ ### isValidFiber
391
+
392
+ returns `true` if the given object is a valid React Fiber (i.e., has a tag, stateNode, return, child, sibling, etc.).
393
+
394
+ ```typescript
395
+ import { isValidFiber } from 'bippy';
396
+
397
+ console.log(isValidFiber(fiber));
398
+ ```
399
+
400
+ ## examples
401
+
402
+ the best way to understand bippy is to [read the source code](https://github.com/aidenybai/bippy/blob/main/src/core.ts). here are some examples of how you can use it:
403
+
404
+ ### a mini react-scan
405
+
406
+ here's a mini toy version of [`react-scan`](https://github.com/aidenybai/react-scan) that highlights renders in your app.
407
+
408
+ ```javascript
409
+ import {
410
+ instrument,
411
+ isHostFiber,
412
+ getNearestHostFiber,
413
+ traverseRenderedFibers,
414
+ } from 'bippy'; // must be imported BEFORE react
415
+
416
+ const highlightFiber = (fiber) => {
417
+ if (!(fiber.stateNode instanceof HTMLElement)) return;
418
+ // fiber.stateNode is a DOM element
419
+ const rect = fiber.stateNode.getBoundingClientRect();
420
+ const highlight = document.createElement('div');
421
+ highlight.style.border = '1px solid red';
422
+ highlight.style.position = 'fixed';
423
+ highlight.style.top = `${rect.top}px`;
424
+ highlight.style.left = `${rect.left}px`;
425
+ highlight.style.width = `${rect.width}px`;
426
+ highlight.style.height = `${rect.height}px`;
427
+ highlight.style.zIndex = 999999999;
428
+ document.documentElement.appendChild(highlight);
429
+ setTimeout(() => {
430
+ document.documentElement.removeChild(highlight);
431
+ }, 100);
432
+ };
433
+
434
+ /**
435
+ * `instrument` is a function that installs the react DevTools global
436
+ * hook and allows you to set up custom handlers for react fiber events.
437
+ */
438
+ instrument(
439
+ /**
440
+ * `secure` is a function that wraps your handlers in a try/catch
441
+ * and prevents it from crashing the app. it also prevents it from
442
+ * running on unsupported react versions and during production.
443
+ *
444
+ * this is not required but highly recommended to provide "safeguards"
445
+ * in case something breaks.
446
+ */
447
+ secure({
448
+ /**
449
+ * `onCommitFiberRoot` is a handler that is called when react is
450
+ * ready to commit a fiber root. this means that react is has
451
+ * rendered your entire app and is ready to apply changes to
452
+ * the host tree (e.g. via DOM mutations).
453
+ */
454
+ onCommitFiberRoot(rendererID, root) {
455
+ /**
456
+ * `traverseRenderedFibers` traverses the fiber tree and determines which
457
+ * fibers have actually rendered.
458
+ *
459
+ * A fiber tree contains many fibers that may have not rendered. this
460
+ * can be because it bailed out (e.g. `useMemo`) or because it wasn't
461
+ * actually rendered (if <Child> re-rendered, then <Parent> didn't
462
+ * actually render, but exists in the fiber tree).
463
+ */
464
+ traverseRenderedFibers(root, (fiber) => {
465
+ /**
466
+ * `getNearestHostFiber` is a utility function that finds the
467
+ * nearest host fiber to a given fiber.
468
+ *
469
+ * a host fiber for `react-dom` is a fiber that has a DOM element
470
+ * as its `stateNode`.
471
+ */
472
+ const hostFiber = getNearestHostFiber(fiber);
473
+ highlightFiber(hostFiber);
474
+ });
475
+ },
476
+ })
477
+ );
478
+ ```
479
+
480
+ ### a mini why-did-you-render
481
+
482
+ here's a mini toy version of [`why-did-you-render`](https://github.com/welldone-software/why-did-you-render) that logs why components re-render.
483
+
484
+ ```typescript
485
+ import {
486
+ instrument,
487
+ isHostFiber,
488
+ traverseRenderedFibers,
489
+ isCompositeFiber,
490
+ getDisplayName,
491
+ traverseProps,
492
+ traverseContexts,
493
+ traverseState,
494
+ } from 'bippy'; // must be imported BEFORE react
495
+
496
+ instrument(
497
+ secure({
498
+ onCommitFiberRoot(rendererID, root) {
499
+ traverseRenderedFibers(root, (fiber) => {
500
+ /**
501
+ * `isCompositeFiber` is a utility function that checks if a fiber is a composite fiber.
502
+ * a composite fiber is a fiber that represents a function or class component.
503
+ */
504
+ if (!isCompositeFiber(fiber)) return;
505
+
506
+ /**
507
+ * `getDisplayName` is a utility function that gets the display name of a fiber.
508
+ */
509
+ const displayName = getDisplayName(fiber);
510
+ if (!displayName) return;
511
+
512
+ const changes = [];
513
+
514
+ /**
515
+ * `traverseProps` is a utility function that traverses the props of a fiber.
516
+ */
517
+ traverseProps(fiber, (propName, next, prev) => {
518
+ if (next !== prev) {
519
+ changes.push({
520
+ name: `prop ${propName}`,
521
+ prev,
522
+ next,
523
+ });
524
+ }
525
+ });
526
+
527
+ let contextId = 0;
528
+ /**
529
+ * `traverseContexts` is a utility function that traverses the contexts of a fiber.
530
+ * Contexts don't have a "name" like props, so we use an id to identify them.
531
+ */
532
+ traverseContexts(fiber, (next, prev) => {
533
+ if (next !== prev) {
534
+ changes.push({
535
+ name: `context ${contextId}`,
536
+ prev,
537
+ next,
538
+ contextId,
539
+ });
540
+ }
541
+ contextId++;
542
+ });
543
+
544
+ let stateId = 0;
545
+ /**
546
+ * `traverseState` is a utility function that traverses the state of a fiber.
547
+ *
548
+ * State don't have a "name" like props, so we use an id to identify them.
549
+ */
550
+ traverseState(fiber, (value, prevValue) => {
551
+ if (next !== prev) {
552
+ changes.push({
553
+ name: `state ${stateId}`,
554
+ prev,
555
+ next,
556
+ });
557
+ }
558
+ stateId++;
559
+ });
560
+
561
+ console.group(
562
+ `%c${displayName}`,
563
+ 'background: hsla(0,0%,70%,.3); border-radius:3px; padding: 0 2px;'
564
+ );
565
+ for (const { name, prev, next } of changes) {
566
+ console.log(`${name}:`, prev, '!==', next);
567
+ }
568
+ console.groupEnd();
569
+ });
570
+ },
571
+ })
572
+ );
573
+ ```
574
+
575
+ ## glossary
576
+
577
+ - fiber: a "unit of execution" in react, representing a component or dom element
578
+ - commit: the process of applying changes to the host tree (e.g. DOM mutations)
579
+ - render: the process of building the fiber tree by executing component function/classes
580
+ - host tree: the tree of UI elements that react mutates (e.g. DOM elements)
581
+ - reconciler (or "renderer"): custom bindings for react, e.g. react-dom, react-native, react-three-fiber, etc to mutate the host tree
582
+ - `rendererID`: the id of the reconciler, starting at 1 (can be from multiple reconciler instances)
583
+ - `root`: a special `FiberRoot` type that contains the container fiber (the one you pass to `ReactDOM.createRoot`) in the `current` property
584
+ - `onCommitFiberRoot`: called when react is ready to commit a fiber root
585
+ - `onPostCommitFiberRoot`: called when react has committed a fiber root and effects have run
586
+ - `onCommitFiberUnmount`: called when a fiber unmounts
587
+
588
+ ## development
589
+
590
+ pre-requisite: you should understand how react works internally. if you don't, please give this [series of articles](https://jser.dev/series/react-source-code-walkthrough) a read.
591
+
592
+ we use a pnpm monorepo, get started by running:
593
+
594
+ ```shell
595
+ pnpm install
596
+ # create dev builds
597
+ pnpm run dev
598
+ # run unit tests
599
+ pnpm run test
600
+ ```
601
+
602
+ you can ad-hoc test by running `pnpm run dev` in the `/kitchen-sink` directory.
603
+
604
+ ```shell
605
+ cd kitchen-sink
606
+ pnpm run dev
607
+ ```
608
+
609
+ ## misc
610
+
611
+ we use this project internally in [react-scan](https://github.com/aidenybai/react-scan), which is deployed with proper safeguards to ensure it's only used in development or error-guarded in production.
612
+
613
+ while i maintain this specifically for react-scan, those seeking more robust solutions might consider [its-fine](https://github.com/pmndrs/its-fine) for accessing fibers within react using hooks, or [react-devtools-inline](https://www.npmjs.com/package/react-devtools-inline) for a headful interface.
614
+
615
+ if you plan to use this project beyond experimentation, please review [react-scan's source code](https://github.com/aidenybai/react-scan) to understand our safeguarding practices.
616
+
617
+ the original bippy character is owned and created by [@dairyfreerice](https://www.instagram.com/dairyfreerice). this project is not related to the bippy brand, i just think the character is cute.