-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Description
Describe the bug
This is what the docs for await_waterfall warning recommend to do to avoid waterfalls:
let aPromise = $derived(one());
let bPromise = $derived(two());
let a = $derived(await aPromise);
let b = $derived(await bPromise);And this is what I'm doing:
let quotesPromise = $derived(getQuotes());
let authorsPromise = $derived(getAuthors());
let quotes = $derived(await quotesPromise);
let authors = $derived(await authorsPromise);I fail to see any difference between what I'm doing and what the docs tell me to do. Despite that, the waterfall and the warning are still there.
Reproduction
https://stackblitz.com/edit/svelte-waterfall-warning-repro?file=src%2Froutes%2F%2Bpage.svelte
Open the preview in new tab, so that you can see the console warning and the waterfall in devtools.
Logs
[svelte] await_waterfall (+page.svelte:7)
An async derived, `quotes` (src/routes/+page.svelte:7:14) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your appSystem Info
(StackBlitz container)
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
svelte: ^5.38 => 5.38.0Severity
blocking an upgrade
jdgamble555
Metadata
Metadata
Assignees
Labels
No labels