bippy 0.0.1 → 0.0.2
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/README.md +6 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
# <img src="https://github.com/aidenybai/bippy/blob/main/.github/assets/bippy.png?raw=true" width="60" align="center" /> bippy
|
|
2
2
|
|
|
3
|
-
a
|
|
3
|
+
a kitchen sink of utilities for working with react fiber. used internally for [`react-scan`](https://github.com/aidenybai/react-scan).
|
|
4
4
|
|
|
5
5
|
> [!WARNING]
|
|
6
6
|
> this project accesses react internals. this is not recommended and may break production apps - unless you acknowledge this risk and know exactly you're doing.
|
|
7
7
|
|
|
8
8
|
## example
|
|
9
9
|
|
|
10
|
+
this script logs every rendered fiber in the current [commit](https://react.dev/learn/render-and-commit).
|
|
11
|
+
|
|
10
12
|
```jsx
|
|
11
13
|
import { instrument, traverseFiberRoot } from 'bippy'; // must be imported BEFORE react
|
|
12
14
|
|
|
13
15
|
instrument({
|
|
14
16
|
onCommitFiberRoot: traverseFiberRoot({
|
|
15
17
|
onRender(fiber) {
|
|
16
|
-
|
|
18
|
+
const displayName = getDisplayName(fiber.type);
|
|
19
|
+
if (!displayName) return;
|
|
20
|
+
console.log(`${displayName} rendered`, fiber);
|
|
17
21
|
},
|
|
18
22
|
}),
|
|
19
23
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bippy",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "a kitchen sink of utilities for working with react fiber",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"react-instrumentation",
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"fiber",
|
|
10
10
|
"internals"
|
|
11
11
|
],
|
|
12
|
-
"homepage": "https://github.com/aidenybai/
|
|
12
|
+
"homepage": "https://github.com/aidenybai/bippy#readme",
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/aidenybai/
|
|
14
|
+
"url": "https://github.com/aidenybai/bippy/issues"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/aidenybai/
|
|
18
|
+
"url": "git+https://github.com/aidenybai/bippy.git"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"author": {
|