fix: resolve Svelte 5 reactivity warnings#2895
Conversation
Eliminates all state_referenced_locally and non_reactive_update warnings surfaced by svelte-check. svelte-check now reports 0 errors, 0 warnings. - Wrap top-level prop/data reads in $derived so access happens in a reactive context - Wrap one-time initializer reads (setContext, $state initialization, side-effect blocks) in untrack to acknowledge intentional snapshots - Switch melt-ui Tooltip config options to getters so reactivity is preserved without triggering the warning - Declare bind:this target activePill with $state in skills.svelte
Greptile SummaryMechanical Svelte 5 reactivity fix across 46 files. Props computed outside reactive contexts are wrapped in Confidence Score: 5/5Safe to merge — changes are mechanical reactivity fixes with no behavioural regressions identified. All 46 changes consistently apply one of three well-understood patterns ( No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "use toSorted to avoid mutating data.filt..." | Re-trigger Greptile |
Array.prototype.sort mutates in place; switch to toSorted so the $derived returns a new array instead of mutating the prop-derived source.
Summary
state_referenced_locallyandnon_reactive_updatewarnings surfaced bysvelte-checkand the build (svelte-checknow reports 0 errors, 0 warnings on this branch).Approach
$derivedwraps top-level reads of props /dataso access happens in a reactive context (e.g.ticket-card,button,noise,Storage_Image,Heading,Link,Call_To_Action,Partner, blog page, changelog entry, threads, integrations, animated text, etc.).untrackwraps one-time initializers where only the initial snapshot is meaningful (setContextpayloads in the 17 tutorial + blog layouts,$state(...)seeded from props inscale/customize/map/threads, and the mid-CTA init block inHeading).melt-uiconfig options to getters so reactivity is preserved without firing the warning.activePillnow declared with$state()(fixesnon_reactive_update).untrackblocks.The two remaining build-time messages (
vite-plugin-svelte rolldown-vite experimentalandoptimizeDeps.esbuildOptions deprecated) originate from plugin internals and will resolve whenvite-plugin-sveltelands full rolldown support — not addressable here.Test plan
bun run check→0 errors and 0 warningsbun run formatpassesbun run buildcompletes without new warnings/blog,/blog/[page],/changelog/entry/*,/init/tickets/[username],/init/tickets/customize,/integrations,/threads,/threads/[id]