@@ -24015,11 +24015,12 @@ function resolveHostPropSources(
2401524015
2401624016const SOURCES_PLAN = /* @__PURE__ */ Symbol('octane.host-prop-sources-plan');
2401724017/**
24018- * Consecutive failed plan verifications after which an element stops paying
24018+ * Consecutive failed plan verifications after which a host stops paying
2401924019 * attachSourcesPlan's per-commit allocations — a source shape that never
24020- * stabilizes reverts to the full path for good. ponytail: poisoned is
24021- * permanent; a shape that stabilizes later keeps the full path (reviving it
24022- * would take a decay or per-shape plans).
24020+ * stabilizes reverts to the full path for good. Lives on the committed
24021+ * resolved record beside SOURCES_PLAN, never on the DOM node. ponytail:
24022+ * poisoned is permanent; a shape that stabilizes later keeps the full path
24023+ * (reviving it would take a decay or per-shape plans).
2402324024 */
2402424025const SOURCES_PLAN_MISSES = /* @__PURE__ */ Symbol('octane.host-prop-sources-plan-misses');
2402524026const SOURCES_PLAN_MISS_LIMIT = 3;
@@ -24387,7 +24388,7 @@ function writePlannedDiff(
2438724388 * record to commit (`prev` itself when nothing changed) or null when there is
2438824389 * no plan, hydration is active, the shape changed, or signal handles appear —
2438924390 * the caller then takes the full path. Failed verifications count toward
24390- * SOURCES_PLAN_MISS_LIMIT, after which the element stops paying
24391+ * SOURCES_PLAN_MISS_LIMIT, after which the host stops paying
2439124392 * attachSourcesPlan's allocations entirely.
2439224393 */
2439324394function replaySourcesPlan(
@@ -24399,14 +24400,14 @@ function replaySourcesPlan(
2439924400 readStyle: ((value: unknown) => unknown) | undefined,
2440024401): Record<string, unknown> | null {
2440124402 if (activeHydration() !== null) return null;
24402- const plan = (prev as Record<symbol, unknown>)[SOURCES_PLAN] as ResolvedSourcesPlan | undefined;
24403+ const tagged = prev as Record<symbol, unknown>;
24404+ const plan = tagged[SOURCES_PLAN] as ResolvedSourcesPlan | undefined;
2440324405 if (plan === undefined) return null;
2440424406 if (!scanSourcesForPlan(sources, plan, prev, readStyle)) {
24405- const tagged = el as any;
2440624407 tagged[SOURCES_PLAN_MISSES] = ((tagged[SOURCES_PLAN_MISSES] as number | undefined) ?? 0) + 1;
2440724408 return null;
2440824409 }
24409- (el as any) [SOURCES_PLAN_MISSES] = 0;
24410+ if (tagged[SOURCES_PLAN_MISSES]) tagged [SOURCES_PLAN_MISSES] = 0;
2441024411 const next = buildFromSourcesPlan(plan, prev);
2441124412 if (
2441224413 next === prev &&
@@ -24636,14 +24637,17 @@ export function setHostPropSources(
2463624637 // allocations. The plan stamps the record actually retained — on an
2463724638 // unchanged commit resolvedHostPropsEqual just proved `prev` carries the
2463824639 // identical keys, so the plan replays correctly against it — rather than
24639- // dying with a discarded `resolved`. Elements whose scans keep failing stop
24640- // paying the attach once SOURCES_PLAN_MISS_LIMIT trips.
24641- if (
24642- !formHost &&
24643- prev !== undefined &&
24644- (((el as any)[SOURCES_PLAN_MISSES] as number | undefined) ?? 0) < SOURCES_PLAN_MISS_LIMIT
24645- )
24640+ // dying with a discarded `resolved`. Hosts whose scans keep failing stop
24641+ // paying the attach once SOURCES_PLAN_MISS_LIMIT trips. Copy the miss
24642+ // count onto a replacement record so poison survives the next resolve
24643+ // without becoming a DOM expando.
24644+ const misses =
24645+ prev === undefined
24646+ ? 0
24647+ : (((prev as Record<symbol, unknown>)[SOURCES_PLAN_MISSES] as number | undefined) ?? 0);
24648+ if (!formHost && prev !== undefined && misses < SOURCES_PLAN_MISS_LIMIT)
2464624649 attachSourcesPlan(el, out!, sources, winners);
24650+ if (out !== prev && misses !== 0) (out as Record<symbol, unknown>)[SOURCES_PLAN_MISSES] = misses;
2464724651 return out;
2464824652}
2464924653
0 commit comments