+55
-19
@@ -60,3 +60,5 @@ 'use strict'; | ||
| registry: undefined, | ||
| done: false | ||
| done: false, | ||
| isHydrationInProgress, | ||
| onHydrationEnd | ||
| }; | ||
@@ -81,2 +83,13 @@ function hydrationGetNextContextId() { | ||
| } | ||
| function isHydrationInProgress() { | ||
| return !_hydrationDone && (sharedConfig.hydrating || _pendingBoundaries > 0); | ||
| } | ||
| function onHydrationEnd(callback) { | ||
| if (_hydrationDone || !sharedConfig.hydrating && _pendingBoundaries === 0) { | ||
| queueMicrotask(callback); | ||
| return; | ||
| } | ||
| if (!_hydrationEndCallbacks) _hydrationEndCallbacks = []; | ||
| _hydrationEndCallbacks.push(callback); | ||
| } | ||
| function drainHydrationCallbacks() { | ||
@@ -99,3 +112,3 @@ if (_hydrationDone) return; | ||
| function checkHydrationComplete() { | ||
| if (_pendingBoundaries === 0) drainHydrationCallbacks(); | ||
| if (!_hydratingValue && _pendingBoundaries === 0) drainHydrationCallbacks(); | ||
| } | ||
@@ -589,3 +602,2 @@ let _hydratingValue = false; | ||
| _doneValue = false; | ||
| _pendingBoundaries = 0; | ||
| signals.setSnapshotCapture(true); | ||
@@ -637,4 +649,5 @@ _snapshotRootOwner = null; | ||
| } | ||
| function resumeBoundaryHydration(o, id, set, shouldHydrate = true) { | ||
| _pendingBoundaries--; | ||
| function resumeBoundaryHydration(o, id, set, release, shouldHydrate = true) { | ||
| const scope = sharedConfig.boundaryScopes?.get(id); | ||
| if (!release()) return; | ||
| if (signals.isDisposed(o)) { | ||
@@ -644,14 +657,27 @@ checkHydrationComplete(); | ||
| } | ||
| if (shouldHydrate) sharedConfig.gather?.(id); | ||
| _hydratingValue = shouldHydrate; | ||
| if (shouldHydrate) { | ||
| signals.markSnapshotScope(o); | ||
| _snapshotRootOwner = o; | ||
| const prevRegistry = sharedConfig.registry; | ||
| const prevGather = sharedConfig.gather; | ||
| if (scope) { | ||
| sharedConfig.registry = scope.registry; | ||
| sharedConfig.gather = scope.gather; | ||
| } | ||
| set(); | ||
| signals.flush(); | ||
| if (shouldHydrate) _snapshotRootOwner = null; | ||
| _hydratingValue = false; | ||
| if (shouldHydrate) signals.releaseSnapshotScope(o); | ||
| signals.flush(); | ||
| try { | ||
| if (shouldHydrate) sharedConfig.gather?.(id); | ||
| _hydratingValue = shouldHydrate; | ||
| if (shouldHydrate) { | ||
| signals.markSnapshotScope(o); | ||
| _snapshotRootOwner = o; | ||
| } | ||
| set(); | ||
| signals.flush(); | ||
| if (shouldHydrate) _snapshotRootOwner = null; | ||
| _hydratingValue = false; | ||
| if (shouldHydrate) signals.releaseSnapshotScope(o); | ||
| signals.flush(); | ||
| } finally { | ||
| if (scope) { | ||
| sharedConfig.registry = prevRegistry; | ||
| sharedConfig.gather = prevGather; | ||
| } | ||
| } | ||
| checkHydrationComplete(); | ||
@@ -661,8 +687,18 @@ } | ||
| _pendingBoundaries++; | ||
| sharedConfig.captureBoundaryScope?.(id); | ||
| let released = false; | ||
| const release = () => { | ||
| if (released) return false; | ||
| released = true; | ||
| _pendingBoundaries--; | ||
| sharedConfig.boundaryScopes?.delete(id); | ||
| return true; | ||
| }; | ||
| signals.onCleanup(() => { | ||
| if (!signals.isDisposed(o)) return; | ||
| sharedConfig.cleanupFragment?.(id); | ||
| if (release()) checkHydrationComplete(); | ||
| }); | ||
| const set = createBoundaryTrigger(); | ||
| return [set, shouldHydrate => resumeBoundaryHydration(o, id, set, shouldHydrate)]; | ||
| return [set, shouldHydrate => resumeBoundaryHydration(o, id, set, release, shouldHydrate), release]; | ||
| } | ||
@@ -735,3 +771,3 @@ function waitAndResume(p, resume, assetPromise, hydrateRejected = true) { | ||
| if (p) { | ||
| const [set, resume] = initBoundaryResume(o, id); | ||
| const [set, resume, release] = initBoundaryResume(o, id); | ||
| if (p !== "$$f") { | ||
@@ -741,3 +777,3 @@ waitAndResume(p, resume, assetPromise); | ||
| const afterAssets = () => { | ||
| _pendingBoundaries--; | ||
| if (!release()) return; | ||
| set(); | ||
@@ -744,0 +780,0 @@ checkHydrationComplete(); |
+55
-19
@@ -59,3 +59,5 @@ import { getContext, createMemo as createMemo$1, flatten, createRoot, setContext, getOwner, untrack, createOwner, runWithOwner, createEffect as createEffect$1, createErrorBoundary as createErrorBoundary$1, createLoadingBoundary as createLoadingBoundary$1, createOptimistic as createOptimistic$1, createOptimisticStore as createOptimisticStore$1, createProjection as createProjection$1, createRenderEffect as createRenderEffect$1, createRevealOrder as createRevealOrder$1, createSignal as createSignal$1, createStore as createStore$1, setSnapshotCapture, releaseSnapshotScope, peekNextChildId, getNextChildId, clearSnapshots, flush, markSnapshotScope, onCleanup, isDisposed, mapArray, repeat, DEV as DEV$1 } from '@solidjs/signals'; | ||
| registry: undefined, | ||
| done: false | ||
| done: false, | ||
| isHydrationInProgress, | ||
| onHydrationEnd | ||
| }; | ||
@@ -80,2 +82,13 @@ function hydrationGetNextContextId() { | ||
| } | ||
| function isHydrationInProgress() { | ||
| return !_hydrationDone && (sharedConfig.hydrating || _pendingBoundaries > 0); | ||
| } | ||
| function onHydrationEnd(callback) { | ||
| if (_hydrationDone || !sharedConfig.hydrating && _pendingBoundaries === 0) { | ||
| queueMicrotask(callback); | ||
| return; | ||
| } | ||
| if (!_hydrationEndCallbacks) _hydrationEndCallbacks = []; | ||
| _hydrationEndCallbacks.push(callback); | ||
| } | ||
| function drainHydrationCallbacks() { | ||
@@ -98,3 +111,3 @@ if (_hydrationDone) return; | ||
| function checkHydrationComplete() { | ||
| if (_pendingBoundaries === 0) drainHydrationCallbacks(); | ||
| if (!_hydratingValue && _pendingBoundaries === 0) drainHydrationCallbacks(); | ||
| } | ||
@@ -588,3 +601,2 @@ let _hydratingValue = false; | ||
| _doneValue = false; | ||
| _pendingBoundaries = 0; | ||
| setSnapshotCapture(true); | ||
@@ -636,4 +648,5 @@ _snapshotRootOwner = null; | ||
| } | ||
| function resumeBoundaryHydration(o, id, set, shouldHydrate = true) { | ||
| _pendingBoundaries--; | ||
| function resumeBoundaryHydration(o, id, set, release, shouldHydrate = true) { | ||
| const scope = sharedConfig.boundaryScopes?.get(id); | ||
| if (!release()) return; | ||
| if (isDisposed(o)) { | ||
@@ -643,14 +656,27 @@ checkHydrationComplete(); | ||
| } | ||
| if (shouldHydrate) sharedConfig.gather?.(id); | ||
| _hydratingValue = shouldHydrate; | ||
| if (shouldHydrate) { | ||
| markSnapshotScope(o); | ||
| _snapshotRootOwner = o; | ||
| const prevRegistry = sharedConfig.registry; | ||
| const prevGather = sharedConfig.gather; | ||
| if (scope) { | ||
| sharedConfig.registry = scope.registry; | ||
| sharedConfig.gather = scope.gather; | ||
| } | ||
| set(); | ||
| flush(); | ||
| if (shouldHydrate) _snapshotRootOwner = null; | ||
| _hydratingValue = false; | ||
| if (shouldHydrate) releaseSnapshotScope(o); | ||
| flush(); | ||
| try { | ||
| if (shouldHydrate) sharedConfig.gather?.(id); | ||
| _hydratingValue = shouldHydrate; | ||
| if (shouldHydrate) { | ||
| markSnapshotScope(o); | ||
| _snapshotRootOwner = o; | ||
| } | ||
| set(); | ||
| flush(); | ||
| if (shouldHydrate) _snapshotRootOwner = null; | ||
| _hydratingValue = false; | ||
| if (shouldHydrate) releaseSnapshotScope(o); | ||
| flush(); | ||
| } finally { | ||
| if (scope) { | ||
| sharedConfig.registry = prevRegistry; | ||
| sharedConfig.gather = prevGather; | ||
| } | ||
| } | ||
| checkHydrationComplete(); | ||
@@ -660,8 +686,18 @@ } | ||
| _pendingBoundaries++; | ||
| sharedConfig.captureBoundaryScope?.(id); | ||
| let released = false; | ||
| const release = () => { | ||
| if (released) return false; | ||
| released = true; | ||
| _pendingBoundaries--; | ||
| sharedConfig.boundaryScopes?.delete(id); | ||
| return true; | ||
| }; | ||
| onCleanup(() => { | ||
| if (!isDisposed(o)) return; | ||
| sharedConfig.cleanupFragment?.(id); | ||
| if (release()) checkHydrationComplete(); | ||
| }); | ||
| const set = createBoundaryTrigger(); | ||
| return [set, shouldHydrate => resumeBoundaryHydration(o, id, set, shouldHydrate)]; | ||
| return [set, shouldHydrate => resumeBoundaryHydration(o, id, set, release, shouldHydrate), release]; | ||
| } | ||
@@ -734,3 +770,3 @@ function waitAndResume(p, resume, assetPromise, hydrateRejected = true) { | ||
| if (p) { | ||
| const [set, resume] = initBoundaryResume(o, id); | ||
| const [set, resume, release] = initBoundaryResume(o, id); | ||
| if (p !== "$$f") { | ||
@@ -740,3 +776,3 @@ waitAndResume(p, resume, assetPromise); | ||
| const afterAssets = () => { | ||
| _pendingBoundaries--; | ||
| if (!release()) return; | ||
| set(); | ||
@@ -743,0 +779,0 @@ checkHydrationComplete(); |
+22
-7
@@ -92,6 +92,10 @@ 'use strict'; | ||
| let current = component; | ||
| const [comp, setComp] = solidJs.createSignal(() => current); | ||
| const [comp, setComp] = solidJs.createSignal({ | ||
| current | ||
| }); | ||
| const update = action => { | ||
| current = action(); | ||
| setComp(() => current); | ||
| setComp({ | ||
| current | ||
| }); | ||
| }; | ||
@@ -101,3 +105,3 @@ const instances = { | ||
| }; | ||
| const proxy = createProxy(comp, id, instances, options.location); | ||
| const proxy = createProxy(() => comp().current, id, instances, options.location); | ||
| registry.components.set(id, { | ||
@@ -158,2 +162,5 @@ id, | ||
| } | ||
| function runAfterHydration(fn) { | ||
| if (solidJs.sharedConfig.isHydrationInProgress?.()) solidJs.sharedConfig.onHydrationEnd(fn);else fn(); | ||
| } | ||
| const SOLID_REFRESH = "solid-refresh"; | ||
@@ -249,5 +256,11 @@ const SOLID_REFRESH_PREV = "solid-refresh-prev"; | ||
| hot.accept(mod => { | ||
| if (mod == null || patchRegistry(hot.data[SOLID_REFRESH], hot.data[SOLID_REFRESH_PREV])) { | ||
| if (mod == null) { | ||
| hot.invalidate(); | ||
| return; | ||
| } | ||
| runAfterHydration(() => { | ||
| if (patchRegistry(hot.data[SOLID_REFRESH], hot.data[SOLID_REFRESH_PREV])) { | ||
| hot.invalidate(); | ||
| } | ||
| }); | ||
| }); | ||
@@ -264,5 +277,7 @@ } else { | ||
| if (current && current[SOLID_REFRESH]) { | ||
| if (patchRegistry(current[SOLID_REFRESH], registry)) { | ||
| $$decline(type, hot, true); | ||
| } | ||
| runAfterHydration(() => { | ||
| if (patchRegistry(current[SOLID_REFRESH], registry)) { | ||
| $$decline(type, hot, true); | ||
| } | ||
| }); | ||
| } | ||
@@ -269,0 +284,0 @@ hot.dispose(data => { |
+23
-8
@@ -1,2 +0,2 @@ | ||
| import { createSignal, untrack, getOwner, onCleanup, $DEVCOMP, createMemo, DEV } from 'solid-js'; | ||
| import { createSignal, untrack, getOwner, onCleanup, $DEVCOMP, createMemo, DEV, sharedConfig } from 'solid-js'; | ||
@@ -90,6 +90,10 @@ function setComponentProperty(component, key, value) { | ||
| let current = component; | ||
| const [comp, setComp] = createSignal(() => current); | ||
| const [comp, setComp] = createSignal({ | ||
| current | ||
| }); | ||
| const update = action => { | ||
| current = action(); | ||
| setComp(() => current); | ||
| setComp({ | ||
| current | ||
| }); | ||
| }; | ||
@@ -99,3 +103,3 @@ const instances = { | ||
| }; | ||
| const proxy = createProxy(comp, id, instances, options.location); | ||
| const proxy = createProxy(() => comp().current, id, instances, options.location); | ||
| registry.components.set(id, { | ||
@@ -156,2 +160,5 @@ id, | ||
| } | ||
| function runAfterHydration(fn) { | ||
| if (sharedConfig.isHydrationInProgress?.()) sharedConfig.onHydrationEnd(fn);else fn(); | ||
| } | ||
| const SOLID_REFRESH = "solid-refresh"; | ||
@@ -247,5 +254,11 @@ const SOLID_REFRESH_PREV = "solid-refresh-prev"; | ||
| hot.accept(mod => { | ||
| if (mod == null || patchRegistry(hot.data[SOLID_REFRESH], hot.data[SOLID_REFRESH_PREV])) { | ||
| if (mod == null) { | ||
| hot.invalidate(); | ||
| return; | ||
| } | ||
| runAfterHydration(() => { | ||
| if (patchRegistry(hot.data[SOLID_REFRESH], hot.data[SOLID_REFRESH_PREV])) { | ||
| hot.invalidate(); | ||
| } | ||
| }); | ||
| }); | ||
@@ -262,5 +275,7 @@ } else { | ||
| if (current && current[SOLID_REFRESH]) { | ||
| if (patchRegistry(current[SOLID_REFRESH], registry)) { | ||
| $$decline(type, hot, true); | ||
| } | ||
| runAfterHydration(() => { | ||
| if (patchRegistry(current[SOLID_REFRESH], registry)) { | ||
| $$decline(type, hot, true); | ||
| } | ||
| }); | ||
| } | ||
@@ -267,0 +282,0 @@ hot.dispose(data => { |
+55
-19
@@ -44,3 +44,5 @@ 'use strict'; | ||
| registry: undefined, | ||
| done: false | ||
| done: false, | ||
| isHydrationInProgress, | ||
| onHydrationEnd | ||
| }; | ||
@@ -65,2 +67,13 @@ function hydrationGetNextContextId() { | ||
| } | ||
| function isHydrationInProgress() { | ||
| return !_hydrationDone && (sharedConfig.hydrating || _pendingBoundaries > 0); | ||
| } | ||
| function onHydrationEnd(callback) { | ||
| if (_hydrationDone || !sharedConfig.hydrating && _pendingBoundaries === 0) { | ||
| queueMicrotask(callback); | ||
| return; | ||
| } | ||
| if (!_hydrationEndCallbacks) _hydrationEndCallbacks = []; | ||
| _hydrationEndCallbacks.push(callback); | ||
| } | ||
| function drainHydrationCallbacks() { | ||
@@ -82,3 +95,3 @@ if (_hydrationDone) return; | ||
| function checkHydrationComplete() { | ||
| if (_pendingBoundaries === 0) drainHydrationCallbacks(); | ||
| if (!_hydratingValue && _pendingBoundaries === 0) drainHydrationCallbacks(); | ||
| } | ||
@@ -572,3 +585,2 @@ let _hydratingValue = false; | ||
| _doneValue = false; | ||
| _pendingBoundaries = 0; | ||
| signals.setSnapshotCapture(true); | ||
@@ -620,4 +632,5 @@ _snapshotRootOwner = null; | ||
| } | ||
| function resumeBoundaryHydration(o, id, set, shouldHydrate = true) { | ||
| _pendingBoundaries--; | ||
| function resumeBoundaryHydration(o, id, set, release, shouldHydrate = true) { | ||
| const scope = sharedConfig.boundaryScopes?.get(id); | ||
| if (!release()) return; | ||
| if (signals.isDisposed(o)) { | ||
@@ -627,14 +640,27 @@ checkHydrationComplete(); | ||
| } | ||
| if (shouldHydrate) sharedConfig.gather?.(id); | ||
| _hydratingValue = shouldHydrate; | ||
| if (shouldHydrate) { | ||
| signals.markSnapshotScope(o); | ||
| _snapshotRootOwner = o; | ||
| const prevRegistry = sharedConfig.registry; | ||
| const prevGather = sharedConfig.gather; | ||
| if (scope) { | ||
| sharedConfig.registry = scope.registry; | ||
| sharedConfig.gather = scope.gather; | ||
| } | ||
| set(); | ||
| signals.flush(); | ||
| if (shouldHydrate) _snapshotRootOwner = null; | ||
| _hydratingValue = false; | ||
| if (shouldHydrate) signals.releaseSnapshotScope(o); | ||
| signals.flush(); | ||
| try { | ||
| if (shouldHydrate) sharedConfig.gather?.(id); | ||
| _hydratingValue = shouldHydrate; | ||
| if (shouldHydrate) { | ||
| signals.markSnapshotScope(o); | ||
| _snapshotRootOwner = o; | ||
| } | ||
| set(); | ||
| signals.flush(); | ||
| if (shouldHydrate) _snapshotRootOwner = null; | ||
| _hydratingValue = false; | ||
| if (shouldHydrate) signals.releaseSnapshotScope(o); | ||
| signals.flush(); | ||
| } finally { | ||
| if (scope) { | ||
| sharedConfig.registry = prevRegistry; | ||
| sharedConfig.gather = prevGather; | ||
| } | ||
| } | ||
| checkHydrationComplete(); | ||
@@ -644,8 +670,18 @@ } | ||
| _pendingBoundaries++; | ||
| sharedConfig.captureBoundaryScope?.(id); | ||
| let released = false; | ||
| const release = () => { | ||
| if (released) return false; | ||
| released = true; | ||
| _pendingBoundaries--; | ||
| sharedConfig.boundaryScopes?.delete(id); | ||
| return true; | ||
| }; | ||
| signals.onCleanup(() => { | ||
| if (!signals.isDisposed(o)) return; | ||
| sharedConfig.cleanupFragment?.(id); | ||
| if (release()) checkHydrationComplete(); | ||
| }); | ||
| const set = createBoundaryTrigger(); | ||
| return [set, shouldHydrate => resumeBoundaryHydration(o, id, set, shouldHydrate)]; | ||
| return [set, shouldHydrate => resumeBoundaryHydration(o, id, set, release, shouldHydrate), release]; | ||
| } | ||
@@ -718,3 +754,3 @@ function waitAndResume(p, resume, assetPromise, hydrateRejected = true) { | ||
| if (p) { | ||
| const [set, resume] = initBoundaryResume(o, id); | ||
| const [set, resume, release] = initBoundaryResume(o, id); | ||
| if (p !== "$$f") { | ||
@@ -724,3 +760,3 @@ waitAndResume(p, resume, assetPromise); | ||
| const afterAssets = () => { | ||
| _pendingBoundaries--; | ||
| if (!release()) return; | ||
| set(); | ||
@@ -727,0 +763,0 @@ checkHydrationComplete(); |
+55
-19
@@ -43,3 +43,5 @@ import { getContext, createMemo as createMemo$1, flatten, createRoot, setContext, createOwner, runWithOwner, createEffect as createEffect$1, createErrorBoundary as createErrorBoundary$1, createLoadingBoundary as createLoadingBoundary$1, createOptimistic as createOptimistic$1, createOptimisticStore as createOptimisticStore$1, createProjection as createProjection$1, createRenderEffect as createRenderEffect$1, createRevealOrder as createRevealOrder$1, createSignal as createSignal$1, createStore as createStore$1, setSnapshotCapture, releaseSnapshotScope, getOwner, peekNextChildId, getNextChildId, clearSnapshots, flush, markSnapshotScope, onCleanup, isDisposed, untrack, mapArray, repeat } from '@solidjs/signals'; | ||
| registry: undefined, | ||
| done: false | ||
| done: false, | ||
| isHydrationInProgress, | ||
| onHydrationEnd | ||
| }; | ||
@@ -64,2 +66,13 @@ function hydrationGetNextContextId() { | ||
| } | ||
| function isHydrationInProgress() { | ||
| return !_hydrationDone && (sharedConfig.hydrating || _pendingBoundaries > 0); | ||
| } | ||
| function onHydrationEnd(callback) { | ||
| if (_hydrationDone || !sharedConfig.hydrating && _pendingBoundaries === 0) { | ||
| queueMicrotask(callback); | ||
| return; | ||
| } | ||
| if (!_hydrationEndCallbacks) _hydrationEndCallbacks = []; | ||
| _hydrationEndCallbacks.push(callback); | ||
| } | ||
| function drainHydrationCallbacks() { | ||
@@ -81,3 +94,3 @@ if (_hydrationDone) return; | ||
| function checkHydrationComplete() { | ||
| if (_pendingBoundaries === 0) drainHydrationCallbacks(); | ||
| if (!_hydratingValue && _pendingBoundaries === 0) drainHydrationCallbacks(); | ||
| } | ||
@@ -571,3 +584,2 @@ let _hydratingValue = false; | ||
| _doneValue = false; | ||
| _pendingBoundaries = 0; | ||
| setSnapshotCapture(true); | ||
@@ -619,4 +631,5 @@ _snapshotRootOwner = null; | ||
| } | ||
| function resumeBoundaryHydration(o, id, set, shouldHydrate = true) { | ||
| _pendingBoundaries--; | ||
| function resumeBoundaryHydration(o, id, set, release, shouldHydrate = true) { | ||
| const scope = sharedConfig.boundaryScopes?.get(id); | ||
| if (!release()) return; | ||
| if (isDisposed(o)) { | ||
@@ -626,14 +639,27 @@ checkHydrationComplete(); | ||
| } | ||
| if (shouldHydrate) sharedConfig.gather?.(id); | ||
| _hydratingValue = shouldHydrate; | ||
| if (shouldHydrate) { | ||
| markSnapshotScope(o); | ||
| _snapshotRootOwner = o; | ||
| const prevRegistry = sharedConfig.registry; | ||
| const prevGather = sharedConfig.gather; | ||
| if (scope) { | ||
| sharedConfig.registry = scope.registry; | ||
| sharedConfig.gather = scope.gather; | ||
| } | ||
| set(); | ||
| flush(); | ||
| if (shouldHydrate) _snapshotRootOwner = null; | ||
| _hydratingValue = false; | ||
| if (shouldHydrate) releaseSnapshotScope(o); | ||
| flush(); | ||
| try { | ||
| if (shouldHydrate) sharedConfig.gather?.(id); | ||
| _hydratingValue = shouldHydrate; | ||
| if (shouldHydrate) { | ||
| markSnapshotScope(o); | ||
| _snapshotRootOwner = o; | ||
| } | ||
| set(); | ||
| flush(); | ||
| if (shouldHydrate) _snapshotRootOwner = null; | ||
| _hydratingValue = false; | ||
| if (shouldHydrate) releaseSnapshotScope(o); | ||
| flush(); | ||
| } finally { | ||
| if (scope) { | ||
| sharedConfig.registry = prevRegistry; | ||
| sharedConfig.gather = prevGather; | ||
| } | ||
| } | ||
| checkHydrationComplete(); | ||
@@ -643,8 +669,18 @@ } | ||
| _pendingBoundaries++; | ||
| sharedConfig.captureBoundaryScope?.(id); | ||
| let released = false; | ||
| const release = () => { | ||
| if (released) return false; | ||
| released = true; | ||
| _pendingBoundaries--; | ||
| sharedConfig.boundaryScopes?.delete(id); | ||
| return true; | ||
| }; | ||
| onCleanup(() => { | ||
| if (!isDisposed(o)) return; | ||
| sharedConfig.cleanupFragment?.(id); | ||
| if (release()) checkHydrationComplete(); | ||
| }); | ||
| const set = createBoundaryTrigger(); | ||
| return [set, shouldHydrate => resumeBoundaryHydration(o, id, set, shouldHydrate)]; | ||
| return [set, shouldHydrate => resumeBoundaryHydration(o, id, set, release, shouldHydrate), release]; | ||
| } | ||
@@ -717,3 +753,3 @@ function waitAndResume(p, resume, assetPromise, hydrateRejected = true) { | ||
| if (p) { | ||
| const [set, resume] = initBoundaryResume(o, id); | ||
| const [set, resume, release] = initBoundaryResume(o, id); | ||
| if (p !== "$$f") { | ||
@@ -723,3 +759,3 @@ waitAndResume(p, resume, assetPromise); | ||
| const afterAssets = () => { | ||
| _pendingBoundaries--; | ||
| if (!release()) return; | ||
| set(); | ||
@@ -726,0 +762,0 @@ checkHydrationComplete(); |
+2
-2
| { | ||
| "name": "solid-js", | ||
| "description": "Reactive JavaScript library for building user interfaces. Compiles JSX to real DOM with fine-grained signal-based updates — no virtual DOM.", | ||
| "version": "2.0.0-beta.20", | ||
| "version": "2.0.0-beta.21", | ||
| "author": "Ryan Carniato", | ||
@@ -131,3 +131,3 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@solidjs/signals": "^2.0.0-beta.20", | ||
| "@solidjs/signals": "^2.0.0-beta.21", | ||
| "csstype": "^3.1.0", | ||
@@ -134,0 +134,0 @@ "seroval": "~1.5.4", |
@@ -84,2 +84,15 @@ import { createRenderEffect as coreRenderEffect, createEffect as coreEffect, type Accessor, type ComputeFunction, type MemoOptions, type NoInfer, type ProjectionOptions, type Refreshable, type Signal, type SignalOptions, type SourceAccessor, type Store, type StoreSetter, type RevealOrder, type Context } from "@solidjs/signals"; | ||
| gather?: (key: string) => void; | ||
| /** | ||
| * Per-boundary capture of the root-scoped registry/gather pair, installed | ||
| * by the DOM runtime's hydrate(). Boundary registration stores the current | ||
| * pair keyed by the full boundary id; the resume path swaps it in for its | ||
| * synchronous window so a late resume claims against the root it | ||
| * registered under, not whichever root hydrated last (#2917). Entries are | ||
| * removed when the boundary's pending count releases. | ||
| */ | ||
| boundaryScopes?: Map<string, { | ||
| registry?: Map<string, object>; | ||
| gather?: (key: string) => void; | ||
| }>; | ||
| captureBoundaryScope?: (id: string) => void; | ||
| cleanupFragment?: (id: string) => void; | ||
@@ -93,2 +106,21 @@ loadModuleAssets?: (mapping: Record<string, string>) => Promise<void> | undefined; | ||
| getNextContextId?: () => string; | ||
| /** | ||
| * Whether a hydration pass is still claiming server-rendered DOM — true | ||
| * from hydrate()'s synchronous walk until every streamed boundary has | ||
| * resumed or been cancelled. Consumed by dev tooling (the refresh runtime | ||
| * defers hot swaps that would race the claim, #2919). Absent on the server | ||
| * sharedConfig. Cross-package wiring; not part of the user-facing API. | ||
| * | ||
| * @internal | ||
| */ | ||
| isHydrationInProgress?: () => boolean; | ||
| /** | ||
| * Registers a callback to run once when all hydration completes (all | ||
| * boundaries hydrated or cancelled). If hydration is already complete (or | ||
| * not hydrating), fires via queueMicrotask. Absent on the server | ||
| * sharedConfig. Cross-package wiring; not part of the user-facing API. | ||
| * | ||
| * @internal | ||
| */ | ||
| onHydrationEnd?: (callback: () => void) => void; | ||
| }; | ||
@@ -103,8 +135,2 @@ /** | ||
| export declare const sharedConfig: SharedConfig; | ||
| /** | ||
| * Registers a callback to run once when all hydration completes | ||
| * (all boundaries hydrated or cancelled). If hydration is already | ||
| * complete (or not hydrating), fires via queueMicrotask. | ||
| */ | ||
| export declare function onHydrationEnd(callback: () => void): void; | ||
| export declare let _lazyHydrationLookup: (<T>(comp: (() => T | undefined) | undefined, moduleUrl?: string) => (() => T) | undefined) | undefined; | ||
@@ -111,0 +137,0 @@ export declare function enableHydration(): void; |
@@ -84,2 +84,15 @@ import { createRenderEffect as coreRenderEffect, createEffect as coreEffect, type Accessor, type ComputeFunction, type MemoOptions, type NoInfer, type ProjectionOptions, type Refreshable, type Signal, type SignalOptions, type SourceAccessor, type Store, type StoreSetter, type RevealOrder, type Context } from "@solidjs/signals"; | ||
| gather?: (key: string) => void; | ||
| /** | ||
| * Per-boundary capture of the root-scoped registry/gather pair, installed | ||
| * by the DOM runtime's hydrate(). Boundary registration stores the current | ||
| * pair keyed by the full boundary id; the resume path swaps it in for its | ||
| * synchronous window so a late resume claims against the root it | ||
| * registered under, not whichever root hydrated last (#2917). Entries are | ||
| * removed when the boundary's pending count releases. | ||
| */ | ||
| boundaryScopes?: Map<string, { | ||
| registry?: Map<string, object>; | ||
| gather?: (key: string) => void; | ||
| }>; | ||
| captureBoundaryScope?: (id: string) => void; | ||
| cleanupFragment?: (id: string) => void; | ||
@@ -93,2 +106,21 @@ loadModuleAssets?: (mapping: Record<string, string>) => Promise<void> | undefined; | ||
| getNextContextId?: () => string; | ||
| /** | ||
| * Whether a hydration pass is still claiming server-rendered DOM — true | ||
| * from hydrate()'s synchronous walk until every streamed boundary has | ||
| * resumed or been cancelled. Consumed by dev tooling (the refresh runtime | ||
| * defers hot swaps that would race the claim, #2919). Absent on the server | ||
| * sharedConfig. Cross-package wiring; not part of the user-facing API. | ||
| * | ||
| * @internal | ||
| */ | ||
| isHydrationInProgress?: () => boolean; | ||
| /** | ||
| * Registers a callback to run once when all hydration completes (all | ||
| * boundaries hydrated or cancelled). If hydration is already complete (or | ||
| * not hydrating), fires via queueMicrotask. Absent on the server | ||
| * sharedConfig. Cross-package wiring; not part of the user-facing API. | ||
| * | ||
| * @internal | ||
| */ | ||
| onHydrationEnd?: (callback: () => void) => void; | ||
| }; | ||
@@ -103,8 +135,2 @@ /** | ||
| export declare const sharedConfig: SharedConfig; | ||
| /** | ||
| * Registers a callback to run once when all hydration completes | ||
| * (all boundaries hydrated or cancelled). If hydration is already | ||
| * complete (or not hydrating), fires via queueMicrotask. | ||
| */ | ||
| export declare function onHydrationEnd(callback: () => void): void; | ||
| export declare let _lazyHydrationLookup: (<T>(comp: (() => T | undefined) | undefined, moduleUrl?: string) => (() => T) | undefined) | undefined; | ||
@@ -111,0 +137,0 @@ export declare function enableHydration(): void; |
453335
1.72%10090
2.02%