#8801·qwik

[v2] Pending deferral through component: deeper cursor-boundary propagation fix

Author: maiieulCreated Jul 6, 2026Updated Sep 29, 2026
LabelsenhancementruntimeV2reactivity

Context

The addCursorBoundary walk-up in packages/qwik/src/core/use/use-cursor-boundary.ts:38-52 (fix 50c9666e2, landed on the ErrorBoundary PR #8745 branch) makes a suspending child register against the nearest cursor boundary by walking slotParent || parent. It fixes a real bug — a <Suspense> whose deferred child sits behind an intervening stateful component (e.g. an <ErrorBoundary>, which adds dirty component frames) did not show the Suspense fallback on client nav and instead blocked. The fix is Suspense-generic, but it currently only has ErrorBoundary-shaped coverage.

Three related follow-ups:

1. Add a non-EB walk-up test

suspense.e2e.ts / suspense.spec.tsx have no intervening-component client-deferral case (verified untouched vs base). Add a plain-wrapper test: a non-EB stateful component (e.g. useStore + useContextProvider) projecting a suspending child, asserting the Suspense fallback shows during client navigation. The user-facing behavior is already proven by the EB suites; this covers the generic path.

2. Extract the fix to build/v2

It's EB-independent and self-contained (one file + .changeset/suspense-deferral-through-component.md), so it fits the copy-not-move extraction pattern used for #8790 / #8791 / #8772. Blocked on (1) — a standalone PR needs the non-EB test.

3. Deeper follow-up: repair downward cursor-boundary propagation

The registration-site walk is a bounded mitigation on the rare blocking-promise path (sole caller: cursor-walker.ts:206, inside the isPromise(result) branch — not the hot dirty-mark path). The cleaner fix is to repair the downward NEAREST_CURSOR_BOUNDARY inheritance itself, so projected children of a dirty intervening component inherit the boundary — likely expectSlot (vnode-diff.ts ~735, which overwrites the slot boundary to null instead of inheriting the parent's) and/or setNearestCursorBoundary propagation (vnode-dirty.ts). That path runs on every dirty-mark, so it needs benchmarking + the full suspense suite before it can replace the registration-site walk.

None of this blocks #8745 (the shipped behavior is proven by the EB suites).