Title: feat(concurrency): CSP-safe module workers + client async primitives + graduate toward Stable (#133, #134, #135) by JosunLP · Pull Request #154 · bQuery/bQuery · GitHub
Open Graph Title: feat(concurrency): CSP-safe module workers + client async primitives + graduate toward Stable (#133, #134, #135) by JosunLP · Pull Request #154 · bQuery/bQuery
X Title: feat(concurrency): CSP-safe module workers + client async primitives + graduate toward Stable (#133, #134, #135) by JosunLP · Pull Request #154 · bQuery/bQuery
Description: Collected work for the three open concurrency tickets, landed in one branch and targeting dev. Closes #133. Closes #134. Closes #135. #134 — CSP-safe module workers (remove the mandatory 'unsafe-eval') defineWorker() / defineRpcWorker() describe a pre-bundled worker module by URL on the main thread; exposeTask() / exposeRpc() wire that module up to the bQuery worker protocol inside the worker. Because the body is a real module loaded by URL — never a function revived with new Function(...) — module mode runs under a strict CSP with no 'unsafe-eval' and no blob: worker source. Every factory now accepts either an inline handler (dynamic mode, opt-in, needs 'unsafe-eval') or a WorkerModule (module mode, default/recommended): runTask, createTaskWorker, createTaskPool, createRpcWorker, createRpcPool, callWorkerMethod, and the reactive wrappers — additive and non-breaking via the WorkerTaskSource / WorkerRpcSource unions. isWorkerModule(), isModuleWorkerSupported(), and support.moduleWorker (module mode requires only the Worker constructor, not Blob/URL.createObjectURL). #135 — Client async-concurrency primitives (UI scheduling) suspense() — declarative async boundary aggregating promises and reactive async states (useAsyncData/useResource) into reactive pending / settled / error signals; retrigger option; dispose(). startTransition() — [isPending, start]; start(scope) flips pending immediately then runs the scope on a low-priority schedule inside a batch, decoupling expensive updates from urgent input. A throwing scope is contained and reported (mirrors effect()), never escapes as an uncaught timer error. deferred() — readonly signal that lags its source and coalesces rapid changes to throttle expensive derived UI. Built on signals, zero-dependency, tree-shakeable; a distinct concern from worker concurrency. Pairs with SSR suspense streaming (renderToStreamSuspense/defer). #133 — promote concurrency toward Stable Guide Stability section: exit-criteria checklist, frozen surface, runtime boundary (browser-focused per non-goals), and a per-environment support matrix; intro + README notes; version history. Serializable-handler constraint documented + enforced (dynamic mode) with a clear TaskWorkerSerializationError; module mode is exempt by design. Zero-dependency & secure-by-default No runtime dependencies added; each primitive is independently importable/tree-shakeable. Module mode is the documented CSP-clean default, resolving the 'unsafe-eval' requirement most at odds with bQuery's security posture. Verification Full suite 2811 pass / 0 fail (26 new in tests/concurrency-stable.test.ts: module task/RPC/pool execution with no blob/eval available, exposeTask/exposeRpc protocol, support detection, and the client primitives incl. throwing-scope containment, deferred coalescing, suspense promise/state aggregation). tsc, eslint, bun run build, check:full-bundle (in sync), check:doc-exports (concurrency 37/37), and test:types all green. Review Ran an adversarial multi-agent review of the diff; applied the confirmed hardening: contain a throwing startTransition scope and report it via console.error instead of letting it escape as an uncaught timer/idle exception (mirrors effect()), with a regression test. 🤖 Generated with Claude Code
Open Graph Description: Collected work for the three open concurrency tickets, landed in one branch and targeting dev. Closes #133. Closes #134. Closes #135. #134 — CSP-safe module workers (remove the mandatory 'unsaf...
X Description: Collected work for the three open concurrency tickets, landed in one branch and targeting dev. Closes #133. Closes #134. Closes #135. #134 — CSP-safe module workers (remove the mandatory 'u...
Opengraph URL: https://github.com/bQuery/bQuery/pull/154
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ce259fff-098e-670e-4701-93590be32097 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D31E:9E5FA:15D10AD:1E1A793:6A4EA33E |
| html-safe-nonce | 812b6a2d76f29d3a1ddf0057a96f48423409a8717b17586e38f2f1a11a97d93c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzFFOjlFNUZBOjE1RDEwQUQ6MUUxQTc5Mzo2QTRFQTMzRSIsInZpc2l0b3JfaWQiOiI5MDI1Njk4NTY5NzI2NjMyNzY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ed44e1790ef0565150a021f21c9ee01cf0c64d2b957ab0565f409cf8edf221d3 |
| hovercard-subject-tag | pull_request:3951183931 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/bQuery/bQuery/pull/154/files |
| twitter:image | https://avatars.githubusercontent.com/u/20913954?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/20913954?s=400&v=4 |
| og:image:alt | Collected work for the three open concurrency tickets, landed in one branch and targeting dev. Closes #133. Closes #134. Closes #135. #134 — CSP-safe module workers (remove the mandatory 'unsaf... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width