Skip to content

cursor-based SSR, Suspense, out-of-order streaming#8431

Draft
wmertens wants to merge 20 commits intobuild/v2from
ssr-cursors
Draft

cursor-based SSR, Suspense, out-of-order streaming#8431
wmertens wants to merge 20 commits intobuild/v2from
ssr-cursors

Conversation

@wmertens
Copy link
Copy Markdown
Member

not reviewed yet, sneak preview

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 13, 2026

🦋 Changeset detected

Latest commit: 953755c

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@maiieul maiieul moved this to In progress in Qwik Development Mar 13, 2026
@wmertens wmertens force-pushed the ssr-cursors branch 3 times, most recently from bf7fc04 to 1bf2eab Compare March 15, 2026 10:12
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 15, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview b986b06

@wmertens wmertens added the V2 label Mar 15, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 15, 2026

Open in StackBlitz

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8431
npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8431
npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8431
npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8431

commit: b986b06

@wmertens wmertens force-pushed the ssr-cursors branch 3 times, most recently from 401ec33 to 0978dd0 Compare March 20, 2026 12:08
wmertens added 4 commits April 1, 2026 21:31
Use-id E2E hang investigation results:

The hang occurs for deeply nested component trees (3+ levels with multiple children per level)
Root cause identified: When the emit loop's BLOCKED_DIRTY case awaits (via setImmediate or microtask), the triggerCursors microtask from addCursor runs processCursorQueue with unlimited timeBudget: 0. This microtask-driven walk somehow completes the cursor but leaves $renderPromise$ unresolved, causing the emit loop to hang on await this.$renderPromise$
Setting yieldBudget: 0 (no yielding) fixes the use-id hang but breaks projection tests that need async yielding for microtask processing
Fix applied: Changed BLOCKED_DIRTY yield from setImmediate (macrotask, ~10ms overhead) to Promise.resolve() (microtask, near-zero overhead). This fixes the O(n) macrotask overhead but doesn't fully resolve the deep nesting hang
Defensive fix applied: Added $checkPendingCount$() in processCursorQueue's catch block to prevent hangs when a cursor errors out
The use-id E2E test hang is a pre-existing issue on the ssr-cursors branch that needs deeper investigation into the interaction between triggerCursors microtasks and the emit loop's $renderPromise$ handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants