From 06452dabef178563ab0e5f5c36096971e42a02db Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 24 Jan 2025 13:54:51 -0800 Subject: [PATCH] also add a note to the migration guide --- documentation/docs/07-misc/07-v5-migration-guide.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/docs/07-misc/07-v5-migration-guide.md b/documentation/docs/07-misc/07-v5-migration-guide.md index ce95bf6ac7..8379f38d0d 100644 --- a/documentation/docs/07-misc/07-v5-migration-guide.md +++ b/documentation/docs/07-misc/07-v5-migration-guide.md @@ -51,6 +51,8 @@ A `$:` statement could also be used to create side effects. In Svelte 5, this is ``` +Note that [when `$effect` runs is different than `$:`]($effect#Understanding-dependencies). + > [!DETAILS] Why we did this > `$:` was a great shorthand and easy to get started with: you could slap a `$:` in front of most code and it would somehow work. This intuitiveness was also its drawback the more complicated your code became, because it wasn't as easy to reason about. Was the intent of the code to create a derivation, or a side effect? With `$derived` and `$effect`, you have a bit more up-front decision making to do (spoiler alert: 90% of the time you want `$derived`), but future-you and other developers on your team will have an easier time. >