Title: [Feature]: Client async-concurrency primitives — Suspense / transition / deferred-value · Issue #135 · bQuery/bQuery · GitHub
Open Graph Title: [Feature]: Client async-concurrency primitives — Suspense / transition / deferred-value · Issue #135 · bQuery/bQuery
X Title: [Feature]: Client async-concurrency primitives — Suspense / transition / deferred-value · Issue #135 · bQuery/bQuery
Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case bQuery has worker-based concurrency and SSR defer, and async data li...
Open Graph Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case bQuery has worker-based conc...
X Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case bQuery has worker-based conc...
Opengraph URL: https://github.com/bQuery/bQuery/issues/135
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Feature]: Client async-concurrency primitives — Suspense / transition / deferred-value","articleBody":"**Pre-flight checklist**\n- [x] I searched existing issues and did not find a duplicate request.\n- [x] I explained the problem or use case, not just the desired API.\n\n**Problem or use case**\nbQuery has worker-based concurrency and SSR `defer`, and async data lives in `reactive` (`useAsyncData`/`useFetch`), but there is **no UI-level concurrency model** for keeping the interface responsive during async work: no Suspense-equivalent for declarative loading boundaries, no transition primitive to mark non-urgent updates, and no deferred-value primitive to debounce expensive derived UI. React 19 (`\u003cSuspense\u003e`, `useTransition`, `useDeferredValue`) and Svelte 5 (`await` + `$effect.pending()`) both ship these, and their absence is a visible capability gap for interactive apps.\n\n**Proposed solution**\nAdd client concurrency primitives that build on existing signals: a declarative async boundary (Suspense-equivalent) that shows fallback UI while tracked async work is pending, a `transition` primitive that flags updates as non-urgent so input stays responsive, and a `deferred` signal wrapper that lags behind its source to throttle expensive recomputation. Keep them in or adjacent to `concurrency`/`reactive`, zero-dependency and tree-shakeable.\n\n**Possible API or UX shape**\n```ts\nimport { suspense, startTransition, deferred } from \"@bquery/bquery/concurrency\";\n\n// declarative async boundary in the view layer\n// \u003cdiv bq-suspense=\"userResource\" bq-fallback=\"Loading…\"\u003e…\u003c/div\u003e\n\nconst [isPending, start] = startTransition();\nstart(() =\u003e filter.value = nextQuery); // non-urgent, keeps input snappy\n\nconst deferredQuery = deferred(query); // lags source; drives expensive list\n```\n\n**Alternatives considered**\nTelling users to debounce manually and roll their own loading flags — works but is boilerplate every app reinvents, and has no parity with the ergonomic primitives competitors ship. Folding this into the worker `concurrency` API — different concern; worker concurrency is about offloading CPU, this is about UI scheduling, so they should be distinct primitives even if co-located.\n\n**Relevant area**\n`concurrency`\n\n**Additional context**\nThis closes one of the clearest React-parity gaps. Pairs with SSR suspense streaming (`renderToStreamSuspense`/`defer`) so the same async boundaries can stream on the server and suspend on the client.\n","author":{"url":"https://github.com/JosunLP","@type":"Person","name":"JosunLP"},"datePublished":"2026-06-26T21:25:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/135/bQuery/issues/135"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eeb4239e-3bcc-ab56-f41f-46a1e00d97fd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9060:5105D:3784D97:4C97E8B:6A4F3A97 |
| html-safe-nonce | 3b29f75a3d3b34e9e31279b9530d132d9be4aff77a6cb5cce8611a0263dcd949 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDYwOjUxMDVEOjM3ODREOTc6NEM5N0U4Qjo2QTRGM0E5NyIsInZpc2l0b3JfaWQiOiI5MTQ3MDUwNzk2MjA1OTQ3NTQzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2fe05189fa3b521e66aa94ace68bd1692ba99a238930c005c035bd335c686ef7 |
| hovercard-subject-tag | issue:4755237523 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bQuery/bQuery/135/issue_layout |
| twitter:image | https://opengraph.githubassets.com/473120799773c05f302f9e9af8d5624c04b70fb7e772a226fe1be4d59b8995ea/bQuery/bQuery/issues/135 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/473120799773c05f302f9e9af8d5624c04b70fb7e772a226fe1be4d59b8995ea/bQuery/bQuery/issues/135 |
| og:image:alt | Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case bQuery has worker-based conc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JosunLP |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git |
| octolytics-dimension-user_id | 256381806 |
| octolytics-dimension-user_login | bQuery |
| octolytics-dimension-repository_id | 1139284244 |
| octolytics-dimension-repository_nwo | bQuery/bQuery |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1139284244 |
| octolytics-dimension-repository_network_root_nwo | bQuery/bQuery |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width