@askrjs/askr 0.0.90 → 0.0.92
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/{access-Dpfoi4cA.js → access-DSkccuEI.js} +5 -2
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +4 -4
- package/dist/{activity-CQKEAORw.js → activity-DodHdC0L.js} +8 -6
- package/dist/{activity-CF2_JvJs.d.ts → activity-DxUcygE5.d.ts} +1 -1
- package/dist/benchmark.d.ts +1 -1
- package/dist/benchmark.js +8 -8
- package/dist/boot/index.d.ts +3 -4
- package/dist/boot/index.js +1 -1
- package/dist/{boot-D5GZU_g4.js → boot-D71bjP4r.js} +28 -22
- package/dist/{cleanup-c837KVij.js → cleanup-DAAhJjx5.js} +8 -5
- package/dist/{component-cleanup-BUfUleGZ.js → component-cleanup-CJCfu5ed.js} +3 -3
- package/dist/{component-internal-C4uwwUaK.js → component-internal-DlAkCgBE.js} +5 -5
- package/dist/{component-scope-DzJEbYGE.js → component-scope-4I3yEMkb.js} +13 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +1 -1
- package/dist/control/index.d.ts +1 -1
- package/dist/control/index.js +1 -1
- package/dist/{control-CsGs2bLS.d.ts → control-CdzY49Q2.d.ts} +1 -1
- package/dist/{control-CON10J1p.js → control-Dv540XtV.js} +4 -4
- package/dist/{csp-nonce-DH0TrDij.js → csp-nonce-ByMbWv8s.js} +1 -1
- package/dist/data/index.d.ts +1 -2
- package/dist/data/index.js +3 -3
- package/dist/{data-BmZC1kDn.js → data-DcikEH9N.js} +13 -13
- package/dist/{data-runtime-SC6zzAwh.js → data-runtime-oIdQWnPW.js} +2 -2
- package/dist/{deferred-Bh-nZhZF.js → deferred-B6CafO5u.js} +6 -6
- package/dist/{effect-lnxQIpJG.js → effect-BdZcHblj.js} +73 -14
- package/dist/{fastlane-CrfB3QG0.js → fastlane-B2s24fWt.js} +22 -3
- package/dist/{for-internal-Bsm0B8GZ.js → for-internal-T1C7jd7x.js} +6 -6
- package/dist/foundations/icon/index.d.ts +1 -2
- package/dist/foundations/index.d.ts +2 -2
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/state/index.d.ts +1 -1
- package/dist/foundations/state/index.js +1 -1
- package/dist/foundations/structures/index.d.ts +2 -2
- package/dist/foundations/structures/index.js +1 -1
- package/dist/fx/index.js +2 -2
- package/dist/{types-iAmDSV6o.d.ts → index-2bk8nldG.d.ts} +63 -1
- package/dist/index-DA3g8lm8.d.ts +955 -0
- package/dist/{index-Cf2ANwPL.d.ts → index-oswRaMn6.d.ts} +2 -3
- package/dist/index.d.ts +4 -7
- package/dist/index.js +32 -17
- package/dist/jsx-dev-runtime.d.ts +2 -3
- package/dist/jsx-runtime-C_0v1pMN.d.ts +2 -0
- package/dist/{jsx-runtime-LHh5tcTe.d.ts → jsx-runtime-Cfb2umb4.d.ts} +2 -3
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/{lifecycle-batch-Dfpid9-A.js → lifecycle-batch-Cyfd07rf.js} +2 -2
- package/dist/{lifecycle-operations-CMK1AN2C.js → lifecycle-operations-CQ8fsc94.js} +2 -2
- package/dist/{manifest-D1P9uTlz.js → manifest-Dv0bO6kg.js} +1 -1
- package/dist/{navigate-DIOaNAcS.js → navigate-BbWj-QU-.js} +12 -10
- package/dist/{navigate-BO7M2iUG.d.ts → navigate-CZHPEUC4.d.ts} +1 -1
- package/dist/{query-registry-IACQeDqi.js → query-registry-qm13pEdK.js} +1 -1
- package/dist/{readable-B5NtV7V0.js → readable-B99wh5Z_.js} +9 -6
- package/dist/{render-context-D0Hoj9dW.js → render-context-B7ohlh6t.js} +17 -1
- package/dist/{renderer-y2DL627q.js → renderer-C6jz9nIN.js} +234 -188
- package/dist/{resolution-D3UO6aKA.js → resolution-B21kmOkp.js} +6 -6
- package/dist/{resource-operation-CYDU3XzS.js → resource-operation-CaAttQqz.js} +6 -6
- package/dist/resources/index.d.ts +2 -2
- package/dist/resources/index.js +6 -6
- package/dist/{route-matching-DqULzZtC.js → route-matching-Bo6UqG-5.js} +14 -5
- package/dist/router/index.d.ts +4 -6
- package/dist/router/index.js +7 -7
- package/dist/{selector-BLNkRZ2i.js → selector-BLWwI55m.js} +22 -5
- package/dist/ssg/index.d.ts +1 -2
- package/dist/ssg/index.js +6 -6
- package/dist/ssr/index.d.ts +3 -5
- package/dist/ssr/index.js +2 -2
- package/dist/{ssr-VdXmmJqx.js → ssr-CaZfvQWn.js} +14 -13
- package/dist/{state-DCjONcHK.js → state-XPZYUzHL.js} +5 -5
- package/dist/{structures--NKfTh3j.js → structures-DKjkAmM5.js} +6 -6
- package/dist/testing/index.d.ts +2 -3
- package/dist/testing/index.js +6 -6
- package/dist/{jsx-BYXe_Nnk.d.ts → types-BA9FJtfR.d.ts} +16 -0
- package/dist/{verify-hydration-wRofFN5b.js → verify-hydration-CcF-HJil.js} +4 -3
- package/package.json +1 -1
- package/dist/control-D-FIa-n-.d.ts +0 -451
- package/dist/index-BU17hud9.d.ts +0 -52
- package/dist/index-CPlPDbEY.d.ts +0 -64
- package/dist/index-Izwp_ESC.d.ts +0 -458
- package/dist/jsx-runtime-BqhMEuT4.d.ts +0 -2
- package/dist/types-CsPtBGWb.d.ts +0 -16
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { n as hasTransparentComponentResult, t as __CONTROL_BOUNDARY__ } from "./control-C-ApnFs1.js";
|
|
2
2
|
import { n as _isDOMElement, t as __ERROR_BOUNDARY__ } from "./vnode-D24p6IW2.js";
|
|
3
|
-
import { b as
|
|
4
|
-
import { n as
|
|
5
|
-
import { b as restoreDomCommitScope, c as enterDomCommitScope, p as getCurrentInstance } from "./component-scope-
|
|
3
|
+
import { b as getRuntimeEnv, i as getDefaultRuntimeInstance, l as runRuntimeHandlerScope, n as enqueueRuntimeTask, p as configureRuntimeRenderer, x as isDevelopmentEnvironment, y as logger } from "./access-DSkccuEI.js";
|
|
4
|
+
import { n as isBulkCommitActive, r as markFastPathApplied } from "./fastlane-B2s24fWt.js";
|
|
5
|
+
import { T as withAppRenderRuntime, b as restoreDomCommitScope, c as enterDomCommitScope, d as getCurrentAppRenderRuntime, p as getCurrentInstance } from "./component-scope-4I3yEMkb.js";
|
|
6
6
|
import { i as isFragmentType, r as STATIC_CHILDREN } from "./jsx-C3IECePB.js";
|
|
7
|
-
import { b as withContext, f as getCurrentContextFrame, g as markVNodeTreeWithContextFrame, i as mountInstanceInline, m as getVNodeContextFrame, n as createComponentInstance, o as renderComponentInline, t as captureInlineRenderSnapshot } from "./component-internal-
|
|
8
|
-
import { t as cleanupComponent } from "./component-cleanup-
|
|
9
|
-
import { c as getCurrentLifecycleCommitBatch, l as registerLifecycleRollback, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch, u as registerLifecycleTransaction } from "./lifecycle-batch-
|
|
10
|
-
import { _ as setControlBoundaryContextFrame, a as registerForStateTransaction, b as rerenderChildScope, c as captureForFallbackTransactionSnapshot, d as clearCaseDomUpdateState, f as clearShowDomUpdateState, g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, l as captureForItemTransactionSnapshot, n as clearForDomUpdateState, o as rollbackForStateTransaction, t as beginForStateTransaction, v as createChildScope, y as disposeChildScope } from "./for-internal-
|
|
11
|
-
import { n as createOwnedFineGrainedEffect, r as markFineGrainedEffectsDirtySource, t as createFineGrainedEffect } from "./effect-
|
|
12
|
-
import { C as getDelegatedHandlersForElement, D as updateDelegatedListener, E as removeDelegatedListener, S as getDelegatedHandlerForElement, T as isEventDelegationEnabled, _ as teardownNodeSubtree, a as elementReactivePropsCleanup, b as addFreshDelegatedListener, c as forEachElementReactivePropCleanup, d as removeAllListeners, f as removeElementReactiveProps, g as setFreshElementReactivePropCleanup, h as setDirectElementReactivePropCleanup, i as elementListeners, l as getElementReactivePropCleanupSize, m as replaceElementRefBookkeeping, n as cleanupInstanceIfPresent, o as elementRefs, p as removeElementRef, r as cleanupInstancesUnder, s as forEachDescendantNode, t as REACTIVE_CHILDREN_KEY, u as getElementReactivePropsCleanupMap, v as updateElementRef, w as isDelegatedEvent, x as clearDelegatedHandlersForElement, y as addDelegatedListener } from "./cleanup-
|
|
7
|
+
import { b as withContext, f as getCurrentContextFrame, g as markVNodeTreeWithContextFrame, i as mountInstanceInline, m as getVNodeContextFrame, n as createComponentInstance, o as renderComponentInline, t as captureInlineRenderSnapshot } from "./component-internal-DlAkCgBE.js";
|
|
8
|
+
import { t as cleanupComponent } from "./component-cleanup-CJCfu5ed.js";
|
|
9
|
+
import { c as getCurrentLifecycleCommitBatch, l as registerLifecycleRollback, p as isPromiseLike, r as discardLifecycleCommitBatch, s as flushLifecycleCommitBatch, t as beginLifecycleCommitBatch, u as registerLifecycleTransaction } from "./lifecycle-batch-Cyfd07rf.js";
|
|
10
|
+
import { _ as setControlBoundaryContextFrame, a as registerForStateTransaction, b as rerenderChildScope, c as captureForFallbackTransactionSnapshot, d as clearCaseDomUpdateState, f as clearShowDomUpdateState, g as evaluateShowState, h as evaluateCaseState, i as evaluateForState, l as captureForItemTransactionSnapshot, n as clearForDomUpdateState, o as rollbackForStateTransaction, t as beginForStateTransaction, v as createChildScope, y as disposeChildScope } from "./for-internal-T1C7jd7x.js";
|
|
11
|
+
import { n as createOwnedFineGrainedEffect, r as markFineGrainedEffectsDirtySource, t as createFineGrainedEffect } from "./effect-BdZcHblj.js";
|
|
12
|
+
import { C as getDelegatedHandlersForElement, D as updateDelegatedListener, E as removeDelegatedListener, S as getDelegatedHandlerForElement, T as isEventDelegationEnabled, _ as teardownNodeSubtree, a as elementReactivePropsCleanup, b as addFreshDelegatedListener, c as forEachElementReactivePropCleanup, d as removeAllListeners, f as removeElementReactiveProps, g as setFreshElementReactivePropCleanup, h as setDirectElementReactivePropCleanup, i as elementListeners, l as getElementReactivePropCleanupSize, m as replaceElementRefBookkeeping, n as cleanupInstanceIfPresent, o as elementRefs, p as removeElementRef, r as cleanupInstancesUnder, s as forEachDescendantNode, t as REACTIVE_CHILDREN_KEY, u as getElementReactivePropsCleanupMap, v as updateElementRef, w as isDelegatedEvent, x as clearDelegatedHandlersForElement, y as addDelegatedListener } from "./cleanup-DAAhJjx5.js";
|
|
13
13
|
import { n as getPublicAttributeName, t as sanitizeCssValue } from "./css-BuPaTOfe.js";
|
|
14
|
-
import { i as ROUTE_ROOT_COMPONENT, o as isUnsafeUrlAttribute } from "./csp-nonce-
|
|
14
|
+
import { i as ROUTE_ROOT_COMPONENT, o as isUnsafeUrlAttribute } from "./csp-nonce-ByMbWv8s.js";
|
|
15
15
|
import { a as isSSRPortalHydrationAnchor } from "./portal-w3oQ6oQU.js";
|
|
16
16
|
//#region src/runtime/error-boundary.ts
|
|
17
17
|
function createBoundaryReset(instance) {
|
|
@@ -100,20 +100,22 @@ function getPassiveOptions(eventName) {
|
|
|
100
100
|
* Uses caching to avoid recreating wrappers for the same handler
|
|
101
101
|
*/
|
|
102
102
|
function createWrappedHandler(handler, flushAfter = false) {
|
|
103
|
+
const appRuntime = getCurrentAppRenderRuntime();
|
|
103
104
|
const cachedByFlush = handlerCache.get(handler);
|
|
104
105
|
if (cachedByFlush) {
|
|
105
|
-
const
|
|
106
|
+
const cachedByRuntime = cachedByFlush.get(flushAfter);
|
|
107
|
+
const cached = appRuntime ? cachedByRuntime?.scoped.get(appRuntime) : cachedByRuntime?.unscoped;
|
|
106
108
|
if (cached) return cached;
|
|
107
109
|
}
|
|
108
110
|
const wrapped = (event) => {
|
|
109
111
|
try {
|
|
110
|
-
runRuntimeHandlerScope(() => {
|
|
112
|
+
runRuntimeHandlerScope(() => withAppRenderRuntime(appRuntime, () => {
|
|
111
113
|
try {
|
|
112
114
|
handler(event);
|
|
113
115
|
} catch (error) {
|
|
114
116
|
logger.error("[Askr] Event handler error:", error);
|
|
115
117
|
}
|
|
116
|
-
}, flushAfter ? "sync" : "defer");
|
|
118
|
+
}), flushAfter ? "sync" : "defer");
|
|
117
119
|
} catch (err) {
|
|
118
120
|
if (flushAfter) queueMicrotask(() => {
|
|
119
121
|
throw err;
|
|
@@ -126,21 +128,25 @@ function createWrappedHandler(handler, flushAfter = false) {
|
|
|
126
128
|
cacheSize++;
|
|
127
129
|
handlerCache.set(handler, /* @__PURE__ */ new Map());
|
|
128
130
|
}
|
|
129
|
-
handlerCache.get(handler)?.
|
|
131
|
+
const cachedByRuntime = handlerCache.get(handler)?.get(flushAfter) ?? { scoped: /* @__PURE__ */ new WeakMap() };
|
|
132
|
+
if (appRuntime) cachedByRuntime.scoped.set(appRuntime, wrapped);
|
|
133
|
+
else cachedByRuntime.unscoped = wrapped;
|
|
134
|
+
handlerCache.get(handler)?.set(flushAfter, cachedByRuntime);
|
|
130
135
|
} catch {}
|
|
131
136
|
return wrapped;
|
|
132
137
|
}
|
|
133
138
|
function createMutableWrappedHandler(handler, flushAfter = false) {
|
|
134
139
|
let currentHandler = handler;
|
|
140
|
+
let appRuntime = getCurrentAppRenderRuntime();
|
|
135
141
|
const wrapped = (event) => {
|
|
136
142
|
try {
|
|
137
|
-
runRuntimeHandlerScope(() => {
|
|
143
|
+
runRuntimeHandlerScope(() => withAppRenderRuntime(appRuntime, () => {
|
|
138
144
|
try {
|
|
139
145
|
currentHandler(event);
|
|
140
146
|
} catch (error) {
|
|
141
147
|
logger.error("[Askr] Event handler error:", error);
|
|
142
148
|
}
|
|
143
|
-
}, flushAfter ? "sync" : "defer");
|
|
149
|
+
}), flushAfter ? "sync" : "defer");
|
|
144
150
|
} catch (err) {
|
|
145
151
|
if (flushAfter) queueMicrotask(() => {
|
|
146
152
|
throw err;
|
|
@@ -152,6 +158,7 @@ function createMutableWrappedHandler(handler, flushAfter = false) {
|
|
|
152
158
|
handler: wrapped,
|
|
153
159
|
updateHandler(nextHandler) {
|
|
154
160
|
currentHandler = nextHandler;
|
|
161
|
+
appRuntime = getCurrentAppRenderRuntime();
|
|
155
162
|
}
|
|
156
163
|
};
|
|
157
164
|
}
|
|
@@ -2345,6 +2352,170 @@ function commitReconciliation(parent, finalNodes) {
|
|
|
2345
2352
|
}
|
|
2346
2353
|
}
|
|
2347
2354
|
//#endregion
|
|
2355
|
+
//#region src/renderer/component-host-cleanup.ts
|
|
2356
|
+
function retireComponentOwnersForIntrinsicReuse(element, retainedOwner) {
|
|
2357
|
+
const host = element;
|
|
2358
|
+
if (host.__ASKR_INSTANCE || host.__ASKR_INSTANCES?.length) {
|
|
2359
|
+
const instances = host.__ASKR_INSTANCES ?? [];
|
|
2360
|
+
const activeOwner = retainedOwner === void 0 ? getCurrentInstance() : retainedOwner;
|
|
2361
|
+
const activeOwnerIndex = activeOwner ? instances.indexOf(activeOwner) : -1;
|
|
2362
|
+
pruneComponentHostInstances(host, activeOwnerIndex >= 0 ? instances.slice(activeOwnerIndex) : activeOwner && host.__ASKR_INSTANCE === activeOwner ? [activeOwner] : []);
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
function cleanupDetachedComponentHost(host, retainedInstance) {
|
|
2366
|
+
const retainedInstances = retainedInstance instanceof Object && typeof retainedInstance[Symbol.iterator] === "function" ? new Set(retainedInstance) : /* @__PURE__ */ new Set([retainedInstance]);
|
|
2367
|
+
const cleanupErrors = [];
|
|
2368
|
+
const cleanedInstances = /* @__PURE__ */ new Set();
|
|
2369
|
+
const nodes = [host];
|
|
2370
|
+
try {
|
|
2371
|
+
forEachDescendantNode(host, (node) => {
|
|
2372
|
+
nodes.push(node);
|
|
2373
|
+
});
|
|
2374
|
+
} catch (error) {
|
|
2375
|
+
cleanupErrors.push(error);
|
|
2376
|
+
}
|
|
2377
|
+
for (const node of nodes) {
|
|
2378
|
+
if (node instanceof Element) {
|
|
2379
|
+
cleanupElementListeners(node, cleanupErrors);
|
|
2380
|
+
cleanupElementReactiveProps(node, cleanupErrors);
|
|
2381
|
+
cleanupElementRef(node, cleanupErrors);
|
|
2382
|
+
}
|
|
2383
|
+
cleanupNodeInstances(node, retainedInstances, cleanedInstances, cleanupErrors);
|
|
2384
|
+
clearHostMetadata(node, cleanupErrors);
|
|
2385
|
+
}
|
|
2386
|
+
if (cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, "Detached component host cleanup failed");
|
|
2387
|
+
}
|
|
2388
|
+
function cleanupElementListeners(element, cleanupErrors) {
|
|
2389
|
+
const listenerMap = elementListeners.get(element);
|
|
2390
|
+
if (listenerMap) {
|
|
2391
|
+
elementListeners.delete(element);
|
|
2392
|
+
for (const entry of listenerMap.values()) try {
|
|
2393
|
+
if (entry.isDelegated) removeDelegatedListener(element, entry.eventName);
|
|
2394
|
+
else if (entry.options !== void 0) element.removeEventListener(entry.eventName, entry.handler, entry.options);
|
|
2395
|
+
else element.removeEventListener(entry.eventName, entry.handler);
|
|
2396
|
+
} catch (error) {
|
|
2397
|
+
cleanupErrors.push(error);
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
try {
|
|
2401
|
+
clearDelegatedHandlersForElement(element);
|
|
2402
|
+
} catch (error) {
|
|
2403
|
+
cleanupErrors.push(error);
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
function cleanupElementReactiveProps(element, cleanupErrors) {
|
|
2407
|
+
if (!elementReactivePropsCleanup.has(element)) return;
|
|
2408
|
+
const entries = [];
|
|
2409
|
+
forEachElementReactivePropCleanup(element, (entry) => entries.push(entry));
|
|
2410
|
+
elementReactivePropsCleanup.delete(element);
|
|
2411
|
+
for (const entry of entries) try {
|
|
2412
|
+
entry.cleanup();
|
|
2413
|
+
} catch (error) {
|
|
2414
|
+
cleanupErrors.push(error);
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
function cleanupElementRef(element, cleanupErrors) {
|
|
2418
|
+
try {
|
|
2419
|
+
removeElementRef(element);
|
|
2420
|
+
} catch (error) {
|
|
2421
|
+
replaceElementRefBookkeeping(element, void 0);
|
|
2422
|
+
cleanupErrors.push(error);
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
function cleanupNodeInstances(node, retainedInstances, cleanedInstances, cleanupErrors) {
|
|
2426
|
+
const instances = new Set(node.__ASKR_INSTANCES ?? []);
|
|
2427
|
+
if (node.__ASKR_INSTANCE) instances.add(node.__ASKR_INSTANCE);
|
|
2428
|
+
for (const instance of instances) {
|
|
2429
|
+
if (retainedInstances.has(instance) || cleanedInstances.has(instance)) continue;
|
|
2430
|
+
cleanedInstances.add(instance);
|
|
2431
|
+
try {
|
|
2432
|
+
cleanupComponent(instance);
|
|
2433
|
+
} catch (error) {
|
|
2434
|
+
cleanupErrors.push(error);
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
function clearHostMetadata(node, cleanupErrors) {
|
|
2439
|
+
for (const property of [
|
|
2440
|
+
"__ASKR_INSTANCE",
|
|
2441
|
+
"__ASKR_INSTANCES",
|
|
2442
|
+
"__ASKR_WRAPPER_HOST"
|
|
2443
|
+
]) try {
|
|
2444
|
+
delete node[property];
|
|
2445
|
+
} catch (error) {
|
|
2446
|
+
cleanupErrors.push(error);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
function pruneComponentHostInstances(host, retainedInstances) {
|
|
2450
|
+
const hadInstanceList = Object.prototype.hasOwnProperty.call(host, "__ASKR_INSTANCES");
|
|
2451
|
+
const hadPrimaryInstance = Object.prototype.hasOwnProperty.call(host, "__ASKR_INSTANCE");
|
|
2452
|
+
const previousInstanceList = host.__ASKR_INSTANCES?.slice();
|
|
2453
|
+
const previousPrimaryInstance = host.__ASKR_INSTANCE;
|
|
2454
|
+
const previousInstances = collectHostInstances(host);
|
|
2455
|
+
const commit = () => {
|
|
2456
|
+
const nextInstances = orderHostInstances(retainedInstances);
|
|
2457
|
+
const retained = new Set(nextInstances);
|
|
2458
|
+
writeHostInstances(host, nextInstances);
|
|
2459
|
+
cleanupHostInstances(Array.from(previousInstances).filter((instance) => !retained.has(instance)), "Component host pruning failed");
|
|
2460
|
+
};
|
|
2461
|
+
const rollback = () => {
|
|
2462
|
+
const currentInstances = collectHostInstances(host);
|
|
2463
|
+
for (const instance of retainedInstances) currentInstances.add(instance);
|
|
2464
|
+
try {
|
|
2465
|
+
if (hadInstanceList) host.__ASKR_INSTANCES = previousInstanceList;
|
|
2466
|
+
else delete host.__ASKR_INSTANCES;
|
|
2467
|
+
if (hadPrimaryInstance) host.__ASKR_INSTANCE = previousPrimaryInstance;
|
|
2468
|
+
else delete host.__ASKR_INSTANCE;
|
|
2469
|
+
} catch {}
|
|
2470
|
+
cleanupHostInstances(Array.from(currentInstances).filter((instance) => !previousInstances.has(instance)), "Provisional component host cleanup failed");
|
|
2471
|
+
};
|
|
2472
|
+
if (!registerLifecycleTransaction({}, commit, rollback)) commit();
|
|
2473
|
+
}
|
|
2474
|
+
function orderHostInstances(instances) {
|
|
2475
|
+
const ordered = Array.from(new Set(instances));
|
|
2476
|
+
const candidates = new Set(ordered);
|
|
2477
|
+
const originalIndex = new Map(ordered.map((instance, index) => [instance, index]));
|
|
2478
|
+
const depthCache = /* @__PURE__ */ new Map();
|
|
2479
|
+
const getDepth = (instance, visiting = /* @__PURE__ */ new Set()) => {
|
|
2480
|
+
const cached = depthCache.get(instance);
|
|
2481
|
+
if (cached !== void 0) return cached;
|
|
2482
|
+
if (visiting.has(instance)) return 0;
|
|
2483
|
+
visiting.add(instance);
|
|
2484
|
+
const parent = instance._vnodeParent ?? instance.parentInstance;
|
|
2485
|
+
const depth = parent && candidates.has(parent) ? getDepth(parent, visiting) + 1 : 0;
|
|
2486
|
+
visiting.delete(instance);
|
|
2487
|
+
depthCache.set(instance, depth);
|
|
2488
|
+
return depth;
|
|
2489
|
+
};
|
|
2490
|
+
return ordered.sort((left, right) => getDepth(right) - getDepth(left) || originalIndex.get(left) - originalIndex.get(right));
|
|
2491
|
+
}
|
|
2492
|
+
function collectHostInstances(host) {
|
|
2493
|
+
const instances = /* @__PURE__ */ new Set();
|
|
2494
|
+
for (const instance of host.__ASKR_INSTANCES ?? []) instances.add(instance);
|
|
2495
|
+
if (host.__ASKR_INSTANCE) instances.add(host.__ASKR_INSTANCE);
|
|
2496
|
+
return instances;
|
|
2497
|
+
}
|
|
2498
|
+
function writeHostInstances(host, instances) {
|
|
2499
|
+
try {
|
|
2500
|
+
if (instances.length > 0) {
|
|
2501
|
+
host.__ASKR_INSTANCES = instances;
|
|
2502
|
+
host.__ASKR_INSTANCE = instances[0];
|
|
2503
|
+
} else {
|
|
2504
|
+
delete host.__ASKR_INSTANCES;
|
|
2505
|
+
delete host.__ASKR_INSTANCE;
|
|
2506
|
+
}
|
|
2507
|
+
} catch {}
|
|
2508
|
+
}
|
|
2509
|
+
function cleanupHostInstances(instances, message) {
|
|
2510
|
+
const cleanupErrors = [];
|
|
2511
|
+
for (const instance of instances) try {
|
|
2512
|
+
cleanupComponent(instance);
|
|
2513
|
+
} catch (error) {
|
|
2514
|
+
cleanupErrors.push(error);
|
|
2515
|
+
}
|
|
2516
|
+
if (cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, message);
|
|
2517
|
+
}
|
|
2518
|
+
//#endregion
|
|
2348
2519
|
//#region src/renderer/children-fastpath.ts
|
|
2349
2520
|
function upperCommonTagName$1(tag) {
|
|
2350
2521
|
switch (tag) {
|
|
@@ -2378,6 +2549,7 @@ function performBulkPositionalKeyedTextUpdate(parent, keyedVnodes) {
|
|
|
2378
2549
|
const vnodeType = vnode.type;
|
|
2379
2550
|
if (tagsEqualIgnoreCase$1(child.tagName, vnodeType)) {
|
|
2380
2551
|
updateTextContent(child, vnode.children || vnode.props?.children, vnode);
|
|
2552
|
+
retireComponentOwnersForIntrinsicReuse(child);
|
|
2381
2553
|
setDataKey(child, key, () => updatedKeys += 1);
|
|
2382
2554
|
reused += 1;
|
|
2383
2555
|
continue;
|
|
@@ -2512,6 +2684,7 @@ function processElementVnode(vnode, existingNode, finalNodes) {
|
|
|
2512
2684
|
const tag = vnodeObj.type;
|
|
2513
2685
|
if (existingNode && existingNode.nodeType === 1 && tagsEqualIgnoreCase$1(existingNode.tagName, tag)) {
|
|
2514
2686
|
updateElementFromVnode(existingNode, vnode);
|
|
2687
|
+
retireComponentOwnersForIntrinsicReuse(existingNode);
|
|
2515
2688
|
finalNodes.push(existingNode);
|
|
2516
2689
|
return "reused";
|
|
2517
2690
|
}
|
|
@@ -2623,6 +2796,7 @@ function applyRendererFastPath(parent, keyedVnodes, oldKeyMap) {
|
|
|
2623
2796
|
} else el = localOldKeyMap?.get(key) ?? oldKeyMap?.get(key);
|
|
2624
2797
|
if (el) {
|
|
2625
2798
|
updateElementFromVnode(el, vnode);
|
|
2799
|
+
retireComponentOwnersForIntrinsicReuse(el);
|
|
2626
2800
|
finalNodes.push(el);
|
|
2627
2801
|
reusedCount++;
|
|
2628
2802
|
} else {
|
|
@@ -2865,6 +3039,7 @@ function reconcileKeyedChild(child, key, parent, resolveOldElOnce, usedOldEls, n
|
|
|
2865
3039
|
if (childObj && typeof childObj === "object" && typeof childObj.type === "string") {
|
|
2866
3040
|
if (canReuseIntrinsicElementInNamespace(el, childObj.type, parentNamespace)) {
|
|
2867
3041
|
domHost.updateElementFromVnode(el, child);
|
|
3042
|
+
retireComponentOwnersForIntrinsicReuse(el);
|
|
2868
3043
|
newKeyMap.set(key, el);
|
|
2869
3044
|
return el;
|
|
2870
3045
|
}
|
|
@@ -2924,6 +3099,7 @@ function reconcileUnkeyedChild(child, parent, resolveUnkeyedOnce, usedOldEls, ex
|
|
|
2924
3099
|
}
|
|
2925
3100
|
if (existing instanceof Element && canReuseElement(existing, child, parentNamespace)) {
|
|
2926
3101
|
domHost.updateElementFromVnode(existing, child);
|
|
3102
|
+
retireComponentOwnersForIntrinsicReuse(existing);
|
|
2927
3103
|
usedOldEls.add(existing);
|
|
2928
3104
|
return existing;
|
|
2929
3105
|
}
|
|
@@ -2996,6 +3172,7 @@ function tryReuseElement(avail, child, usedOldEls, parentNamespace) {
|
|
|
2996
3172
|
const childObj = child;
|
|
2997
3173
|
if (typeof childObj.type === "string" && canReuseIntrinsicElementInNamespace(avail, childObj.type, parentNamespace)) {
|
|
2998
3174
|
getRendererDOMHost().updateElementFromVnode(avail, child);
|
|
3175
|
+
retireComponentOwnersForIntrinsicReuse(avail);
|
|
2999
3176
|
usedOldEls.add(avail);
|
|
3000
3177
|
return avail;
|
|
3001
3178
|
}
|
|
@@ -3919,6 +4096,7 @@ function updateMixedControlChildren(parent, children, forceUpdate) {
|
|
|
3919
4096
|
}
|
|
3920
4097
|
if (cursor instanceof Element && _isDOMElement(child) && typeof child.type === "string" && tagsEqualIgnoreCase(cursor.tagName, child.type)) {
|
|
3921
4098
|
domHost.updateElementFromVnode(cursor, child, true, forceUpdate);
|
|
4099
|
+
retireComponentOwnersForIntrinsicReuse(cursor);
|
|
3922
4100
|
cursor = cursor.nextSibling;
|
|
3923
4101
|
continue;
|
|
3924
4102
|
}
|
|
@@ -3985,8 +4163,10 @@ function updateUnkeyedChildren(parent, newChildren, forceUpdate = false) {
|
|
|
3985
4163
|
const next = newChildren[i];
|
|
3986
4164
|
const current = c[i];
|
|
3987
4165
|
if (!current || next === void 0) continue;
|
|
3988
|
-
if (_isDOMElement(next) && typeof next.type === "string") if (tagsEqualIgnoreCase(current.tagName, next.type))
|
|
3989
|
-
|
|
4166
|
+
if (_isDOMElement(next) && typeof next.type === "string") if (tagsEqualIgnoreCase(current.tagName, next.type)) {
|
|
4167
|
+
domHost.updateElementFromVnode(current, next, true, forceUpdate);
|
|
4168
|
+
retireComponentOwnersForIntrinsicReuse(current);
|
|
4169
|
+
} else {
|
|
3990
4170
|
const dom = domHost.createDOMNode(next, parentNamespace);
|
|
3991
4171
|
if (dom) {
|
|
3992
4172
|
teardownNodeSubtree(current);
|
|
@@ -4039,8 +4219,10 @@ function updateUnkeyedChildren(parent, newChildren, forceUpdate = false) {
|
|
|
4039
4219
|
}
|
|
4040
4220
|
else if (_isDOMElement(next)) if (currentNode.nodeType === 1) {
|
|
4041
4221
|
const currentEl = currentNode;
|
|
4042
|
-
if (typeof next.type === "string") if (tagsEqualIgnoreCase(currentEl.tagName, next.type))
|
|
4043
|
-
|
|
4222
|
+
if (typeof next.type === "string") if (tagsEqualIgnoreCase(currentEl.tagName, next.type)) {
|
|
4223
|
+
domHost.updateElementFromVnode(currentEl, next, true, forceUpdate);
|
|
4224
|
+
retireComponentOwnersForIntrinsicReuse(currentEl);
|
|
4225
|
+
} else {
|
|
4044
4226
|
const dom = domHost.createDOMNode(next, parentNamespace);
|
|
4045
4227
|
if (dom) {
|
|
4046
4228
|
teardownNodeSubtree(currentEl);
|
|
@@ -4130,8 +4312,10 @@ function updateUnkeyedChildren(parent, newChildren, forceUpdate = false) {
|
|
|
4130
4312
|
teardownNodeSubtree(current);
|
|
4131
4313
|
parent.replaceChild(textNode, current);
|
|
4132
4314
|
} else if (_isDOMElement(next)) {
|
|
4133
|
-
if (typeof next.type === "string") if (tagsEqualIgnoreCase(current.tagName, next.type))
|
|
4134
|
-
|
|
4315
|
+
if (typeof next.type === "string") if (tagsEqualIgnoreCase(current.tagName, next.type)) {
|
|
4316
|
+
domHost.updateElementFromVnode(current, next, true, forceUpdate);
|
|
4317
|
+
retireComponentOwnersForIntrinsicReuse(current);
|
|
4318
|
+
} else {
|
|
4135
4319
|
const dom = domHost.createDOMNode(next, parentNamespace);
|
|
4136
4320
|
if (dom) {
|
|
4137
4321
|
teardownNodeSubtree(current);
|
|
@@ -5286,6 +5470,7 @@ function syncControlBoundaryScopeDom(parent, scope, vnode, before = null, allowH
|
|
|
5286
5470
|
if (resolvedRange.single && dom?.nodeType === 8 && (vnode === null || vnode === void 0 || vnode === false)) return currentRange;
|
|
5287
5471
|
if (resolvedRange.single && dom instanceof Element && _isDOMElement(vnode) && typeof vnode.type === "string" && tagNamesEqualIgnoreCase$1(dom.tagName, vnode.type)) {
|
|
5288
5472
|
host.updateElementFromVnode(dom, vnode, true);
|
|
5473
|
+
retireComponentOwnersForIntrinsicReuse(dom);
|
|
5289
5474
|
return currentRange;
|
|
5290
5475
|
}
|
|
5291
5476
|
if (!resolvedRange.single && syncTransparentRange(resolvedRange, vnode, false)) return resolvedRange;
|
|
@@ -5574,161 +5759,6 @@ function trySyncControlBoundaryChild(parent, currentNode, next) {
|
|
|
5574
5759
|
return true;
|
|
5575
5760
|
}
|
|
5576
5761
|
//#endregion
|
|
5577
|
-
//#region src/renderer/component-host-cleanup.ts
|
|
5578
|
-
function cleanupDetachedComponentHost(host, retainedInstance) {
|
|
5579
|
-
const retainedInstances = retainedInstance instanceof Object && typeof retainedInstance[Symbol.iterator] === "function" ? new Set(retainedInstance) : /* @__PURE__ */ new Set([retainedInstance]);
|
|
5580
|
-
const cleanupErrors = [];
|
|
5581
|
-
const cleanedInstances = /* @__PURE__ */ new Set();
|
|
5582
|
-
const nodes = [host];
|
|
5583
|
-
try {
|
|
5584
|
-
forEachDescendantNode(host, (node) => {
|
|
5585
|
-
nodes.push(node);
|
|
5586
|
-
});
|
|
5587
|
-
} catch (error) {
|
|
5588
|
-
cleanupErrors.push(error);
|
|
5589
|
-
}
|
|
5590
|
-
for (const node of nodes) {
|
|
5591
|
-
if (node instanceof Element) {
|
|
5592
|
-
cleanupElementListeners(node, cleanupErrors);
|
|
5593
|
-
cleanupElementReactiveProps(node, cleanupErrors);
|
|
5594
|
-
cleanupElementRef(node, cleanupErrors);
|
|
5595
|
-
}
|
|
5596
|
-
cleanupNodeInstances(node, retainedInstances, cleanedInstances, cleanupErrors);
|
|
5597
|
-
clearHostMetadata(node, cleanupErrors);
|
|
5598
|
-
}
|
|
5599
|
-
if (cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, "Detached component host cleanup failed");
|
|
5600
|
-
}
|
|
5601
|
-
function cleanupElementListeners(element, cleanupErrors) {
|
|
5602
|
-
const listenerMap = elementListeners.get(element);
|
|
5603
|
-
if (listenerMap) {
|
|
5604
|
-
elementListeners.delete(element);
|
|
5605
|
-
for (const entry of listenerMap.values()) try {
|
|
5606
|
-
if (entry.isDelegated) removeDelegatedListener(element, entry.eventName);
|
|
5607
|
-
else if (entry.options !== void 0) element.removeEventListener(entry.eventName, entry.handler, entry.options);
|
|
5608
|
-
else element.removeEventListener(entry.eventName, entry.handler);
|
|
5609
|
-
} catch (error) {
|
|
5610
|
-
cleanupErrors.push(error);
|
|
5611
|
-
}
|
|
5612
|
-
}
|
|
5613
|
-
try {
|
|
5614
|
-
clearDelegatedHandlersForElement(element);
|
|
5615
|
-
} catch (error) {
|
|
5616
|
-
cleanupErrors.push(error);
|
|
5617
|
-
}
|
|
5618
|
-
}
|
|
5619
|
-
function cleanupElementReactiveProps(element, cleanupErrors) {
|
|
5620
|
-
if (!elementReactivePropsCleanup.has(element)) return;
|
|
5621
|
-
const entries = [];
|
|
5622
|
-
forEachElementReactivePropCleanup(element, (entry) => entries.push(entry));
|
|
5623
|
-
elementReactivePropsCleanup.delete(element);
|
|
5624
|
-
for (const entry of entries) try {
|
|
5625
|
-
entry.cleanup();
|
|
5626
|
-
} catch (error) {
|
|
5627
|
-
cleanupErrors.push(error);
|
|
5628
|
-
}
|
|
5629
|
-
}
|
|
5630
|
-
function cleanupElementRef(element, cleanupErrors) {
|
|
5631
|
-
try {
|
|
5632
|
-
removeElementRef(element);
|
|
5633
|
-
} catch (error) {
|
|
5634
|
-
replaceElementRefBookkeeping(element, void 0);
|
|
5635
|
-
cleanupErrors.push(error);
|
|
5636
|
-
}
|
|
5637
|
-
}
|
|
5638
|
-
function cleanupNodeInstances(node, retainedInstances, cleanedInstances, cleanupErrors) {
|
|
5639
|
-
const instances = new Set(node.__ASKR_INSTANCES ?? []);
|
|
5640
|
-
if (node.__ASKR_INSTANCE) instances.add(node.__ASKR_INSTANCE);
|
|
5641
|
-
for (const instance of instances) {
|
|
5642
|
-
if (retainedInstances.has(instance) || cleanedInstances.has(instance)) continue;
|
|
5643
|
-
cleanedInstances.add(instance);
|
|
5644
|
-
try {
|
|
5645
|
-
cleanupComponent(instance);
|
|
5646
|
-
} catch (error) {
|
|
5647
|
-
cleanupErrors.push(error);
|
|
5648
|
-
}
|
|
5649
|
-
}
|
|
5650
|
-
}
|
|
5651
|
-
function clearHostMetadata(node, cleanupErrors) {
|
|
5652
|
-
for (const property of [
|
|
5653
|
-
"__ASKR_INSTANCE",
|
|
5654
|
-
"__ASKR_INSTANCES",
|
|
5655
|
-
"__ASKR_WRAPPER_HOST"
|
|
5656
|
-
]) try {
|
|
5657
|
-
delete node[property];
|
|
5658
|
-
} catch (error) {
|
|
5659
|
-
cleanupErrors.push(error);
|
|
5660
|
-
}
|
|
5661
|
-
}
|
|
5662
|
-
function pruneComponentHostInstances(host, retainedInstances) {
|
|
5663
|
-
const hadInstanceList = Object.prototype.hasOwnProperty.call(host, "__ASKR_INSTANCES");
|
|
5664
|
-
const hadPrimaryInstance = Object.prototype.hasOwnProperty.call(host, "__ASKR_INSTANCE");
|
|
5665
|
-
const previousInstanceList = host.__ASKR_INSTANCES?.slice();
|
|
5666
|
-
const previousPrimaryInstance = host.__ASKR_INSTANCE;
|
|
5667
|
-
const previousInstances = collectHostInstances(host);
|
|
5668
|
-
const commit = () => {
|
|
5669
|
-
const nextInstances = orderHostInstances(retainedInstances);
|
|
5670
|
-
const retained = new Set(nextInstances);
|
|
5671
|
-
writeHostInstances(host, nextInstances);
|
|
5672
|
-
cleanupHostInstances(Array.from(previousInstances).filter((instance) => !retained.has(instance)), "Component host pruning failed");
|
|
5673
|
-
};
|
|
5674
|
-
const rollback = () => {
|
|
5675
|
-
const currentInstances = collectHostInstances(host);
|
|
5676
|
-
for (const instance of retainedInstances) currentInstances.add(instance);
|
|
5677
|
-
try {
|
|
5678
|
-
if (hadInstanceList) host.__ASKR_INSTANCES = previousInstanceList;
|
|
5679
|
-
else delete host.__ASKR_INSTANCES;
|
|
5680
|
-
if (hadPrimaryInstance) host.__ASKR_INSTANCE = previousPrimaryInstance;
|
|
5681
|
-
else delete host.__ASKR_INSTANCE;
|
|
5682
|
-
} catch {}
|
|
5683
|
-
cleanupHostInstances(Array.from(currentInstances).filter((instance) => !previousInstances.has(instance)), "Provisional component host cleanup failed");
|
|
5684
|
-
};
|
|
5685
|
-
if (!registerLifecycleTransaction({}, commit, rollback)) commit();
|
|
5686
|
-
}
|
|
5687
|
-
function orderHostInstances(instances) {
|
|
5688
|
-
const ordered = Array.from(new Set(instances));
|
|
5689
|
-
const candidates = new Set(ordered);
|
|
5690
|
-
const originalIndex = new Map(ordered.map((instance, index) => [instance, index]));
|
|
5691
|
-
const depthCache = /* @__PURE__ */ new Map();
|
|
5692
|
-
const getDepth = (instance, visiting = /* @__PURE__ */ new Set()) => {
|
|
5693
|
-
const cached = depthCache.get(instance);
|
|
5694
|
-
if (cached !== void 0) return cached;
|
|
5695
|
-
if (visiting.has(instance)) return 0;
|
|
5696
|
-
visiting.add(instance);
|
|
5697
|
-
const parent = instance._vnodeParent ?? instance.parentInstance;
|
|
5698
|
-
const depth = parent && candidates.has(parent) ? getDepth(parent, visiting) + 1 : 0;
|
|
5699
|
-
visiting.delete(instance);
|
|
5700
|
-
depthCache.set(instance, depth);
|
|
5701
|
-
return depth;
|
|
5702
|
-
};
|
|
5703
|
-
return ordered.sort((left, right) => getDepth(right) - getDepth(left) || originalIndex.get(left) - originalIndex.get(right));
|
|
5704
|
-
}
|
|
5705
|
-
function collectHostInstances(host) {
|
|
5706
|
-
const instances = /* @__PURE__ */ new Set();
|
|
5707
|
-
for (const instance of host.__ASKR_INSTANCES ?? []) instances.add(instance);
|
|
5708
|
-
if (host.__ASKR_INSTANCE) instances.add(host.__ASKR_INSTANCE);
|
|
5709
|
-
return instances;
|
|
5710
|
-
}
|
|
5711
|
-
function writeHostInstances(host, instances) {
|
|
5712
|
-
try {
|
|
5713
|
-
if (instances.length > 0) {
|
|
5714
|
-
host.__ASKR_INSTANCES = instances;
|
|
5715
|
-
host.__ASKR_INSTANCE = instances[0];
|
|
5716
|
-
} else {
|
|
5717
|
-
delete host.__ASKR_INSTANCES;
|
|
5718
|
-
delete host.__ASKR_INSTANCE;
|
|
5719
|
-
}
|
|
5720
|
-
} catch {}
|
|
5721
|
-
}
|
|
5722
|
-
function cleanupHostInstances(instances, message) {
|
|
5723
|
-
const cleanupErrors = [];
|
|
5724
|
-
for (const instance of instances) try {
|
|
5725
|
-
cleanupComponent(instance);
|
|
5726
|
-
} catch (error) {
|
|
5727
|
-
cleanupErrors.push(error);
|
|
5728
|
-
}
|
|
5729
|
-
if (cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, message);
|
|
5730
|
-
}
|
|
5731
|
-
//#endregion
|
|
5732
5762
|
//#region src/renderer/component-host-replacement.ts
|
|
5733
5763
|
function cleanupProvisionalComponentInstance(instance) {
|
|
5734
5764
|
try {
|
|
@@ -5872,6 +5902,16 @@ function registerVNodeComponentInstanceRollback(node, previousInstance, provisio
|
|
|
5872
5902
|
function retainReplacementOwnerChain(host, owner, retainedInstances) {
|
|
5873
5903
|
pruneComponentHostInstances(host, /* @__PURE__ */ new Set([owner, ...retainedInstances]));
|
|
5874
5904
|
}
|
|
5905
|
+
function retainMaterializedReplacementOwnerChain(host, owner, retainedInstances) {
|
|
5906
|
+
const instanceHost = host;
|
|
5907
|
+
const materializedInstances = /* @__PURE__ */ new Set([
|
|
5908
|
+
owner,
|
|
5909
|
+
...retainedInstances,
|
|
5910
|
+
...instanceHost.__ASKR_INSTANCES ?? []
|
|
5911
|
+
]);
|
|
5912
|
+
if (instanceHost.__ASKR_INSTANCE) materializedInstances.add(instanceHost.__ASKR_INSTANCE);
|
|
5913
|
+
pruneComponentHostInstances(instanceHost, materializedInstances);
|
|
5914
|
+
}
|
|
5875
5915
|
function adoptEmptySSRPortalHydrationHost(host, instance, retainedInstances, result) {
|
|
5876
5916
|
if (!isSSRPortalHydrationAnchor(host) || result !== null && result !== void 0 && result !== false) return false;
|
|
5877
5917
|
const instanceHost = host;
|
|
@@ -6174,7 +6214,7 @@ function syncComponentElement(currentDom, node, type, props, parentNamespace, fo
|
|
|
6174
6214
|
}
|
|
6175
6215
|
return replacement.replace(() => materializeComponentResultNode(hydrationInstance, scopedResult, parentNamespace), (replacement) => {
|
|
6176
6216
|
if (replacement instanceof Element) materializeKey(replacement, node, props);
|
|
6177
|
-
|
|
6217
|
+
retainMaterializedReplacementOwnerChain(replacement, hydrationInstance, liveRetainedInstances);
|
|
6178
6218
|
});
|
|
6179
6219
|
} catch (error) {
|
|
6180
6220
|
restoreVNodeComponentInstance(node, previousVNodeInstance);
|
|
@@ -6253,7 +6293,7 @@ function syncComponentElement(currentDom, node, type, props, parentNamespace, fo
|
|
|
6253
6293
|
}
|
|
6254
6294
|
return replacement.replace(() => materializeComponentResultNode(existingInstance, scopedResult, parentNamespace), (replacement) => {
|
|
6255
6295
|
if (replacement instanceof Element) materializeKey(replacement, node, props);
|
|
6256
|
-
|
|
6296
|
+
retainMaterializedReplacementOwnerChain(replacement, existingInstance, liveRetainedInstances);
|
|
6257
6297
|
});
|
|
6258
6298
|
}
|
|
6259
6299
|
//#endregion
|
|
@@ -6366,9 +6406,12 @@ function patchStableIntrinsicElement(dom, nextVNode) {
|
|
|
6366
6406
|
}
|
|
6367
6407
|
return true;
|
|
6368
6408
|
}
|
|
6369
|
-
function
|
|
6409
|
+
function resolveStableIntrinsicPatch(dom, vnode) {
|
|
6370
6410
|
if (!_isDOMElement(vnode)) return null;
|
|
6371
|
-
if (typeof vnode.type === "string") return tagNamesEqualIgnoreCase$1(dom.tagName, vnode.type) ?
|
|
6411
|
+
if (typeof vnode.type === "string") return tagNamesEqualIgnoreCase$1(dom.tagName, vnode.type) ? {
|
|
6412
|
+
vnode,
|
|
6413
|
+
retainedOwner: null
|
|
6414
|
+
} : null;
|
|
6372
6415
|
if (typeof vnode.type !== "function") return null;
|
|
6373
6416
|
const host = dom;
|
|
6374
6417
|
const existingInstance = findHostInstanceByType(host, vnode.type, vnode, getCurrentInstance());
|
|
@@ -6383,15 +6426,18 @@ function resolveStableIntrinsicPatchVNode(dom, vnode) {
|
|
|
6383
6426
|
const result = withContext(snapshot, () => renderComponentInline(existingInstance));
|
|
6384
6427
|
if (isPromiseLike(result)) throw new Error("Async components are not supported. Components must return synchronously.");
|
|
6385
6428
|
const resolvedResult = resolveNestedComponentResult(result, snapshot ?? null, existingInstance);
|
|
6386
|
-
if (_isDOMElement(resolvedResult) && typeof resolvedResult.type === "string" && tagNamesEqualIgnoreCase$1(dom.tagName, resolvedResult.type)) return
|
|
6429
|
+
if (_isDOMElement(resolvedResult) && typeof resolvedResult.type === "string" && tagNamesEqualIgnoreCase$1(dom.tagName, resolvedResult.type)) return {
|
|
6430
|
+
vnode: inheritComponentKey(resolvedResult, vnode),
|
|
6431
|
+
retainedOwner: existingInstance
|
|
6432
|
+
};
|
|
6387
6433
|
return null;
|
|
6388
6434
|
}
|
|
6389
6435
|
function tryPatchStableForDirtyItem(scope) {
|
|
6390
6436
|
if (!(scope.dom instanceof Element) || scope.vnode === void 0) return false;
|
|
6391
|
-
const
|
|
6392
|
-
if (!
|
|
6393
|
-
const didPatch = patchStableIntrinsicElement(scope.dom,
|
|
6394
|
-
if (didPatch);
|
|
6437
|
+
const patch = resolveStableIntrinsicPatch(scope.dom, scope.vnode);
|
|
6438
|
+
if (!patch) return false;
|
|
6439
|
+
const didPatch = patchStableIntrinsicElement(scope.dom, patch.vnode);
|
|
6440
|
+
if (didPatch) retireComponentOwnersForIntrinsicReuse(scope.dom, patch.retainedOwner);
|
|
6395
6441
|
return didPatch;
|
|
6396
6442
|
}
|
|
6397
6443
|
//#endregion
|
|
@@ -7308,7 +7354,7 @@ function replaceComponentRange(instance, result, host) {
|
|
|
7308
7354
|
return syncedHost;
|
|
7309
7355
|
}
|
|
7310
7356
|
}
|
|
7311
|
-
return beginComponentHostReplacement(instanceHost, instance, instance.target, retainedInstances).replace(() => materializeComponentResultNode(instance, result, getParentNamespace(parent)), (nextHost) =>
|
|
7357
|
+
return beginComponentHostReplacement(instanceHost, instance, instance.target, retainedInstances).replace(() => materializeComponentResultNode(instance, result, getParentNamespace(parent)), (nextHost) => retainMaterializedReplacementOwnerChain(nextHost, instance, retainedInstances));
|
|
7312
7358
|
}
|
|
7313
7359
|
const placeholder = host;
|
|
7314
7360
|
if (syncComponentFragmentRange(placeholder, instance, result, false)) return placeholder;
|
|
@@ -7321,7 +7367,7 @@ function replaceComponentRange(instance, result, host) {
|
|
|
7321
7367
|
restoreDomCommitScope(previousInstance);
|
|
7322
7368
|
}
|
|
7323
7369
|
}
|
|
7324
|
-
return beginComponentHostReplacement(instanceHost, instance, instance.target, retainedInstances).replace(() => materializeComponentResultNode(instance, result, getParentNamespace(parent)), (nextHost) =>
|
|
7370
|
+
return beginComponentHostReplacement(instanceHost, instance, instance.target, retainedInstances).replace(() => materializeComponentResultNode(instance, result, getParentNamespace(parent)), (nextHost) => retainMaterializedReplacementOwnerChain(nextHost, instance, retainedInstances));
|
|
7325
7371
|
}
|
|
7326
7372
|
//#endregion
|
|
7327
7373
|
//#region src/renderer/index.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as Fragment, t as ELEMENT_TYPE } from "./jsx-C3IECePB.js";
|
|
2
|
-
import { _ as readScope, d as defineScope } from "./component-internal-
|
|
3
|
-
import { p as isPromiseLike } from "./lifecycle-batch-
|
|
4
|
-
import {
|
|
5
|
-
import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-
|
|
6
|
-
import { c as withTelemetry, t as createQueryPrefetchContext } from "./query-registry-
|
|
7
|
-
import { c as removeRouteBasePath, i as getMatchingRouteRecord, l as buildRouteContext, o as addRouteBasePath, s as normalizeRouteBasePath, u as buildRouteContextBase, v as getActiveRouteAuthOptions } from "./route-matching-
|
|
2
|
+
import { _ as readScope, d as defineScope } from "./component-internal-DlAkCgBE.js";
|
|
3
|
+
import { p as isPromiseLike } from "./lifecycle-batch-Cyfd07rf.js";
|
|
4
|
+
import { S as withPageFramework, b as replacePageRoute, n as getActiveRenderContext } from "./render-context-B7ohlh6t.js";
|
|
5
|
+
import { i as ROUTE_ROOT_COMPONENT } from "./csp-nonce-ByMbWv8s.js";
|
|
6
|
+
import { c as withTelemetry, t as createQueryPrefetchContext } from "./query-registry-qm13pEdK.js";
|
|
7
|
+
import { c as removeRouteBasePath, i as getMatchingRouteRecord, l as buildRouteContext, o as addRouteBasePath, s as normalizeRouteBasePath, u as buildRouteContextBase, v as getActiveRouteAuthOptions } from "./route-matching-Bo6UqG-5.js";
|
|
8
8
|
//#region src/router/route-data-loader.ts
|
|
9
9
|
var RouteDataLoadError = class extends Error {
|
|
10
10
|
constructor(route, phase, cause) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as enqueueRuntimeLane,
|
|
2
|
-
import { f as getCurrentComponentInstance } from "./component-scope-
|
|
3
|
-
import { c as registerCommitOperationForInstance, f as getCurrentContextFrame, y as withAsyncResourceContext } from "./component-internal-
|
|
4
|
-
import { p as isPromiseLike } from "./lifecycle-batch-
|
|
1
|
+
import { t as enqueueRuntimeLane, y as logger } from "./access-DSkccuEI.js";
|
|
2
|
+
import { f as getCurrentComponentInstance } from "./component-scope-4I3yEMkb.js";
|
|
3
|
+
import { c as registerCommitOperationForInstance, f as getCurrentContextFrame, y as withAsyncResourceContext } from "./component-internal-DlAkCgBE.js";
|
|
4
|
+
import { p as isPromiseLike } from "./lifecycle-batch-Cyfd07rf.js";
|
|
5
5
|
import { t as brandSnapshotSource } from "./snapshot-source-BB42xgwb.js";
|
|
6
|
-
import { a as getResourceVerificationSnapshot, i as getNextRenderKey, n as getActiveRenderContext, o as isHydrationVerificationRender, p as throwSSRDataMissing, r as getCurrentRenderData, s as recordResourceVerificationSnapshot
|
|
7
|
-
import { t as state } from "./state-
|
|
6
|
+
import { C as SSRDataMissingError, a as getResourceVerificationSnapshot, i as getNextRenderKey, n as getActiveRenderContext, o as isHydrationVerificationRender, p as throwSSRDataMissing, r as getCurrentRenderData, s as recordResourceVerificationSnapshot } from "./render-context-B7ohlh6t.js";
|
|
7
|
+
import { t as state } from "./state-XPZYUzHL.js";
|
|
8
8
|
//#region src/runtime/resource-cell.ts
|
|
9
9
|
/**
|
|
10
10
|
* Pure, component-agnostic ResourceCell state machine.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as onRouteChange, n as RouteChangeOptions, t as RouteChangeCleanup } from "../activity-
|
|
1
|
+
import { P as getSignal } from "../index-DA3g8lm8.js";
|
|
2
|
+
import { i as onRouteChange, n as RouteChangeOptions, t as RouteChangeCleanup } from "../activity-DxUcygE5.js";
|
|
3
3
|
//#region src/runtime/resource-operation.d.ts
|
|
4
4
|
interface ResourceResult<T> {
|
|
5
5
|
value: T | null;
|