bippy 0.6.1-dev.3a24abf → 0.6.1-dev.93556ef

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.
Files changed (51) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +26 -1
  3. package/dist/core.cjs +1 -1
  4. package/dist/core.d.cts +39 -42
  5. package/dist/core.d.ts +39 -42
  6. package/dist/core.js +1 -1
  7. package/dist/core2.cjs +1 -1
  8. package/dist/core2.d.cts +11 -3
  9. package/dist/core2.d.ts +11 -3
  10. package/dist/core2.js +1 -1
  11. package/dist/{types.d.cts → errors.d.cts} +187 -68
  12. package/dist/{types.d.ts → errors.d.ts} +187 -68
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.d.cts +11 -3
  15. package/dist/index.d.ts +11 -3
  16. package/dist/index.iife.js +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/install-hook-only.cjs +1 -1
  19. package/dist/install-hook-only.d.cts +8 -0
  20. package/dist/install-hook-only.d.ts +8 -0
  21. package/dist/install-hook-only.iife.js +1 -1
  22. package/dist/install-hook-only.js +1 -1
  23. package/dist/rdt-hook.cjs +1 -1
  24. package/dist/rdt-hook.js +1 -1
  25. package/dist/source.cjs +13 -14
  26. package/dist/source.d.cts +86 -69
  27. package/dist/source.d.ts +86 -69
  28. package/dist/source.js +13 -14
  29. package/package.json +10 -6
  30. package/src/core.ts +246 -293
  31. package/src/errors.ts +34 -0
  32. package/src/install-hook-only.ts +2 -2
  33. package/src/rdt-hook.ts +152 -110
  34. package/src/react-internals/generated/react-work-tags.ts +318 -0
  35. package/src/react-internals/index.ts +67 -0
  36. package/src/react-internals/semver.ts +80 -0
  37. package/src/{types.ts → react-internals/types.ts} +13 -86
  38. package/src/source/error-stack.ts +11 -0
  39. package/src/source/get-display-name-from-source.ts +44 -40
  40. package/src/source/get-source.ts +42 -26
  41. package/src/source/index.ts +11 -1
  42. package/src/source/inspect-hooks.ts +220 -207
  43. package/src/source/owner-stack.ts +86 -128
  44. package/src/source/parse-debug-stack.ts +4 -4
  45. package/src/source/parse-hook-names.ts +14 -53
  46. package/src/source/parse-stack.ts +14 -31
  47. package/src/source/renderer-dispatchers.ts +30 -0
  48. package/src/source/symbolication.ts +703 -135
  49. package/src/generated/react-work-tags.ts +0 -169
  50. package/src/react-internals.ts +0 -67
  51. package/src/unsubscribe.ts +0 -17
