Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
680bbd9
feat(useAsync$): pollMs option
wmertens Feb 4, 2026
2f00c1c
feat(useAsync$): add pollMs accessor
wmertens Feb 5, 2026
8537839
feat(useAsync$): resume polling on the client from qidle
wmertens Feb 5, 2026
efa0a01
changeset
wmertens Feb 5, 2026
94adbfe
feat(useAsync$): add `initial` option
wmertens Feb 5, 2026
94876f7
perf(signal): small memory improvement
wmertens Feb 6, 2026
e9ed051
fix(core): don't crash on missing container
wmertens Feb 6, 2026
4380740
refactor(container): single pending count
wmertens Feb 6, 2026
93636f3
refactor(useAsync$): wait for load on server
wmertens Feb 7, 2026
05ea38f
fix(computed): always run effects on change
wmertens Feb 7, 2026
de64bea
refactor(async): improve cleanup handling and signal management
wmertens Feb 8, 2026
86c9e76
feat(async): `concurrency` option
wmertens Feb 8, 2026
1743b47
feat(async): abort signal support
wmertens Feb 8, 2026
56b823f
chore: pnpm dedupe
wmertens Feb 8, 2026
fe442bb
chore(docs): document `useAsync$` and update examples
wmertens Feb 9, 2026
8798758
fix(core): don't crash when printing vnode
wmertens Feb 9, 2026
d644a26
feat(async): `timeout`
wmertens Feb 9, 2026
70ea99d
fix(async): some edge cases
wmertens Feb 9, 2026
6f9200a
chore(core): remove resource tasks :tada:
wmertens Feb 9, 2026
e6c80e6
chore(docs): remove useResource mentions
wmertens Feb 10, 2026
0e6f119
chore: rename pollMs to interval
wmertens Feb 10, 2026
8c95150
feat(async): eagerCleanup
wmertens Feb 10, 2026
9856df5
feat(async): support `reason` in abort
wmertens Feb 10, 2026
054348d
chore: lint++
wmertens Feb 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/light-eels-lead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@qwik.dev/core': major
---

BREAKING: the `.promise()` method on `useAsync$` now returns a `Promise<void>` instead of `Promise<T>`, to avoid having to put `.catch()` on every call and to promote using the reactive `result.value` and `result.error` properties for handling async results and errors.
- the default serialization strategy for `useAsync$` is now 'always' instead of 'never', because it is likely to be expensive to get.
12 changes: 12 additions & 0 deletions .changeset/rich-peas-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@qwik.dev/core': minor
---

FEAT: `useAsync$()` now has `interval`, which re-runs the compute function on intervals. You can change signal.interval to enable/disable it, and if you set it during SSR it will automatically resume to do the polling.
This way, you can auto-update data on the client without needing to set up timers or events. For example, you can show a "time ago" string that updates every minute, or you can poll an API for updates, and change the poll interval when the window goes idle.

- FEAT: `useAsync$()` now has a `concurrency` option, which limits the number of concurrent executions of the compute function. If a new execution is triggered while the limit is reached, it will wait for the previous ones to finish before starting. This is useful for preventing overload when the compute function is expensive or when it involves network requests. The default value is 1, which means that a new execution will wait for the previous one to finish before starting. Setting it to 0 allows unlimited concurrent executions.
In-flight invocations will update the signal value only if they complete before a newer invocation completes. For example, if you have a search input that triggers a new `useAsync$` execution on every keystroke, results will show in the correct order.

- FEAT: `useAsync$()` now has an `abort()` method, which aborts the current computation and runs cleanups if needed. This allows you to cancel long-running tasks when they are no longer needed, such as when a component unmounts or when a new computation starts. The compute function needs to use the `abortSignal` provided to handle aborts gracefully.
When a new computation starts, the previous computation will be aborted via the abortSignal. This allows you to prevent unnecessary work and ensure that only the latest computation is active. For example, if you have a search input that triggers a new `useAsync$` execution on every keystroke, the previous search will be aborted when a new one starts, ensuring that only the latest search is performed.
5 changes: 5 additions & 0 deletions .changeset/slimy-swans-send.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@qwik.dev/core': minor
---

DEPRECATION: `useResource$` and `<Resource />` are now deprecated. `useAsync$` is more efficient, more flexible, and easier to use. Use `concurrency: 0` to have the same behavior as `useResource$`.
2 changes: 1 addition & 1 deletion packages/docs/src/components/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

.header-container.home-page-header {
background: transparent !important;
color: white;
color: black;
}

.header-open .header-container.home-page-header .menu-toolkit {
Expand Down
69 changes: 50 additions & 19 deletions packages/docs/src/routes/api/qwik/api.json

Large diffs are not rendered by default.

Loading