|
| 1 | +/* **************** */ |
| 2 | +/* Fiber Module Exports */ |
| 3 | +/* **************** */ |
| 4 | + |
| 5 | +// Types |
| 6 | +export { |
| 7 | + // WorkTag |
| 8 | + WorkTag, |
| 9 | + type WorkTag as WorkTagType, |
| 10 | + // Branded types |
| 11 | + type Lane, |
| 12 | + type Lanes, |
| 13 | + type Flags, |
| 14 | + createLane, |
| 15 | + createLanes, |
| 16 | + createFlags, |
| 17 | + // Lane constants |
| 18 | + NoLane, |
| 19 | + NoLanes, |
| 20 | + SyncLane, |
| 21 | + InputContinuousLane, |
| 22 | + DefaultLane, |
| 23 | + TransitionLane1, |
| 24 | + TransitionLane2, |
| 25 | + IdleLane, |
| 26 | + OffscreenLane, |
| 27 | + // Flag constants |
| 28 | + NoFlags, |
| 29 | + PerformedWork, |
| 30 | + Placement, |
| 31 | + Update as UpdateFlag, |
| 32 | + ChildDeletion, |
| 33 | + ContentReset, |
| 34 | + Callback, |
| 35 | + DidCapture, |
| 36 | + ForceClientRender, |
| 37 | + Ref, |
| 38 | + Snapshot, |
| 39 | + Passive, |
| 40 | + Hydrating, |
| 41 | + Visibility, |
| 42 | + StoreConsistency, |
| 43 | + PlacementAndUpdate, |
| 44 | + Deletion, |
| 45 | + MutationMask, |
| 46 | + LayoutMask, |
| 47 | + PassiveMask, |
| 48 | + // Hook effect tags |
| 49 | + HookEffectTag, |
| 50 | + type HookEffectTag as HookEffectTagType, |
| 51 | + // Core types |
| 52 | + type Effect, |
| 53 | + type Hook, |
| 54 | + type Update, |
| 55 | + type UpdateQueue, |
| 56 | + type Fiber, |
| 57 | + type FiberRoot, |
| 58 | + type PortalStateNode, |
| 59 | + type RefObject, |
| 60 | + type RefCallback, |
| 61 | + type ContextDependency, |
| 62 | + type Dependencies, |
| 63 | + type UpdateQueueType, |
| 64 | + type SharedQueue, |
| 65 | + // Root tag |
| 66 | + RootTag, |
| 67 | + type RootTag as RootTagType, |
| 68 | + // Utility types |
| 69 | + type FiberOfTag, |
| 70 | + type FiberPropsFor, |
| 71 | + type StateNodeFor, |
| 72 | + type MiniReactContext, |
| 73 | + // Type guards |
| 74 | + isHostFiber, |
| 75 | + isFunctionComponent, |
| 76 | + isHostRoot, |
| 77 | + isPortal, |
| 78 | +} from "./types"; |
| 79 | + |
| 80 | +// Fiber creation |
| 81 | +export { |
| 82 | + createFiber, |
| 83 | + createFiberFromElement, |
| 84 | + createFiberFromText, |
| 85 | + createFiberFromFragment, |
| 86 | + createFiberFromPortal, |
| 87 | + createHostRootFiber, |
| 88 | + createFiberRoot, |
| 89 | + createWorkInProgress, |
| 90 | + resetWorkInProgress, |
| 91 | + isTextElement, |
| 92 | + isPortalElement, |
| 93 | + isFragmentElement, |
| 94 | + getElementKey, |
| 95 | + isSameElementType, |
| 96 | + cloneFiber, |
| 97 | +} from "./createFiber"; |
| 98 | + |
| 99 | +// Child reconciliation |
| 100 | +export { |
| 101 | + createChildReconciler, |
| 102 | + reconcileChildFibers, |
| 103 | + mountChildFibers, |
| 104 | +} from "./childReconciler"; |
| 105 | + |
| 106 | +// Fiber utilities |
| 107 | +export { |
| 108 | + // Tree traversal |
| 109 | + getNextFiber, |
| 110 | + completeUnitOfWork, |
| 111 | + // Host parent/sibling finding |
| 112 | + findHostParent, |
| 113 | + getHostParentNode, |
| 114 | + findHostSibling, |
| 115 | + // State helpers |
| 116 | + getStateNode, |
| 117 | + getFirstHostChild, |
| 118 | + collectHostChildren, |
| 119 | + // Root finding |
| 120 | + findFiberRoot, |
| 121 | + findPortalContainer, |
| 122 | + // Debug utilities |
| 123 | + getFiberDebugName, |
| 124 | + printFiberTree, |
| 125 | +} from "./fiberUtils"; |
| 126 | + |
| 127 | +// Effect list |
| 128 | +export { |
| 129 | + type FunctionComponentUpdateQueue, |
| 130 | + type CollectedEffects, |
| 131 | + type EffectInstance, |
| 132 | + createEffect, |
| 133 | + createEffectToFiber, |
| 134 | + collectEffects, |
| 135 | + runPassiveEffectCleanups, |
| 136 | + runPassiveEffectCreates, |
| 137 | + runLayoutEffectCleanups, |
| 138 | + runLayoutEffectCreates, |
| 139 | + areHookInputsEqual, |
| 140 | + collectDeletionEffects, |
| 141 | + markFiberWithPassiveEffect, |
| 142 | + doesFiberHavePassiveEffects, |
| 143 | + schedulePassiveEffects, |
| 144 | + flushPassiveEffects, |
| 145 | +} from "./effectList"; |
| 146 | + |
| 147 | +// Commit work |
| 148 | +export { |
| 149 | + commitPlacement, |
| 150 | + commitUpdate, |
| 151 | + commitDeletion, |
| 152 | + commitAttachRef, |
| 153 | + commitDetachRef, |
| 154 | + createInstance, |
| 155 | + createTextInstance, |
| 156 | + appendChild, |
| 157 | + appendChildToContainer, |
| 158 | + insertBefore, |
| 159 | + removeChild, |
| 160 | + finalizeInitialChildren, |
| 161 | + prepareUpdate, |
| 162 | +} from "./commitWork"; |
| 163 | + |
| 164 | +// Commit root |
| 165 | +export { |
| 166 | + commitRoot, |
| 167 | + flushLayoutEffects, |
| 168 | + commitUnmountEffects, |
| 169 | + prepareForCommit, |
| 170 | + resetAfterCommit, |
| 171 | + commitDeletions, |
| 172 | +} from "./commitRoot"; |
| 173 | + |
| 174 | +// Work in progress tree |
| 175 | +export { |
| 176 | + getWorkInProgress, |
| 177 | + setWorkInProgress, |
| 178 | + getWorkInProgressRoot, |
| 179 | + setWorkInProgressRoot, |
| 180 | + getWorkInProgressRootRenderLanes, |
| 181 | + setWorkInProgressRootRenderLanes, |
| 182 | + prepareFreshStack, |
| 183 | + createWorkInProgressFiber, |
| 184 | + resetWorkInProgressFiber, |
| 185 | + cloneChildFibers, |
| 186 | + finishConcurrentRender, |
| 187 | + commitTreeSwap, |
| 188 | + checkIfWorkInProgressReceivedUpdate, |
| 189 | + markWorkInProgressReceivedUpdate, |
| 190 | + resetDidReceiveUpdate, |
| 191 | + getDidReceiveUpdate, |
| 192 | + getWorkInProgressDebugInfo, |
| 193 | +} from "./workInProgress"; |
| 194 | + |
| 195 | +// Begin work |
| 196 | +export { beginWork } from "./beginWork"; |
| 197 | + |
| 198 | +// Complete work |
| 199 | +export { |
| 200 | + completeWork, |
| 201 | + resetCompleteWork, |
| 202 | + unwindWork, |
| 203 | + unwindInterruptedWork, |
| 204 | +} from "./completeWork"; |
| 205 | + |
| 206 | +// Work loop |
| 207 | +export { |
| 208 | + scheduleUpdateOnFiber, |
| 209 | + performSyncWorkOnRoot, |
| 210 | + createRoot, |
| 211 | + updateContainer, |
| 212 | + flushSync, |
| 213 | + flushPassiveEffectsImpl, |
| 214 | + isRendering, |
| 215 | + isCommitting, |
| 216 | + handleError, |
| 217 | +} from "./workLoop"; |
| 218 | + |
| 219 | +// Scheduler |
| 220 | +export { |
| 221 | + Priority, |
| 222 | + type Priority as PriorityType, |
| 223 | + getCurrentTime, |
| 224 | + shouldYield, |
| 225 | + shouldYieldForPriority, |
| 226 | + scheduleCallback, |
| 227 | + cancelCallback, |
| 228 | + getCurrentPriorityLevel, |
| 229 | + runWithPriority, |
| 230 | + lanesToSchedulerPriority, |
| 231 | + schedulerPriorityToLane, |
| 232 | + setWorkInProgressConcurrent, |
| 233 | + isWorkInProgressConcurrent, |
| 234 | + requestEventTime, |
| 235 | + requestUpdateLane, |
| 236 | + scheduleIdleCallback, |
| 237 | + cancelIdleCallback, |
| 238 | + flushWork, |
| 239 | +} from "./scheduler"; |
| 240 | + |
| 241 | +// Lanes (priority system) |
| 242 | +export { |
| 243 | + NonIdleLanes, |
| 244 | + TransitionLanes, |
| 245 | + UpdateLanes, |
| 246 | + mergeLanes, |
| 247 | + removeLanes, |
| 248 | + intersectLanes, |
| 249 | + includesLane, |
| 250 | + includesAnyLanes, |
| 251 | + includesOnlyNonUrgentLanes, |
| 252 | + includesBlockingLane, |
| 253 | + isLaneEmpty, |
| 254 | + getHighestPriorityLane, |
| 255 | + getHighestPriorityLanes, |
| 256 | + isSubsetOfLanes, |
| 257 | + getLanePriority, |
| 258 | + getLanesLabel, |
| 259 | + getNextLanes, |
| 260 | + markRootUpdated, |
| 261 | + markRootFinished, |
| 262 | + markRootSuspended, |
| 263 | + markRootPinged, |
| 264 | + markRootExpired, |
| 265 | + scheduleUpdateOnFiber as scheduleLaneUpdateOnFiber, |
| 266 | + fiberHasWork, |
| 267 | + fiberSubtreeHasWork, |
| 268 | + resetFiberLanes, |
| 269 | + requestEventTime as requestLaneEventTime, |
| 270 | + setCurrentEventTime, |
| 271 | + clearCurrentEventTime, |
| 272 | + requestUpdateLane as requestLaneUpdate, |
| 273 | + claimNextTransitionLane, |
| 274 | + entangleLanes, |
| 275 | + getEntangledLanes, |
| 276 | + addEntangledLanes, |
| 277 | + formatLanes, |
| 278 | + logLanes, |
| 279 | +} from "./lanes"; |
| 280 | + |
| 281 | +// Fiber hooks |
| 282 | +export { |
| 283 | + renderWithHooks, |
| 284 | + useStateFiber, |
| 285 | + useReducerFiber, |
| 286 | + useEffectFiber, |
| 287 | + useLayoutEffectFiber, |
| 288 | + useRefFiber, |
| 289 | + useMemoFiber, |
| 290 | + useCallbackFiber, |
| 291 | + useContextFiber, |
| 292 | + getCurrentlyRenderingFiber, |
| 293 | + isRenderingHooks, |
| 294 | +} from "./fiberHooks"; |
| 295 | + |
| 296 | +// Resumability (serialization/deserialization) |
| 297 | +export { |
| 298 | + type SerializedFiber, |
| 299 | + type SerializedFiberRoot, |
| 300 | + serializeFiberTree, |
| 301 | + dehydrateRoot, |
| 302 | + parseSerializedRoot, |
| 303 | + extractComponentState, |
| 304 | + createFiberFromSerialized, |
| 305 | +} from "./resumability"; |
| 306 | + |
| 307 | +// Hydration (SSR) |
| 308 | +export { |
| 309 | + type HydrateRootOptions, |
| 310 | + hydrateRoot, |
| 311 | + enterHydrationState, |
| 312 | + exitHydrationState, |
| 313 | + getIsHydrating, |
| 314 | + tryToClaimNextHydratableInstance, |
| 315 | + tryToClaimNextHydratableTextInstance, |
| 316 | + prepareToHydrateHostInstance, |
| 317 | + popHydrationState, |
| 318 | + getRestoredState, |
| 319 | +} from "./hydration"; |
| 320 | + |
| 321 | +// Type Guards and Assertions |
| 322 | +export { |
| 323 | + // Fiber tag type guards |
| 324 | + isHostComponentFiber, |
| 325 | + isHostTextFiber, |
| 326 | + isHostRootFiber, |
| 327 | + isHostPortalFiber, |
| 328 | + isFunctionComponentFiber, |
| 329 | + isMemoComponentFiber, |
| 330 | + isFragmentFiber, |
| 331 | + isContextProviderFiber, |
| 332 | + isContextConsumerFiber, |
| 333 | + // Narrowed fiber types |
| 334 | + type HostComponentFiber, |
| 335 | + type HostTextFiber, |
| 336 | + type HostRootFiber, |
| 337 | + type HostPortalFiber, |
| 338 | + // StateNode assertions (use asserts syntax for type narrowing) |
| 339 | + assertHostComponentFiber, |
| 340 | + assertHostTextFiber, |
| 341 | + assertHostRootFiber, |
| 342 | + assertHostPortalFiber, |
| 343 | + getHostStateNode, |
| 344 | + assertHostFiber, |
| 345 | + // MemoizedState helpers |
| 346 | + isHookState, |
| 347 | + isEffectState, |
| 348 | + assertHookState, |
| 349 | + getMemoizedState, |
| 350 | + assertMemoizedState, |
| 351 | + // Props helpers |
| 352 | + type TextProps, |
| 353 | + isTextProps, |
| 354 | + getPropsAsRecord, |
| 355 | + assertPropsAsRecord, |
| 356 | + assertTextProps, |
| 357 | + // Update queue helpers |
| 358 | + isUpdateQueue, |
| 359 | + assertUpdateQueue, |
| 360 | + // Branded type helpers |
| 361 | + mergeLanesUnsafe, |
| 362 | + intersectLanesUnsafe, |
| 363 | + removeLanesUnsafe, |
| 364 | + lanesIncludeLane, |
| 365 | + isLanesEmpty, |
| 366 | + flagsInclude, |
| 367 | + mergeFlags, |
| 368 | + isFlagsEmpty, |
| 369 | + // DOM type guards |
| 370 | + isElement, |
| 371 | + isTextNode, |
| 372 | + isHTMLElement, |
| 373 | + isHTMLInputElement, |
| 374 | + assertElement, |
| 375 | + assertTextNode, |
| 376 | + // FiberRoot helpers |
| 377 | + isFiberRoot, |
| 378 | + assertFiberRoot, |
| 379 | + // Fiber navigation helpers |
| 380 | + hasFiberParent, |
| 381 | + hasFiberChild, |
| 382 | + hasFiberSibling, |
| 383 | + hasFiberAlternate, |
| 384 | + assertFiberParent, |
| 385 | + // Property access helpers |
| 386 | + setDynamicProperty, |
| 387 | + getDynamicProperty, |
| 388 | + // Component type guards |
| 389 | + type MemoComponent, |
| 390 | + isMemoComponent, |
| 391 | + isFunctionType, |
| 392 | +} from "./typeGuards"; |
0 commit comments