@@ -1,169 +0,0 @@
1
- // Generated by the React internals Vite+ plugin from react-devtools-core.
2
-
3
- export interface ReactWorkTagMap {
4
- ActivityComponent: number;
5
- CacheComponent: number;
6
- ClassComponent: number;
7
- ContextConsumer: number;
8
- ContextProvider: number;
9
- CoroutineComponent: number;
10
- CoroutineHandlerPhase: number;
11
- DehydratedSuspenseComponent: number;
12
- ForwardRef: number;
13
- Fragment: number;
14
- FunctionComponent: number;
15
- HostComponent: number;
16
- HostHoistable: number;
17
- HostPortal: number;
18
- HostRoot: number;
19
- HostSingleton: number;
20
- HostText: number;
21
- IncompleteClassComponent: number;
22
- IncompleteFunctionComponent: number;
23
- IndeterminateComponent: number;
24
- LazyComponent: number;
25
- LegacyHiddenComponent: number;
26
- MemoComponent: number;
27
- Mode: number;
28
- OffscreenComponent: number;
29
- Profiler: number;
30
- ScopeComponent: number;
31
- SimpleMemoComponent: number;
32
- SuspenseComponent: number;
33
- SuspenseListComponent: number;
34
- Throw: number;
35
- TracingMarkerComponent: number;
36
- ViewTransitionComponent: number;
37
- YieldComponent: number;
38
- }
39
-
40
- const defineReactWorkTags = <const VersionedWorkTags extends Record<string, ReactWorkTagMap>>(
41
- workTags: VersionedWorkTags,
42
- ): VersionedWorkTags => workTags;
43
-
44
- export const ReactWorkTags = defineReactWorkTags({
45
- "17.0.1": {
46
- ActivityComponent: -1,
47
- CacheComponent: -1,
48
- ClassComponent: 1,
49
- ContextConsumer: 9,
50
- ContextProvider: 10,
51
- CoroutineComponent: -1,
52
- CoroutineHandlerPhase: -1,
53
- DehydratedSuspenseComponent: 18,
54
- ForwardRef: 11,
55
- Fragment: 7,
56
- FunctionComponent: 0,
57
- HostComponent: 5,
58
- HostHoistable: -1,
59
- HostPortal: 4,
60
- HostRoot: 3,
61
- HostSingleton: -1,
62
- HostText: 6,
63
- IncompleteClassComponent: 17,
64
- IncompleteFunctionComponent: -1,
65
- IndeterminateComponent: 2,
66
- LazyComponent: 16,
67
- LegacyHiddenComponent: 24,
68
- MemoComponent: 14,
69
- Mode: 8,
70
- OffscreenComponent: 23,
71
- Profiler: 12,
72
- ScopeComponent: 21,
73
- SimpleMemoComponent: 15,
74
- SuspenseComponent: 13,
75
- SuspenseListComponent: 19,
76
- Throw: -1,
77
- TracingMarkerComponent: -1,
78
- ViewTransitionComponent: -1,
79
- YieldComponent: -1,
80
- },
81
- "17.0.2": {
82
- ActivityComponent: 31,
83
- CacheComponent: 24,
84
- ClassComponent: 1,
85
- ContextConsumer: 9,
86
- ContextProvider: 10,
87
- CoroutineComponent: -1,
88
- CoroutineHandlerPhase: -1,
89
- DehydratedSuspenseComponent: 18,
90
- ForwardRef: 11,
91
- Fragment: 7,
92
- FunctionComponent: 0,
93
- HostComponent: 5,
94
- HostHoistable: 26,
95
- HostPortal: 4,
96
- HostRoot: 3,
97
- HostSingleton: 27,
98
- HostText: 6,
99
- IncompleteClassComponent: 17,
100
- IncompleteFunctionComponent: 28,
101
- IndeterminateComponent: 2,
102
- LazyComponent: 16,
103
- LegacyHiddenComponent: 23,
104
- MemoComponent: 14,
105
- Mode: 8,
106
- OffscreenComponent: 22,
107
- Profiler: 12,
108
- ScopeComponent: 21,
109
- SimpleMemoComponent: 15,
110
- SuspenseComponent: 13,
111
- SuspenseListComponent: 19,
112
- Throw: 29,
113
- TracingMarkerComponent: 25,
114
- ViewTransitionComponent: 30,
115
- YieldComponent: -1,
116
- },
117
- });
118
-
119
- export type ReactWorkTagVersion = keyof typeof ReactWorkTags;
120
-
121
- const react17Point0Point2WorkTags = ReactWorkTags["17.0.2"];
122
-
123
- export const ActivityComponentTag = react17Point0Point2WorkTags.ActivityComponent;
124
- export const CacheComponentTag = react17Point0Point2WorkTags.CacheComponent;
125
- export const ClassComponentTag = react17Point0Point2WorkTags.ClassComponent;
126
- export const ContextConsumerTag = react17Point0Point2WorkTags.ContextConsumer;
127
- export const ContextProviderTag = react17Point0Point2WorkTags.ContextProvider;
128
- export const DehydratedSuspenseComponentTag =
129
- react17Point0Point2WorkTags.DehydratedSuspenseComponent;
130
- export const ForwardRefTag = react17Point0Point2WorkTags.ForwardRef;
131
- export const FragmentTag = react17Point0Point2WorkTags.Fragment;
132
- export const FunctionComponentTag = react17Point0Point2WorkTags.FunctionComponent;
133
- export const HostComponentTag = react17Point0Point2WorkTags.HostComponent;
134
- export const HostHoistableTag = react17Point0Point2WorkTags.HostHoistable;
135
- export const HostPortalTag = react17Point0Point2WorkTags.HostPortal;
136
- export const HostRootTag = react17Point0Point2WorkTags.HostRoot;
137
- export const HostSingletonTag = react17Point0Point2WorkTags.HostSingleton;
138
- export const HostTextTag = react17Point0Point2WorkTags.HostText;
139
- export const IncompleteClassComponentTag = react17Point0Point2WorkTags.IncompleteClassComponent;
140
- export const IncompleteFunctionComponentTag =
141
- react17Point0Point2WorkTags.IncompleteFunctionComponent;
142
- export const IndeterminateComponentTag = react17Point0Point2WorkTags.IndeterminateComponent;
143
- export const LazyComponentTag = react17Point0Point2WorkTags.LazyComponent;
144
- export const LegacyHiddenComponentTag = react17Point0Point2WorkTags.LegacyHiddenComponent;
145
- export const MemoComponentTag = react17Point0Point2WorkTags.MemoComponent;
146
- export const ModeTag = react17Point0Point2WorkTags.Mode;
147
- export const OffscreenComponentTag = react17Point0Point2WorkTags.OffscreenComponent;
148
- export const ProfilerTag = react17Point0Point2WorkTags.Profiler;
149
- export const ScopeComponentTag = react17Point0Point2WorkTags.ScopeComponent;
150
- export const SimpleMemoComponentTag = react17Point0Point2WorkTags.SimpleMemoComponent;
151
- export const SuspenseComponentTag = react17Point0Point2WorkTags.SuspenseComponent;
152
- export const SuspenseListComponentTag = react17Point0Point2WorkTags.SuspenseListComponent;
153
- export const ThrowTag = react17Point0Point2WorkTags.Throw;
154
- export const TracingMarkerComponentTag = react17Point0Point2WorkTags.TracingMarkerComponent;
155
- export const ViewTransitionComponentTag = react17Point0Point2WorkTags.ViewTransitionComponent;
156
-
157
- export type ReactWorkTag = Exclude<
158
- (typeof ReactWorkTags)[ReactWorkTagVersion][keyof ReactWorkTagMap],
159
- -1
160
- >;
161
-
162
- export type HostWorkTag =
163
- | typeof HostComponentTag
164
- | typeof HostHoistableTag
165
- | typeof HostSingletonTag
166
- | typeof HostTextTag;
167
-
168
- export const getReactWorkTags = (version: string): Readonly<ReactWorkTagMap> =>
169
- /^17\.0\.1(?:\D|$)/.test(version) ? ReactWorkTags["17.0.1"] : ReactWorkTags["17.0.2"];
@@ -1,67 +0,0 @@
1
- export {
2
- ActivityComponentTag,
3
- ClassComponentTag,
4
- ContextConsumerTag,
5
- DehydratedSuspenseComponentTag,
6
- ForwardRefTag,
7
- FragmentTag,
8
- FunctionComponentTag,
9
- getReactWorkTags,
10
- HostComponentTag,
11
- HostHoistableTag,
12
- HostPortalTag,
13
- HostRootTag,
14
- HostSingletonTag,
15
- HostTextTag,
16
- LazyComponentTag,
17
- LegacyHiddenComponentTag,
18
- MemoComponentTag,
19
- OffscreenComponentTag,
20
- ReactWorkTags,
21
- SimpleMemoComponentTag,
22
- SuspenseComponentTag,
23
- SuspenseListComponentTag,
24
- ViewTransitionComponentTag,
25
- } from "./generated/react-work-tags.js";
26
- export type {
27
- HostWorkTag,
28
- ReactWorkTag,
29
- ReactWorkTagMap,
30
- ReactWorkTagVersion,
31
- } from "./generated/react-work-tags.js";
32
-
33
- // HACK: React does not export Fiber flags. Keep these values aligned with ReactFiberFlags.
34
- export const ReactFiberFlags = {
35
- ChildDeletion: 0b10000,
36
- Cloned: 0b1000,
37
- ContentReset: 0b100000,
38
- Hydrating: 0b1000000000000,
39
- PerformedWork: 0b1,
40
- Placement: 0b10,
41
- Snapshot: 0b10000000000,
42
- Update: 0b100,
43
- Visibility: 0b10000000000000,
44
- };
45
-
46
- export const ReactBuildType = {
47
- Development: 1,
48
- Production: 0,
49
- };
50
-
51
- export const MutationMask =
52
- ReactFiberFlags.Placement |
53
- ReactFiberFlags.Update |
54
- ReactFiberFlags.ChildDeletion |
55
- ReactFiberFlags.ContentReset |
56
- ReactFiberFlags.Hydrating |
57
- ReactFiberFlags.Visibility |
58
- ReactFiberFlags.Snapshot;
59
-
60
- // HACK: React does not export its legacy mode and element symbols, which differ between React 17, 18, and 19.
61
- export const CONCURRENT_MODE_NUMBER = 0xeacf;
62
- export const ELEMENT_TYPE_SYMBOL_STRING = "Symbol(react.element)";
63
- export const TRANSITIONAL_ELEMENT_TYPE_SYMBOL_STRING = "Symbol(react.transitional.element)";
64
- export const CONCURRENT_MODE_SYMBOL_STRING = "Symbol(react.concurrent_mode)";
65
- export const DEPRECATED_ASYNC_MODE_SYMBOL_STRING = "Symbol(react.async_mode)";
66
- export const CONCURRENT_MODE_SYMBOL_DESCRIPTION = "react.concurrent_mode";
67
- export const DEPRECATED_ASYNC_MODE_SYMBOL_DESCRIPTION = "react.async_mode";
@@ -1,17 +0,0 @@
1
- export interface Unsubscribe extends Disposable {
2
- (): void;
3
- }
4
-
5
- /**
6
- * Wraps a teardown callback so it is both callable and a `Disposable`,
7
- * letting subscriptions compose through explicit resource management:
8
- *
9
- * @example
10
- * ```ts
11
- * using instrumentation = instrument({ onCommitFiberRoot });
12
- * using rendererSubscription = onRendererInject(handleRenderer);
13
- * // both are torn down automatically at scope exit
14
- * ```
15
- */
16
- export const toUnsubscribe = (dispose: () => void): Unsubscribe =>
17
- Object.assign(dispose, { [Symbol.dispose]: dispose });