fix(signals): suspend uninitialized async across lanes - #3277
Conversation
🦋 Changeset detectedLatest commit: 2512a43 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
4193324 to
4c7560b
Compare
…uspends No behavior change. The uninitialized cross-lane suspension merged in 8f9f369 sat inline in core read()'s throw path, taxing every bundle — storeless floors included — for a check only reachable under an optimistic lane (which implies the engine is installed). Measured 27-66 B over across five size scenarios; next was over budget since the merge (Size is not a required check, which is how it landed red — same gap as #3262 this morning). In laneSuspends, only bundles retaining the optimistic module pay: every scenario is back under cap except isPending/latest, which retains the module via latest()'s shadow and pays ~8 B — ratcheted 10.05 -> 10.08 with the audit note. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Follow-up note: this merged while I was preparing a size-relocated variant, so the relocation landed as fa568d3 on top — same semantics, but the uninitialized check now lives in |
Fixes #3276.
An uninitialized async source has no committed stale value to show. Suspend it even when the reader is running under a different optimistic lane, so a
latest()-conditioned branch keeps its existing DOM until the source resolves.Adds a DOM regression test covering
latest(entangle) ? asyncValue() : ....Tests:
pnpm exec vitest run test/latest-conditional-async-issue-3276.spec.tsx test/latest-async.spec.tsx test/latest-banner-landing-gap.spec.tsx test/latest-ispending-issue-3041.spec.tsx test/ispending-gated-landing.spec.tsx test/loading.spec.tsx test/dev-warning.spec.tsxJSX_COMPILER=babel pnpm exec vitest run test/latest-conditional-async-issue-3276.spec.tsx