You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4d271cf
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: documentation/solid-2.0/05-async-data.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -357,6 +357,16 @@ The promise is safe to ignore — fire-and-forget `refresh()` is unchanged, and
357
357
358
358
Refresh granularity is the granularity of the _derive function_: there is no per-path refetch to re-run, so refresh a derived store by passing its root (`refresh(todos)`, not `refresh(todos.items[0])`) — that re-asks the whole projection, and reads through any nested node after the `await` are fresh. Inside actions, `yieldrefresh(x)` is the mutate-then-refetch sequencing primitive — see RFC 06.
359
359
360
+
Inside an action, call `refresh(x)` from the generator. It doesn't need a `yield` unless the action needs the fresh value. Don't call it after an `await`, including inside an async helper the action yields: that code runs outside the action's transaction, like any write there. Awaiting it there also hangs. The waiter waits for the action's commit, and the commit waits for the helper. So it works until `x` happens to re-run during the action, and then it hangs:
361
+
362
+
```js
363
+
constlike=action(function* () {
364
+
setLikes(likes() +1);
365
+
yieldsaveLike(); // async helper: no refresh() inside it
366
+
refresh(post); // in the generator; `yield refresh(post)` only to wait for the fresh value
In 1.x, `mutate` replaced the resource value wholesale. This had several problems: no granular updates (the entire list re-rendered), no reconciliation (identity lost on every mutation), and no protection against race conditions (concurrent mutations could clobber each other):
Copy file name to clipboardExpand all lines: scripts/size/scenarios.js
+11-6Lines changed: 11 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -5073,6 +5073,7 @@ module.exports = [
5073
5073
// Writable memo write clears its error without a torn read (#4110, 2026-10-20, over next @ 7014aca4, accepted by the maintainer): 33.18 -> 33.20 KB, recorded minified 101,384 -> 101,444 B, measured locally (linux) at 33,190 B brotli / 101,444 B minified (+60 B minified over the recorded size), which includes #4163's +9 B merged without re-recording: a write to an errored writable memo recovers it at commit and keeps the error shown until then, and clears an error a pass staged under the same hold. Correctness; matches CI's numbers.
5074
5074
// Verdict-mount lane provenance for nested first passes (#4166, 2026-10-20, over next @ 5a4b2e85): cap 33.20 KB unchanged, recorded minified 101,444 -> 101,429 B (-15 B), measured in CI at 33,170 B brotli. A module-local laneRoot carries the mount's lane through nested first passes, gated on the lane engine, so bundles without it shrink. Size-Exception accepted by the maintainer (2026-10-20). Cap at measured + 10 B rounded up to 0.01 KB, never lowered here; recorded minified = measured.
5075
5075
// Throwing cleanups no longer abort teardown (#4213, 2026-10-21, over next @ a2a5b6f8): 33.20 KB -> 33.27 KB, recorded minified 101,429 -> 101,526 B (+97 B), measured in CI at 33,255 B brotli. Every onCleanup and effect cleanup runs when one throws; the first error is rethrown by a root's dispose() or at the end of the flush. Size-Exception accepted by the maintainer (2026-10-21). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
5076
+
// Bug-fix batch (2026-10-26, over next @ 95dd480f): frozen floor 33.27 -> 33.36 KB, recorded minified 101,526 -> 101,535 B (+9 B), measured in CI at 33,343 B brotli. Re-recorded with the live-page raise so later PRs measure against next; growth is the 2026-10-26 bug-fix batch (#4279 hydrated Errored, #4281, #4280, #4277, #4278; net of #4261 moveBefore). Size-Exception accepted by the maintainer (2026-10-26). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
5076
5077
limit: floorCaps["page: base server components (hydrating + dynamic + frames + sf reference)"],
5077
5078
capMinified:
5078
5079
floorMinified["page: base server components (hydrating + dynamic + frames + sf reference)"],
@@ -5415,6 +5416,7 @@ module.exports = [
5415
5416
// Verdict-mount lane provenance for nested first passes (#4166, 2026-10-20, over next @ 5a4b2e85): 37.48 KB -> 37.53 KB, recorded minified 114,982 -> 115,031 B (+49 B), measured in CI at 37,516 B brotli. A module-local laneRoot carries the mount's lane through nested first passes, gated on the lane engine, so bundles without it shrink. Size-Exception accepted by the maintainer (2026-10-20). Cap at measured + 10 B rounded up to 0.01 KB, never lowered here; recorded minified = measured.
5416
5417
// Throwing cleanups no longer abort teardown (#4213, 2026-10-21, over next @ a2a5b6f8): 37.53 KB (unchanged), recorded minified 115,031 -> 115,011 B (-20 B), measured in CI at 37,512 B brotli. Every onCleanup and effect cleanup runs when one throws; the first error is rethrown by a root's dispose() or at the end of the flush. Size-Exception accepted by the maintainer (2026-10-21). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
5417
5418
// Keyed optimistic guess folds a correction (D-34, #4210, 2026-10-21, re-measured over next @ db8241ce): frozen floor 37.53 -> 37.64 KB, recorded minified 115,011 -> 115,136 B (+125 B: +110 B the lane engine's fold hooks, as `signals: + isPending/latest`, the rest brotli/mangle layout), measured locally (linux) at 37,627 B brotli. Size-Exception: the maintainer accepted the keyed-fold size cost (2026-10-22). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
5419
+
// Bug-fix batch (2026-10-26, over next @ 95dd480f): frozen floor 37.64 -> 37.72 KB, recorded minified 115,136 -> 115,193 B (+57 B), measured in CI at 37,710 B brotli. Growth is the 2026-10-26 bug-fix batch: #4279 hydrated Errored runs its content in the hydration pass (+82 B minified), #4281 latest()-first throw (+51), #4280 derived store follows a memo's pending/errors (+15), #4277 outer boundary recovers after an inner rethrow (+11), #4278 per-key isPending (+11), net of #4261 moveBefore (-39) and layout. Size-Exception accepted by the maintainer (2026-10-26). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
5418
5420
limit: floorCaps["page: live server components (base + live/GET + action + isPending/latest)"],
5419
5421
capMinified:
5420
5422
floorMinified["page: live server components (base + live/GET + action + isPending/latest)"],
@@ -5574,8 +5576,9 @@ module.exports = [
5574
5576
// Writable memo write clears its error without a torn read (#4110, 2026-10-20, over next @ 7014aca4, accepted by the maintainer): 35.23 KB (unchanged), recorded minified 107,725 -> 107,785 B, measured locally (linux) at 35,212 B brotli / 107,785 B minified (+60 B minified over the recorded size), which includes #4163's +9 B merged without re-recording: a write to an errored writable memo recovers it at commit and keeps the error shown until then, and clears an error a pass staged under the same hold. Correctness; matches CI's numbers.
5575
5577
// Verdict-mount lane provenance for nested first passes (#4166, 2026-10-20, over next @ 5a4b2e85): 35.23 KB -> 35.30 KB, recorded minified 107,785 -> 107,770 B (-15 B), measured in CI at 35,285 B brotli. A module-local laneRoot carries the mount's lane through nested first passes, gated on the lane engine, so bundles without it shrink. Size-Exception accepted by the maintainer (2026-10-20). Cap at measured + 10 B rounded up to 0.01 KB, never lowered here; recorded minified = measured.
5576
5578
// Throwing cleanups no longer abort teardown (#4213, 2026-10-21, over next @ a2a5b6f8): 35.30 KB (unchanged), recorded minified 107,770 -> 107,876 B (+106 B), measured in CI at 35,271 B brotli. Every onCleanup and effect cleanup runs when one throws; the first error is rethrown by a root's dispose() or at the end of the flush. Size-Exception accepted by the maintainer (2026-10-21). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
5577
-
limit: "35.30 KB",
5578
-
capMinified: 107876,
5579
+
// Bug-fix batch (2026-10-26, over next @ 95dd480f): 35.30 -> 35.34 KB, recorded minified 107,876 -> 107,894 B (+18 B), measured in CI at 35,322 B brotli. Re-recorded with the live-page raise; growth is the 2026-10-26 bug-fix batch (#4279 hydrated Errored, #4281, #4280, #4277, #4278; net of #4261 moveBefore). Accepted by the maintainer (2026-10-26). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
5580
+
limit: "35.34 KB",
5581
+
capMinified: 107894,
5579
5582
alias: pageAlias
5580
5583
},
5581
5584
{
@@ -5705,8 +5708,9 @@ module.exports = [
5705
5708
// Verdict-mount lane provenance for nested first passes (#4166, 2026-10-20, over next @ 5a4b2e85): 41.31 KB -> 41.42 KB, recorded minified 122,967 -> 123,015 B (+48 B), measured in CI at 41,410 B brotli. A module-local laneRoot carries the mount's lane through nested first passes, gated on the lane engine, so bundles without it shrink. Size-Exception accepted by the maintainer (2026-10-20). Cap at measured + 10 B rounded up to 0.01 KB, never lowered here; recorded minified = measured.
5706
5709
// Throwing cleanups no longer abort teardown (#4213, 2026-10-21, over next @ a2a5b6f8): 41.42 KB (unchanged), recorded minified 123,015 -> 123,010 B (-5 B), measured in CI at 41,403 B brotli. Every onCleanup and effect cleanup runs when one throws; the first error is rethrown by a root's dispose() or at the end of the flush. Size-Exception accepted by the maintainer (2026-10-21). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
5707
5710
// Keyed optimistic guess folds a correction (D-34, #4210, 2026-10-21, accepted by the maintainer 2026-10-22, re-measured over next @ db8241ce): 41.42 -> 41.47 KB, recorded minified 123,010 -> 123,120 B (+110 B: the page carries the lane engine's fold hooks, as `signals: + isPending/latest`), measured locally (linux) at 41,452 B brotli. Correctness. Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
5708
-
limit: "41.47 KB",
5709
-
capMinified: 123120,
5711
+
// Bug-fix batch (2026-10-26, over next @ 95dd480f): 41.47 KB -> 41.56 KB, recorded minified 123,120 -> 123,192 B (+72 B), measured in CI at 41,547 B brotli. Same growth as the live floor: the 2026-10-26 bug-fix batch: #4279 hydrated Errored runs its content in the hydration pass (+82 B minified), #4281 latest()-first throw (+51), #4280 derived store follows a memo's pending/errors (+15), #4277 outer boundary recovers after an inner rethrow (+11), #4278 per-key isPending (+11), net of #4261 moveBefore (-39) and layout. Accepted by the maintainer (2026-10-26). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
5712
+
limit: "41.56 KB",
5713
+
capMinified: 123192,
5710
5714
alias: pageAlias
5711
5715
},
5712
5716
{
@@ -6082,8 +6086,9 @@ module.exports = [
6082
6086
// Verdict-mount lane provenance for nested first passes (#4166, 2026-10-20, over next @ 5a4b2e85): cap 46.91 KB unchanged, recorded minified 140,258 -> 140,296 B (+38 B), measured in CI at 46,884 B brotli. A module-local laneRoot carries the mount's lane through nested first passes, gated on the lane engine, so bundles without it shrink. Size-Exception accepted by the maintainer (2026-10-20). Cap at measured + 10 B rounded up to 0.01 KB, never lowered here; recorded minified = measured.
6083
6087
// Throwing cleanups no longer abort teardown (#4213, 2026-10-21, over next @ a2a5b6f8): 46.91 KB -> 46.96 KB, recorded minified 140,296 -> 140,292 B (-4 B), measured in CI at 46,942 B brotli. Every onCleanup and effect cleanup runs when one throws; the first error is rethrown by a root's dispose() or at the end of the flush. Size-Exception accepted by the maintainer (2026-10-21). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
6084
6088
// Keyed optimistic guess folds a correction (D-34, #4210, 2026-10-21, accepted by the maintainer 2026-10-22, re-measured over next @ db8241ce): 46.96 -> 47.01 KB, recorded minified 140,292 -> 140,402 B (+110 B: the page carries the lane engine's fold hooks, as `signals: + isPending/latest`), measured locally (linux) at 46,993 B brotli. Correctness. Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
6085
-
limit: "47.01 KB",
6086
-
capMinified: 140402,
6089
+
// Bug-fix batch (2026-10-26, over next @ 95dd480f): 47.01 KB -> 47.11 KB, recorded minified 140,402 -> 140,456 B (+54 B), measured in CI at 47,099 B brotli. Same growth as the live floor: the 2026-10-26 bug-fix batch: #4279 hydrated Errored runs its content in the hydration pass (+82 B minified), #4281 latest()-first throw (+51), #4280 derived store follows a memo's pending/errors (+15), #4277 outer boundary recovers after an inner rethrow (+11), #4278 per-key isPending (+11), net of #4261 moveBefore (-39) and layout. Accepted by the maintainer (2026-10-26). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
0 commit comments