@bgub/fig-reconciler 0.1.0-alpha.2 → 0.1.0-alpha.3
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/refresh.d.ts +5 -1
- package/dist/refresh.js.map +1 -1
- package/dist-development/act.js +2 -0
- package/dist-development/commit-coordinator.js +1 -0
- package/dist-development/devtools.js +1 -0
- package/dist-development/fiber-traversal-B_egclZy.js +252 -0
- package/dist-development/fiber-traversal-B_egclZy.js.map +1 -0
- package/dist-development/index.js +3632 -0
- package/dist-development/index.js.map +1 -0
- package/dist-development/refresh-internal-C6pcjhGn.js +34 -0
- package/dist-development/refresh-internal-C6pcjhGn.js.map +1 -0
- package/dist-development/refresh.js +9 -0
- package/dist-development/refresh.js.map +1 -0
- package/dist-development/scheduler-WVeIVb_n.js +209 -0
- package/dist-development/scheduler-WVeIVb_n.js.map +1 -0
- package/dist-development/view-transitions.js +462 -0
- package/dist-development/view-transitions.js.map +1 -0
- package/package.json +11 -4
package/dist/refresh.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ interface RefreshUpdate {
|
|
|
6
6
|
staleFamilies: Set<RefreshFamily>;
|
|
7
7
|
updatedFamilies: Set<RefreshFamily>;
|
|
8
8
|
}
|
|
9
|
+
interface RefreshAdapter {
|
|
10
|
+
setRefreshHandler(handler: (type: unknown) => RefreshFamily | undefined): void;
|
|
11
|
+
scheduleRefresh(update: RefreshUpdate): void;
|
|
12
|
+
}
|
|
9
13
|
declare function setRefreshHandler(handler: ((type: unknown) => RefreshFamily | undefined) | null): void;
|
|
10
14
|
//#endregion
|
|
11
|
-
export { RefreshFamily, RefreshUpdate, setRefreshHandler };
|
|
15
|
+
export { RefreshAdapter, RefreshFamily, RefreshUpdate, setRefreshHandler };
|
package/dist/refresh.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh.js","names":[],"sources":["../src/refresh.ts"],"sourcesContent":["import { setRefreshHandlerState } from \"./refresh-internal.ts\";\n\ndeclare const __FIG_DEV__: boolean | undefined;\n\nconst __DEV__ = typeof __FIG_DEV__ === \"boolean\" ? __FIG_DEV__ : false;\n\n// A family groups every version of a component across hot edits; `current` is\n// the latest implementation. The handler is module-global
|
|
1
|
+
{"version":3,"file":"refresh.js","names":[],"sources":["../src/refresh.ts"],"sourcesContent":["import { setRefreshHandlerState } from \"./refresh-internal.ts\";\n\ndeclare const __FIG_DEV__: boolean | undefined;\n\nconst __DEV__ = typeof __FIG_DEV__ === \"boolean\" ? __FIG_DEV__ : false;\n\n// A family groups every version of a component across hot edits; `current` is\n// the latest implementation. The handler is module-global within one\n// renderer-owned reconciler so module-level reconcile helpers can consult it.\n// In production no handler is ever set, so this collapses to identity paths.\nexport interface RefreshFamily {\n current: unknown;\n}\n\nexport interface RefreshUpdate {\n staleFamilies: Set<RefreshFamily>;\n updatedFamilies: Set<RefreshFamily>;\n}\n\nexport interface RefreshAdapter {\n setRefreshHandler(\n handler: (type: unknown) => RefreshFamily | undefined,\n ): void;\n scheduleRefresh(update: RefreshUpdate): void;\n}\n\nexport function setRefreshHandler(\n handler: ((type: unknown) => RefreshFamily | undefined) | null,\n): void {\n if (__DEV__) {\n setRefreshHandlerState(handler);\n }\n}\n"],"mappings":";AA0BA,SAAgB,kBACd,SACM,CAIR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { Fragment } from "@bgub/fig";
|
|
2
|
+
import { isActivity, isAssets, isContext, isErrorBoundary, isSuspense, isThenable, isViewTransition } from "@bgub/fig/internal";
|
|
3
|
+
//#region src/fiber-work.ts
|
|
4
|
+
const StoreConsistencyFlag = 2048;
|
|
5
|
+
const AssetFlag = 16384;
|
|
6
|
+
const ContextPropagationFlag = 1024;
|
|
7
|
+
const ViewTransitionStaticFlag = 4096;
|
|
8
|
+
const HoistedStaticFlag = 8192;
|
|
9
|
+
const StaticFlagsMask = 12288;
|
|
10
|
+
function childSubtreeFlags(node) {
|
|
11
|
+
return node.flags & -24843 | node.subtreeFlags;
|
|
12
|
+
}
|
|
13
|
+
function clearTransientFlags(node) {
|
|
14
|
+
node.flags &= StaticFlagsMask;
|
|
15
|
+
node.subtreeFlags &= StaticFlagsMask;
|
|
16
|
+
}
|
|
17
|
+
function tagFor(element) {
|
|
18
|
+
if (typeof element.type === "string") return 1;
|
|
19
|
+
if (element.type === Fragment) return 4;
|
|
20
|
+
if (isAssets(element.type)) return 9;
|
|
21
|
+
if (isContext(element.type)) return 5;
|
|
22
|
+
if (isSuspense(element.type)) return 6;
|
|
23
|
+
if (isActivity(element.type)) return 10;
|
|
24
|
+
if (isErrorBoundary(element.type)) return 7;
|
|
25
|
+
if (isViewTransition(element.type)) return 11;
|
|
26
|
+
return 3;
|
|
27
|
+
}
|
|
28
|
+
const RetryLane1 = 1 << 22;
|
|
29
|
+
const SelectiveHydrationLane = 1 << 26;
|
|
30
|
+
const IdleHydrationLane = 1 << 27;
|
|
31
|
+
const IdleLane = 1 << 28;
|
|
32
|
+
const OffscreenLane = 1 << 29;
|
|
33
|
+
const DeferredLane = 1 << 30;
|
|
34
|
+
const AllTransitionLanes = 4194048;
|
|
35
|
+
const RetryLanes = 62914560;
|
|
36
|
+
const syncLaneExpirationMs = 250;
|
|
37
|
+
const transitionLaneExpirationMs = 5e3;
|
|
38
|
+
let currentUpdateLane = 32;
|
|
39
|
+
let nextTransitionLane = 256;
|
|
40
|
+
let nextRetryLane = RetryLane1;
|
|
41
|
+
let asyncTransitionLanes = 0;
|
|
42
|
+
const asyncTransitionLaneCounts = createLaneMap(0);
|
|
43
|
+
const transitionTypeHooks = {};
|
|
44
|
+
function createLaneMap(initial) {
|
|
45
|
+
return Array.from({ length: 31 }, () => initial);
|
|
46
|
+
}
|
|
47
|
+
function mergeLanes(a, b) {
|
|
48
|
+
return a | b;
|
|
49
|
+
}
|
|
50
|
+
function includesSomeLane(set, subset) {
|
|
51
|
+
return (set & subset) !== 0;
|
|
52
|
+
}
|
|
53
|
+
function getHighestPriorityLane(lanes) {
|
|
54
|
+
return lanes & -lanes;
|
|
55
|
+
}
|
|
56
|
+
function getHighestPriorityLanes(lanes) {
|
|
57
|
+
const lane = getHighestPriorityLane(lanes);
|
|
58
|
+
if (includesSomeLane(4194048, lane)) return lanes & AllTransitionLanes;
|
|
59
|
+
if (includesSomeLane(62914560, lane)) return lanes & RetryLanes;
|
|
60
|
+
return lane;
|
|
61
|
+
}
|
|
62
|
+
function getNextLanes(root, wipLanes = 0) {
|
|
63
|
+
const pending = root.pendingLanes;
|
|
64
|
+
if (pending === 0) return 0;
|
|
65
|
+
const unblocked = pending & ~root.suspendedLanes;
|
|
66
|
+
const pinged = pending & root.pingedLanes;
|
|
67
|
+
let next = root.expiredLanes & unblocked;
|
|
68
|
+
if (next === 0) {
|
|
69
|
+
next = getHighestPriorityLanes(unblocked);
|
|
70
|
+
if (next === 0) {
|
|
71
|
+
const expiredPinged = root.expiredLanes & pinged;
|
|
72
|
+
next = expiredPinged !== 0 ? expiredPinged : getHighestPriorityLanes(pinged);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (next === 0) return 0;
|
|
76
|
+
if (wipLanes !== 0 && wipLanes !== next && !includesSomeLane(root.expiredLanes, wipLanes) && getHighestPriorityLane(next) >= getHighestPriorityLane(wipLanes)) return wipLanes;
|
|
77
|
+
return getEntangledLanes(root, next);
|
|
78
|
+
}
|
|
79
|
+
function getEntangledLanes(root, lanes) {
|
|
80
|
+
let entangled = lanes;
|
|
81
|
+
let visited = 0;
|
|
82
|
+
let laneSet = entangled & root.entangledLanes;
|
|
83
|
+
while (laneSet !== 0) {
|
|
84
|
+
const index = laneToIndex(laneSet);
|
|
85
|
+
const lane = 1 << index;
|
|
86
|
+
entangled |= root.entanglements[index];
|
|
87
|
+
visited |= lane;
|
|
88
|
+
laneSet = entangled & root.entangledLanes & ~visited;
|
|
89
|
+
}
|
|
90
|
+
return entangled;
|
|
91
|
+
}
|
|
92
|
+
function markRootUpdated(root, lane) {
|
|
93
|
+
root.pendingLanes |= lane;
|
|
94
|
+
if (lane !== 268435456) {
|
|
95
|
+
root.suspendedLanes = 0;
|
|
96
|
+
root.pingedLanes = 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function markRootFinished(root, remainingLanes) {
|
|
100
|
+
const noLongerPending = root.pendingLanes & ~remainingLanes;
|
|
101
|
+
root.pendingLanes = remainingLanes;
|
|
102
|
+
root.suspendedLanes = 0;
|
|
103
|
+
root.pingedLanes = 0;
|
|
104
|
+
root.expiredLanes &= remainingLanes;
|
|
105
|
+
root.entangledLanes &= remainingLanes;
|
|
106
|
+
let lanes = noLongerPending;
|
|
107
|
+
while (lanes !== 0) {
|
|
108
|
+
const index = laneToIndex(lanes);
|
|
109
|
+
const lane = 1 << index;
|
|
110
|
+
root.entanglements[index] = 0;
|
|
111
|
+
root.expirationTimes[index] = -1;
|
|
112
|
+
lanes &= ~lane;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function markRootSuspended(root, lanes) {
|
|
116
|
+
root.suspendedLanes |= lanes;
|
|
117
|
+
root.pingedLanes &= ~lanes;
|
|
118
|
+
let laneSet = lanes;
|
|
119
|
+
while (laneSet !== 0) {
|
|
120
|
+
const index = laneToIndex(laneSet);
|
|
121
|
+
const lane = 1 << index;
|
|
122
|
+
root.expirationTimes[index] = -1;
|
|
123
|
+
laneSet &= ~lane;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function markRootPinged(root, lanes) {
|
|
127
|
+
root.pingedLanes |= root.suspendedLanes & lanes;
|
|
128
|
+
}
|
|
129
|
+
function markRootEntangled(root, lanes) {
|
|
130
|
+
root.entangledLanes |= lanes;
|
|
131
|
+
let laneSet = lanes;
|
|
132
|
+
while (laneSet !== 0) {
|
|
133
|
+
const index = laneToIndex(laneSet);
|
|
134
|
+
const lane = 1 << index;
|
|
135
|
+
root.entanglements[index] |= lanes;
|
|
136
|
+
laneSet &= ~lane;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function markStarvedLanesAsExpired(root, currentTime) {
|
|
140
|
+
let lanes = root.pendingLanes & -62914561;
|
|
141
|
+
while (lanes !== 0) {
|
|
142
|
+
const index = laneToIndex(lanes);
|
|
143
|
+
const lane = 1 << index;
|
|
144
|
+
const expiration = root.expirationTimes[index];
|
|
145
|
+
if (expiration === -1) {
|
|
146
|
+
if (!includesSomeLane(root.suspendedLanes, lane) || includesSomeLane(root.pingedLanes, lane)) root.expirationTimes[index] = computeExpirationTime(lane, currentTime);
|
|
147
|
+
} else if (expiration <= currentTime) root.expiredLanes |= lane;
|
|
148
|
+
lanes &= ~lane;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function claimNextTransitionLane() {
|
|
152
|
+
const lane = nextTransitionLane;
|
|
153
|
+
nextTransitionLane <<= 1;
|
|
154
|
+
if (!includesSomeLane(261888, nextTransitionLane)) nextTransitionLane = 256;
|
|
155
|
+
return lane;
|
|
156
|
+
}
|
|
157
|
+
function claimNextRetryLane() {
|
|
158
|
+
const lane = nextRetryLane;
|
|
159
|
+
nextRetryLane <<= 1;
|
|
160
|
+
if (!includesSomeLane(62914560, nextRetryLane)) nextRetryLane = RetryLane1;
|
|
161
|
+
return lane;
|
|
162
|
+
}
|
|
163
|
+
function isSyncLane(lane) {
|
|
164
|
+
return includesSomeLane(3, lane);
|
|
165
|
+
}
|
|
166
|
+
function includesOnlyTransitions(lanes) {
|
|
167
|
+
return (lanes & AllTransitionLanes) === lanes;
|
|
168
|
+
}
|
|
169
|
+
function getLaneSchedulerPriority(lane) {
|
|
170
|
+
if (includesSomeLane(3, lane)) return 1;
|
|
171
|
+
if (includesSomeLane(76, lane)) return 2;
|
|
172
|
+
if (includesSomeLane(71303088, lane)) return 3;
|
|
173
|
+
if (includesSomeLane(62914560, lane)) return 4;
|
|
174
|
+
return 5;
|
|
175
|
+
}
|
|
176
|
+
function requestUpdateLane() {
|
|
177
|
+
if (currentUpdateLane === 32 && asyncTransitionLanes !== 0) return getHighestPriorityLane(asyncTransitionLanes);
|
|
178
|
+
return currentUpdateLane;
|
|
179
|
+
}
|
|
180
|
+
function runWithPriority(lane, callback) {
|
|
181
|
+
const previousLane = currentUpdateLane;
|
|
182
|
+
currentUpdateLane = lane;
|
|
183
|
+
try {
|
|
184
|
+
return callback();
|
|
185
|
+
} finally {
|
|
186
|
+
currentUpdateLane = previousLane;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function runWithTransition(callback, options) {
|
|
190
|
+
return runWithTransitionLane(includesSomeLane(4194048, currentUpdateLane) ? currentUpdateLane : claimNextTransitionLane(), callback, options);
|
|
191
|
+
}
|
|
192
|
+
function runWithTransitionLane(lane, callback, options) {
|
|
193
|
+
const releaseTransition = transitionTypeHooks.retain?.(lane, options?.types);
|
|
194
|
+
let result;
|
|
195
|
+
try {
|
|
196
|
+
result = runWithPriority(lane, callback);
|
|
197
|
+
} catch (error) {
|
|
198
|
+
releaseTransition?.();
|
|
199
|
+
throw error;
|
|
200
|
+
}
|
|
201
|
+
if (isThenable(result)) {
|
|
202
|
+
const releaseAsyncLane = trackAsyncTransitionLane(lane);
|
|
203
|
+
let released = false;
|
|
204
|
+
const release = () => {
|
|
205
|
+
if (released) return;
|
|
206
|
+
released = true;
|
|
207
|
+
releaseAsyncLane();
|
|
208
|
+
releaseTransition?.();
|
|
209
|
+
};
|
|
210
|
+
result.then(release, release);
|
|
211
|
+
} else releaseTransition?.();
|
|
212
|
+
return result;
|
|
213
|
+
}
|
|
214
|
+
function trackAsyncTransitionLane(lane) {
|
|
215
|
+
const index = laneToIndex(lane);
|
|
216
|
+
asyncTransitionLaneCounts[index] += 1;
|
|
217
|
+
asyncTransitionLanes |= lane;
|
|
218
|
+
return () => releaseAsyncTransitionLane(lane, index);
|
|
219
|
+
}
|
|
220
|
+
function releaseAsyncTransitionLane(lane, index) {
|
|
221
|
+
asyncTransitionLaneCounts[index] = Math.max(0, asyncTransitionLaneCounts[index] - 1);
|
|
222
|
+
if (asyncTransitionLaneCounts[index] === 0) asyncTransitionLanes &= ~lane;
|
|
223
|
+
}
|
|
224
|
+
function computeExpirationTime(lane, currentTime) {
|
|
225
|
+
if (includesSomeLane(79, lane)) return currentTime + syncLaneExpirationMs;
|
|
226
|
+
if (includesSomeLane(4194224, lane)) return currentTime + transitionLaneExpirationMs;
|
|
227
|
+
return -1;
|
|
228
|
+
}
|
|
229
|
+
function laneToIndex(lanes) {
|
|
230
|
+
return 31 - Math.clz32(lanes);
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/fiber-traversal.ts
|
|
234
|
+
function walkFiberForest(node, visitor) {
|
|
235
|
+
walkFiberTree(node, true, visitor);
|
|
236
|
+
}
|
|
237
|
+
function walkFiberSubtree(node, visitor) {
|
|
238
|
+
walkFiberTree(node, false, visitor);
|
|
239
|
+
}
|
|
240
|
+
function walkFiberTree(node, includeRootSiblings, visitor) {
|
|
241
|
+
const stack = [];
|
|
242
|
+
let cursor = node;
|
|
243
|
+
while (cursor !== null) {
|
|
244
|
+
const shouldDescend = visitor(cursor) !== false && cursor.child !== null;
|
|
245
|
+
if ((includeRootSiblings || cursor !== node) && cursor.sibling !== null) stack.push(cursor.sibling);
|
|
246
|
+
cursor = shouldDescend ? cursor.child : stack.pop() ?? null;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
//#endregion
|
|
250
|
+
export { runWithTransitionLane as A, clearTransientFlags as B, markRootSuspended as C, requestUpdateLane as D, mergeLanes as E, HoistedStaticFlag as F, StaticFlagsMask as I, StoreConsistencyFlag as L, tagFor as M, AssetFlag as N, runWithPriority as O, ContextPropagationFlag as P, ViewTransitionStaticFlag as R, markRootPinged as S, markStarvedLanesAsExpired as T, includesSomeLane as _, IdleHydrationLane as a, markRootEntangled as b, RetryLanes as c, claimNextTransitionLane as d, createLaneMap as f, includesOnlyTransitions as g, getNextLanes as h, DeferredLane as i, transitionTypeHooks as j, runWithTransition as k, SelectiveHydrationLane as l, getLaneSchedulerPriority as m, walkFiberSubtree as n, IdleLane as o, getHighestPriorityLane as p, AllTransitionLanes as r, OffscreenLane as s, walkFiberForest as t, claimNextRetryLane as u, isSyncLane as v, markRootUpdated as w, markRootFinished as x, laneToIndex as y, childSubtreeFlags as z };
|
|
251
|
+
|
|
252
|
+
//# sourceMappingURL=fiber-traversal-B_egclZy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fiber-traversal-B_egclZy.js","names":[],"sources":["../src/fiber-work.ts","../src/fiber-tags.ts","../src/lanes.ts","../src/fiber-traversal.ts"],"sourcesContent":["export const NoFlags = 0;\n\n// Render emits transient work on individual fibers. Completion folds the\n// subset in SubtreeVisibleFlags into subtreeFlags, and commit interprets the\n// resulting tree summary in host order.\nexport const PlacementFlag = 1 << 0;\nexport const UpdateFlag = 1 << 1;\nexport const HydrationFlag = 1 << 2;\nexport const TextContentFlag = 1 << 3;\nexport const VisibilityFlag = 1 << 5;\nexport const DeletionFlag = 1 << 7;\nexport const EffectFlag = 1 << 9;\nexport const StoreConsistencyFlag = 1 << 11;\n// An Assets fiber owes its renderer a committed descriptor-list diff. Asset\n// work is sparse-indexed and out-of-band, so it never enters subtreeFlags.\nexport const AssetFlag = 1 << 14;\n\n// The fiber reused its committed children without cloning; render skips the\n// subtree and commit walks must not consume already-committed state below it.\nexport const AdoptedFlag = 1 << 4;\n// A host fiber assembled its children at complete-time, so placement inserts\n// the whole subtree once instead of placing each child independently.\nexport const AssembledFlag = 1 << 6;\n// Membership in the root's sparse commit index. Recording is idempotent, and\n// rollback clears this bit from every discarded index entry.\nexport const CommitIndexedFlag = 1 << 8;\n// This render already propagated changed providers through the subtree.\nexport const ContextPropagationFlag = 1 << 10;\n// Static capabilities survive commits and bailouts. A subtree capability is\n// a durable fact about tree shape, unlike transient work owed by this commit.\nexport const ViewTransitionStaticFlag = 1 << 12;\n// The host resolved this fiber to an out-of-band instance. Placement is fixed\n// for the fiber's lifetime and survives updates without reclassifying props.\nexport const HoistedStaticFlag = 1 << 13;\n\nexport type Flag = number;\n\nexport const MutationMask =\n PlacementFlag | UpdateFlag | HydrationFlag | TextContentFlag | VisibilityFlag;\nexport const HostUpdateMask = UpdateFlag | TextContentFlag;\n\n// These marks never enter subtreeFlags. Host updates are found through the\n// sparse commit index; membership and cache marks are not descendant work.\nconst SubtreeMaskedFlags =\n AssetFlag | CommitIndexedFlag | HostUpdateMask | HoistedStaticFlag;\n// Static facts survive commits and bailouts so adopted and deleted subtrees\n// remain searchable without rebuilding their summaries.\nexport const StaticFlagsMask = ViewTransitionStaticFlag | HoistedStaticFlag;\n\nexport function childSubtreeFlags(node: {\n flags: Flag;\n subtreeFlags: Flag;\n}): Flag {\n return (node.flags & ~SubtreeMaskedFlags) | node.subtreeFlags;\n}\n\nexport function clearTransientFlags(node: {\n flags: Flag;\n subtreeFlags: Flag;\n}): void {\n node.flags &= StaticFlagsMask;\n node.subtreeFlags &= StaticFlagsMask;\n}\n","import { type FigElement, Fragment } from \"@bgub/fig\";\nimport {\n isActivity,\n isAssets,\n isContext,\n isErrorBoundary,\n isSuspense,\n isViewTransition,\n} from \"@bgub/fig/internal\";\n\nexport const RootTag = 0;\nexport const HostTag = 1;\nexport const TextTag = 2;\nexport const FunctionTag = 3;\nexport const FragmentTag = 4;\nexport const ContextProviderTag = 5;\nexport const SuspenseTag = 6;\nexport const ErrorBoundaryTag = 7;\nexport const PortalTag = 8;\nexport const AssetsTag = 9;\nexport const ActivityTag = 10;\nexport const ViewTransitionTag = 11;\nexport const ThenableTag = 12;\n\nexport type Tag =\n | typeof RootTag\n | typeof HostTag\n | typeof TextTag\n | typeof FunctionTag\n | typeof FragmentTag\n | typeof ContextProviderTag\n | typeof SuspenseTag\n | typeof ErrorBoundaryTag\n | typeof PortalTag\n | typeof AssetsTag\n | typeof ActivityTag\n | typeof ViewTransitionTag\n | typeof ThenableTag;\n\nexport function tagFor(element: FigElement): Tag {\n if (typeof element.type === \"string\") return HostTag;\n if (element.type === Fragment) return FragmentTag;\n if (isAssets(element.type)) return AssetsTag;\n if (isContext(element.type)) return ContextProviderTag;\n if (isSuspense(element.type)) return SuspenseTag;\n if (isActivity(element.type)) return ActivityTag;\n if (isErrorBoundary(element.type)) return ErrorBoundaryTag;\n if (isViewTransition(element.type)) return ViewTransitionTag;\n return FunctionTag;\n}\n","import { isThenable, type TransitionOptions } from \"@bgub/fig/internal\";\nimport {\n IdlePriority,\n ImmediatePriority,\n LowPriority,\n NormalPriority,\n type PriorityLevel,\n UserBlockingPriority,\n} from \"./scheduler.ts\";\n\nexport type Lane = number;\nexport type Lanes = number;\nexport type LaneMap<T extends number> = T[];\n\nexport const TotalLanes = 31;\nexport const NoTimestamp = -1;\nexport const NoLane = 0;\nexport const NoLanes = 0;\n\nexport const SyncHydrationLane = 1 << 0;\nexport const SyncLane = 1 << 1;\nexport const InputContinuousHydrationLane = 1 << 2;\nexport const InputContinuousLane = 1 << 3;\nexport const DefaultHydrationLane = 1 << 4;\nexport const DefaultLane = 1 << 5;\nexport const GestureLane = 1 << 6;\nexport const TransitionHydrationLane = 1 << 7;\nexport const TransitionLane1 = 1 << 8;\nexport const TransitionLane2 = 1 << 9;\nexport const TransitionLane3 = 1 << 10;\nexport const TransitionLane4 = 1 << 11;\nexport const TransitionLane5 = 1 << 12;\nexport const TransitionLane6 = 1 << 13;\nexport const TransitionLane7 = 1 << 14;\nexport const TransitionLane8 = 1 << 15;\nexport const TransitionLane9 = 1 << 16;\nexport const TransitionLane10 = 1 << 17;\nexport const TransitionLane11 = 1 << 18;\nexport const TransitionLane12 = 1 << 19;\nexport const TransitionLane13 = 1 << 20;\nexport const TransitionLane14 = 1 << 21;\nexport const RetryLane1 = 1 << 22;\nexport const RetryLane2 = 1 << 23;\nexport const RetryLane3 = 1 << 24;\nexport const RetryLane4 = 1 << 25;\nexport const SelectiveHydrationLane = 1 << 26;\nexport const IdleHydrationLane = 1 << 27;\nexport const IdleLane = 1 << 28;\nexport const OffscreenLane = 1 << 29;\nexport const DeferredLane = 1 << 30;\n\nexport const TransitionLane = TransitionLane1;\n\nexport const TransitionLanes =\n TransitionLane1 |\n TransitionLane2 |\n TransitionLane3 |\n TransitionLane4 |\n TransitionLane5 |\n TransitionLane6 |\n TransitionLane7 |\n TransitionLane8 |\n TransitionLane9 |\n TransitionLane10;\nexport const TransitionDeferredLanes =\n TransitionLane11 | TransitionLane12 | TransitionLane13 | TransitionLane14;\nexport const AllTransitionLanes = TransitionLanes | TransitionDeferredLanes;\nexport const RetryLanes = RetryLane1 | RetryLane2 | RetryLane3 | RetryLane4;\nexport const IdleLanes = IdleHydrationLane | IdleLane | OffscreenLane;\nexport const NonIdleLanes = (1 << 27) - 1;\nexport const HydrationLanes =\n SyncHydrationLane |\n InputContinuousHydrationLane |\n DefaultHydrationLane |\n TransitionHydrationLane |\n SelectiveHydrationLane |\n IdleHydrationLane;\n\nexport type LanePriority =\n | \"sync\"\n | \"input\"\n | \"default\"\n | \"gesture\"\n | \"transition\"\n | \"retry\"\n | \"idle\"\n | \"offscreen\"\n | \"deferred\";\n\nexport interface LaneRoot {\n pendingLanes: Lanes;\n suspendedLanes: Lanes;\n pingedLanes: Lanes;\n expiredLanes: Lanes;\n entangledLanes: Lanes;\n entanglements: LaneMap<Lanes>;\n expirationTimes: LaneMap<number>;\n}\n\nconst syncLaneExpirationMs = 250;\nconst transitionLaneExpirationMs = 5_000;\n\nlet currentUpdateLane: Lane = DefaultLane;\nlet nextTransitionLane: Lane = TransitionLane1;\nlet nextRetryLane: Lane = RetryLane1;\n// JavaScript does not expose per-continuation async context in browsers yet, so\n// async transitions keep their lane ambient while the returned thenable is\n// pending. Explicit event/sync priorities still override this fallback.\nlet asyncTransitionLanes: Lanes = NoLanes;\nconst asyncTransitionLaneCounts = createLaneMap<number>(0);\n\ninterface TransitionTypeHooks {\n retain?(lane: Lane, types: readonly string[] | undefined): () => void;\n record?(root: object, lane: Lane): void;\n complete?(root: object, remainingLanes: Lanes): void;\n}\n\n// The optional View Transition entry installs these hooks. Keeping the state\n// behind that entry leaves ordinary renderer bundles with only the hook calls.\nexport const transitionTypeHooks: TransitionTypeHooks = {};\n\nexport function createLaneMap<T extends number>(initial: T): LaneMap<T> {\n return Array.from({ length: TotalLanes }, () => initial);\n}\n\nexport function mergeLanes(a: Lanes, b: Lanes): Lanes {\n return a | b;\n}\n\nexport function includesSomeLane(set: Lanes, subset: Lanes): boolean {\n return (set & subset) !== NoLanes;\n}\n\nexport function getHighestPriorityLane(lanes: Lanes): Lane {\n return lanes & -lanes;\n}\n\nexport function getHighestPriorityLanes(lanes: Lanes): Lanes {\n const lane = getHighestPriorityLane(lanes);\n\n if (includesSomeLane(AllTransitionLanes, lane)) {\n return lanes & AllTransitionLanes;\n }\n\n if (includesSomeLane(RetryLanes, lane)) {\n return lanes & RetryLanes;\n }\n\n return lane;\n}\n\nexport function getNextLanes(root: LaneRoot, wipLanes: Lanes = NoLanes): Lanes {\n const pending = root.pendingLanes;\n if (pending === NoLanes) return NoLanes;\n\n const unblocked = pending & ~root.suspendedLanes;\n const pinged = pending & root.pingedLanes;\n let next = root.expiredLanes & unblocked;\n if (next === NoLanes) {\n next = getHighestPriorityLanes(unblocked);\n\n if (next === NoLanes) {\n // Expired pinged work wins over fresh pinged work; NoLanes is 0, so the\n // fallback only runs when no expired pinged lane exists.\n const expiredPinged = root.expiredLanes & pinged;\n next =\n expiredPinged !== NoLanes\n ? expiredPinged\n : getHighestPriorityLanes(pinged);\n }\n }\n\n if (next === NoLanes) return NoLanes;\n\n if (\n wipLanes !== NoLanes &&\n wipLanes !== next &&\n !includesSomeLane(root.expiredLanes, wipLanes) &&\n getHighestPriorityLane(next) >= getHighestPriorityLane(wipLanes)\n ) {\n return wipLanes;\n }\n\n return getEntangledLanes(root, next);\n}\n\nexport function getEntangledLanes(root: LaneRoot, lanes: Lanes): Lanes {\n let entangled = lanes;\n let visited = NoLanes;\n let laneSet = entangled & root.entangledLanes;\n\n while (laneSet !== NoLanes) {\n const index = laneToIndex(laneSet);\n const lane = 1 << index;\n entangled |= root.entanglements[index];\n visited |= lane;\n laneSet = entangled & root.entangledLanes & ~visited;\n }\n\n return entangled;\n}\n\nexport function markRootUpdated(root: LaneRoot, lane: Lane): void {\n root.pendingLanes |= lane;\n\n if (lane !== IdleLane) {\n root.suspendedLanes = NoLanes;\n root.pingedLanes = NoLanes;\n }\n}\n\nexport function markRootFinished(root: LaneRoot, remainingLanes: Lanes): void {\n const noLongerPending = root.pendingLanes & ~remainingLanes;\n root.pendingLanes = remainingLanes;\n root.suspendedLanes = NoLanes;\n root.pingedLanes = NoLanes;\n root.expiredLanes &= remainingLanes;\n root.entangledLanes &= remainingLanes;\n\n let lanes = noLongerPending;\n while (lanes !== NoLanes) {\n const index = laneToIndex(lanes);\n const lane = 1 << index;\n root.entanglements[index] = NoLanes;\n root.expirationTimes[index] = NoTimestamp;\n lanes &= ~lane;\n }\n}\n\nexport function markRootSuspended(root: LaneRoot, lanes: Lanes): void {\n root.suspendedLanes |= lanes;\n root.pingedLanes &= ~lanes;\n\n let laneSet = lanes;\n while (laneSet !== NoLanes) {\n const index = laneToIndex(laneSet);\n const lane = 1 << index;\n root.expirationTimes[index] = NoTimestamp;\n laneSet &= ~lane;\n }\n}\n\nexport function markRootPinged(root: LaneRoot, lanes: Lanes): void {\n root.pingedLanes |= root.suspendedLanes & lanes;\n}\n\nexport function markRootEntangled(root: LaneRoot, lanes: Lanes): void {\n root.entangledLanes |= lanes;\n\n let laneSet = lanes;\n while (laneSet !== NoLanes) {\n const index = laneToIndex(laneSet);\n const lane = 1 << index;\n root.entanglements[index] |= lanes;\n laneSet &= ~lane;\n }\n}\n\nexport function markStarvedLanesAsExpired(\n root: LaneRoot,\n currentTime: number,\n): void {\n let lanes = root.pendingLanes & ~RetryLanes;\n\n while (lanes !== NoLanes) {\n const index = laneToIndex(lanes);\n const lane = 1 << index;\n const expiration = root.expirationTimes[index];\n\n if (expiration === NoTimestamp) {\n if (\n !includesSomeLane(root.suspendedLanes, lane) ||\n includesSomeLane(root.pingedLanes, lane)\n ) {\n root.expirationTimes[index] = computeExpirationTime(lane, currentTime);\n }\n } else if (expiration <= currentTime) {\n root.expiredLanes |= lane;\n }\n\n lanes &= ~lane;\n }\n}\n\nexport function claimNextTransitionLane(): Lane {\n const lane = nextTransitionLane;\n nextTransitionLane <<= 1;\n\n if (!includesSomeLane(TransitionLanes, nextTransitionLane)) {\n nextTransitionLane = TransitionLane1;\n }\n\n return lane;\n}\n\nexport function claimNextRetryLane(): Lane {\n const lane = nextRetryLane;\n nextRetryLane <<= 1;\n\n if (!includesSomeLane(RetryLanes, nextRetryLane)) {\n nextRetryLane = RetryLane1;\n }\n\n return lane;\n}\n\nexport function isSyncLane(lane: Lane): boolean {\n return includesSomeLane(SyncHydrationLane | SyncLane, lane);\n}\n\nexport function includesOnlyTransitions(lanes: Lanes): boolean {\n return (lanes & AllTransitionLanes) === lanes;\n}\n\nexport function getLanePriority(lane: Lane): LanePriority {\n if (includesSomeLane(SyncHydrationLane | SyncLane, lane)) return \"sync\";\n if (\n includesSomeLane(InputContinuousHydrationLane | InputContinuousLane, lane)\n ) {\n return \"input\";\n }\n if (\n includesSomeLane(\n DefaultHydrationLane | DefaultLane | SelectiveHydrationLane,\n lane,\n )\n ) {\n return \"default\";\n }\n if (includesSomeLane(GestureLane, lane)) return \"gesture\";\n if (includesSomeLane(AllTransitionLanes | TransitionHydrationLane, lane)) {\n return \"transition\";\n }\n if (includesSomeLane(RetryLanes, lane)) return \"retry\";\n if (includesSomeLane(DeferredLane, lane)) return \"deferred\";\n if (includesSomeLane(OffscreenLane, lane)) return \"offscreen\";\n return \"idle\";\n}\n\n// Mask checks directly instead of via getLanePriority's string names, so the\n// name table stays out of production bundles (getLanePriority survives for\n// tests and diagnostics only). `lane` is a single bit (highest-priority\n// lane), so merging the groups is exact.\nexport function getLaneSchedulerPriority(lane: Lane): PriorityLevel {\n if (includesSomeLane(SyncHydrationLane | SyncLane, lane)) {\n return ImmediatePriority;\n }\n if (\n includesSomeLane(\n InputContinuousHydrationLane | InputContinuousLane | GestureLane,\n lane,\n )\n ) {\n return UserBlockingPriority;\n }\n // SelectiveHydrationLane is non-idle work (event-triggered hydration of a\n // dehydrated boundary): schedule it at Normal like React, or it starves\n // behind every transition and never gets a scheduler timeout.\n if (\n includesSomeLane(\n DefaultHydrationLane |\n DefaultLane |\n AllTransitionLanes |\n TransitionHydrationLane |\n SelectiveHydrationLane,\n lane,\n )\n ) {\n return NormalPriority;\n }\n if (includesSomeLane(RetryLanes, lane)) return LowPriority;\n return IdlePriority;\n}\n\nexport function requestUpdateLane(): Lane {\n if (currentUpdateLane === DefaultLane && asyncTransitionLanes !== NoLanes) {\n return getHighestPriorityLane(asyncTransitionLanes);\n }\n\n return currentUpdateLane;\n}\n\nexport function runWithPriority<T>(lane: Lane, callback: () => T): T {\n const previousLane = currentUpdateLane;\n currentUpdateLane = lane;\n\n try {\n return callback();\n } finally {\n currentUpdateLane = previousLane;\n }\n}\n\nexport function runWithTransition<T>(\n callback: () => T,\n options?: TransitionOptions,\n): T {\n const lane = includesSomeLane(AllTransitionLanes, currentUpdateLane)\n ? currentUpdateLane\n : claimNextTransitionLane();\n\n return runWithTransitionLane(lane, callback, options);\n}\n\nexport function runWithTransitionLane<T>(\n lane: Lane,\n callback: () => T,\n options?: TransitionOptions,\n): T {\n const releaseTransition = transitionTypeHooks.retain?.(lane, options?.types);\n let result: T;\n try {\n result = runWithPriority(lane, callback);\n } catch (error) {\n releaseTransition?.();\n throw error;\n }\n\n if (isThenable(result)) {\n const releaseAsyncLane = trackAsyncTransitionLane(lane);\n let released = false;\n const release = (): void => {\n if (released) return;\n released = true;\n releaseAsyncLane();\n releaseTransition?.();\n };\n result.then(release, release);\n } else {\n releaseTransition?.();\n }\n\n return result;\n}\n\nfunction trackAsyncTransitionLane(lane: Lane): () => void {\n const index = laneToIndex(lane);\n asyncTransitionLaneCounts[index] += 1;\n asyncTransitionLanes |= lane;\n\n return () => releaseAsyncTransitionLane(lane, index);\n}\n\nfunction releaseAsyncTransitionLane(lane: Lane, index: number): void {\n asyncTransitionLaneCounts[index] = Math.max(\n 0,\n asyncTransitionLaneCounts[index] - 1,\n );\n\n if (asyncTransitionLaneCounts[index] === 0) {\n asyncTransitionLanes &= ~lane;\n }\n}\n\nfunction computeExpirationTime(lane: Lane, currentTime: number): number {\n if (\n includesSomeLane(\n SyncHydrationLane |\n SyncLane |\n InputContinuousHydrationLane |\n InputContinuousLane |\n GestureLane,\n lane,\n )\n ) {\n return currentTime + syncLaneExpirationMs;\n }\n\n if (\n includesSomeLane(\n DefaultHydrationLane |\n DefaultLane |\n TransitionHydrationLane |\n AllTransitionLanes,\n lane,\n )\n ) {\n return currentTime + transitionLaneExpirationMs;\n }\n\n return NoTimestamp;\n}\n\nexport function laneToIndex(lanes: Lanes): number {\n return 31 - Math.clz32(lanes);\n}\n","interface TreeNode<Node> {\n child: Node | null;\n sibling: Node | null;\n}\n\nexport function walkFiberForest<Node extends TreeNode<Node>>(\n node: Node | null,\n visitor: (node: Node) => boolean | void,\n): void {\n walkFiberTree(node, true, visitor);\n}\n\nexport function walkFiberSubtree<Node extends TreeNode<Node>>(\n node: Node,\n visitor: (node: Node) => boolean | void,\n): void {\n walkFiberTree(node, false, visitor);\n}\n\n// The explicit sibling stack bounds a subtree walk even when a detached\n// deletion still points at kept siblings through its old fiber links.\nfunction walkFiberTree<Node extends TreeNode<Node>>(\n node: Node | null,\n includeRootSiblings: boolean,\n visitor: (node: Node) => boolean | void,\n): void {\n const stack: Node[] = [];\n let cursor = node;\n\n while (cursor !== null) {\n const shouldDescend = visitor(cursor) !== false && cursor.child !== null;\n\n if ((includeRootSiblings || cursor !== node) && cursor.sibling !== null) {\n stack.push(cursor.sibling);\n }\n\n cursor = shouldDescend ? cursor.child : (stack.pop() ?? null);\n }\n}\n"],"mappings":";;;AAYA,MAAa,uBAAuB;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