tezvyn:

Svelte's Legacy immutable={true} Optimization

Source: svelte.devadvanced

The `immutable={true}` option was a contract with the Svelte 3/4 compiler: you promise to never mutate data, and it uses fast referential checks for updates. It was a performance boost for immutable patterns.

The `immutable={true}` option was a contract with the Svelte 3/4 compiler: you promise to never mutate objects or arrays, and in return, it uses fast referential equality checks (===) to detect changes. This was a key performance optimization for apps using immutable data patterns. The primary footgun is that if you accidentally mutate data (e.g., array.push), the UI won't update because the object reference hasn't changed. This option is deprecated in Svelte 5 and non-functional in runes mode.

Read the original → svelte.dev

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Svelte's Legacy immutable={true} Optimization · Tezvyn