Skip to content

fix: report derived_invalid_export for export let x = $derived(...) - #18692

Merged
dummdidumm merged 2 commits into
sveltejs:mainfrom
giaBaoJS:fix/export-let-derived-error
Aug 25, 2026
Merged

dummdidumm merged 2 commits into
sveltejs:mainfrom
giaBaoJS:fix/export-let-derived-error

Conversation

@giaBaoJS

Copy link
Copy Markdown
Contributor

Fixes #15842

In runes mode, export const x = $derived(...) reports derived_invalid_export, which tells you what to do instead. export let x = $derived(...) reports legacy_export_invalid — "Cannot use export let in runes mode — use $props() instead" — which sends you off toward props, when the actual problem is that you are trying to export derived state.

Why it happens

ExportNamedDeclaration throws the legacy error as soon as it sees kind === 'let':

if (
	context.state.analysis.runes &&
	context.state.ast_type === 'instance' &&
	node.declaration.kind === 'let'
) {
	e.legacy_export_invalid(node);
}

That happens before the loop below ever looks at binding kinds, so derived_invalid_export is unreachable for let. const has no such early throw, which is exactly why the const form gets the better message.

The fix

Skip the early export let throw when the declaration binds derived state, so the more specific error below is the one that fires. Everything else keeps the message it had:

source (runes mode, instance script) before after
export let x = 5 legacy_export_invalid legacy_export_invalid
export let x; legacy_export_invalid legacy_export_invalid
export let x = $state(0) legacy_export_invalid legacy_export_invalid
export let x = $derived(s * 2) legacy_export_invalid derived_invalid_export
export let { a } = $derived(o) legacy_export_invalid derived_invalid_export
export const x = $derived(s * 2) derived_invalid_export derived_invalid_export

On the wording

I deliberately did not invent a new message — this reuses the existing derived_invalid_export text verbatim, so let and const now say the same thing. You said in the issue you weren't sure what the right wording is, and I did not want to pre-empt that; if you'd rather let said something of its own, or the shared message were reworded, I'm happy to change it.

I also left the export const foo = 42 question in your second paragraph alone. That's a separate call about whether exposing plain values on the instance is intended, and it seemed better not to bundle it in here.

Changes

  • 2-analyze/visitors/ExportNamedDeclaration.js: guard the early export let throw with a declares_derived() check
  • tests/compiler-errors/samples/runes-export-let-derived: export let double = $derived(count * 2) now expects derived_invalid_export

Test plan

pnpm test
#  Test Files  34 passed (34)
#  Tests  7754 passed | 69 skipped (7823)
#  (7753 on main, +1 from the new sample)

pnpm lint                    # clean
pnpm --filter svelte check   # clean

Reverting the ExportNamedDeclaration.js change turns the new sample red and nothing else:

FAIL packages/svelte/tests/compiler-errors/test.ts > runes-export-let-derived
AssertionError: expected 'legacy_export_invalid' to be 'derived_invalid_export'
Tests  1 failed | 146 passed (147)

The existing runes-export-let sample still expects legacy_export_invalid and still passes, so the legacy error has not been weakened — only made to yield when the derived error is the more accurate one.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 23, 2026 •

Copy link
Copy Markdown

Install the latest version of svelte from 814d478:

pnpm add https://pkg.svelte.dev/svelte/c/814d4780809fe5e1dea93d3d45f7f3c4c0eede2c

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/svelte/pr/18692

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Aug 23, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 814d478

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dummdidumm
dummdidumm merged commit 0f458d5 into sveltejs:main Aug 25, 2026
11 of 12 checks passed
@github-actions github-actions Bot mentioned this pull request Aug 25, 2026
dummdidumm pushed a commit that referenced this pull request Aug 28, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## svelte@5.57.0

### Minor Changes

- feat: export `RenderOutput`, `SyncRenderOutput`, `Csp` and
`Sha256Source` from `svelte/server`
([#18648](#18648))

- feat: add `has` function to `createContext`
([#18472](#18472))

- feat: support `defaultValue` on `<select>`
([#18591](#18591))

- feat: add getOrInsert/getOrInsertComputed to SvelteMap
([#18728](#18728))

### Patch Changes

- fix: block template store subscriptions on the promise that assigns
the store ([#18582](#18582))

- fix: route $derived teardown errors through invoke_error_boundary
([#18486](#18486))

- fix: track SvelteDate snapshots in reactions
([#18700](#18700))

- fix: remove `<svelte:head>` anchors on unmount
([#18697](#18697))

- fix: warn on undeclared shorthand event handlers on `<svelte:window>`,
`<svelte:document>` and `<svelte:body>`
([#18480](#18480))

- perf: reuse the cached value in the `<option>`/`<select>` value guard
([#18713](#18713))

- fix: prevent malformed AST output for `<select>` with static `value`
attribute ([#18449](#18449))

- fix: apply ownership mutation ignores to binding assignments
([#18718](#18718))

- fix: prevent onoutroend from firing twice when compilerOptions.hmr is
true ([#18655](#18655))

- fix: preserve whitespace after inline elements when printing
([#18685](#18685))

- perf: fold SSR block-open markers into the branch's first push
([#18712](#18712))

- fix: run `onDestroy` callbacks when a server render throws
([#18585](#18585))

- fix: report `derived_invalid_export` for `export let x =
$derived(...)` in runes mode
([#18692](#18692))

- fix: never apply class hash to elements inside `<svelte:head>`
([#18160](#18160))

- fix: keep `defaultChecked` on hydrated radio inputs with spread
attributes ([#18701](#18701))

- fix: accept `onfocusin`/`onfocusout` in
`a11y_mouse_events_have_key_events`
([#18689](#18689))

- perf: O(n²)→O(n) Map lookups for legacy `$:` reactive statement
ordering ([#18602](#18602))

- fix: distinct memoizer on style/class directives
([#18466](#18466))

- fix: measure nested transitions before applying their starting styles
([#18647](#18647))

- fix: don't turn component instances stored in `$state` into state
proxies ([#18646](#18646))

- perf: emit `$.only_child` for elements with a single child
([#18717](#18717))

- fix: omit `bind:focused` from SSR output (it has no HTML attribute)
([#18724](#18724))

- fix: more robust rendering of Svelte custom element slots
([#18710](#18710))

- perf: optimize simple object destructuring in `@const` tags
([#18390](#18390))

- fix: properly apply static textarea value attribute during CSR
([#18727](#18727))

- fix: end a restored reaction context at the end of its synchronous
segment ([#18694](#18694))

- fix: keep the dependencies of a reaction that throws, so deriveds it
read are neither leaked nor stuck in their error
([#18703](#18703))

- fix: don't resurrect outroing elements when an ancestor block is
paused and resumed
([#18431](#18431))

- perf: use `$.comment()` for single-comment templates
([#18714](#18714))

- chore: move `@types/trusted-types` to devDependencies
([#18730](#18730))

- perf: store setters cache as `Set` instead of `Array`
([#18251](#18251))

- fix: transform derived assignments and select function bindings
correctly during server-side rendering
([#18669](#18669))

- fix: keep boolean attributes with an empty string value when rendering
attribute objects on the server
([#18721](#18721))

- fix: sync `SvelteURL` port signal when the protocol setter clears the
port ([#18705](#18705))

- fix: block declaration tags and `{@const}` on async values read inside
closures ([#18533](#18533))

- fix: avoid css tree-shaking for exported Snippet
([#18540](#18540))

- perf: treat `<img loading>` as a static element again
([#18711](#18711))

- fix: prevent `selectedcontent` mutation from changing the selected
option ([#18495](#18495))

- fix: avoid `NaN` keyframe values in `slide` transition for elements
without a layout box
([#18430](#18430))

- fix: preserve line feed character references in attribute values
([#18691](#18691))

- fix: decode uppercase-`X` hex numeric character references (`&#X...;`)
([#18708](#18708))

- chore: clarify when `$effect.pre` runs relative to DOM updates
([#18534](#18534))

- fix: scope SSR boundary failed snippets to their boundary
([#18593](#18593))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
dadezzz pushed a commit to dadezzz/events-cash-register that referenced this pull request Sep 1, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [svelte](https://svelte.dev) ([source](https://github.com/sveltejs/svelte/tree/HEAD/packages/svelte)) | [`5.56.10` → `5.57.0`](https://renovatebot.com/diffs/npm/svelte/5.56.10/5.57.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/svelte/5.57.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/svelte/5.56.10/5.57.0?slim=true) |

---

### Release Notes

<details>
<summary>sveltejs/svelte (svelte)</summary>

### [`v5.57.0`](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5570)

[Compare Source](https://github.com/sveltejs/svelte/compare/svelte@5.56.10...svelte@5.57.0)

##### Minor Changes

- feat: export `RenderOutput`, `SyncRenderOutput`, `Csp` and `Sha256Source` from `svelte/server` ([#&#8203;18648](sveltejs/svelte#18648))

- feat: add `has` function to `createContext` ([#&#8203;18472](sveltejs/svelte#18472))

- feat: support `defaultValue` on `<select>` ([#&#8203;18591](sveltejs/svelte#18591))

- feat: add getOrInsert/getOrInsertComputed to SvelteMap ([#&#8203;18728](sveltejs/svelte#18728))

##### Patch Changes

- fix: block template store subscriptions on the promise that assigns the store ([#&#8203;18582](sveltejs/svelte#18582))

- fix: route $derived teardown errors through invoke\_error\_boundary ([#&#8203;18486](sveltejs/svelte#18486))

- fix: track SvelteDate snapshots in reactions ([#&#8203;18700](sveltejs/svelte#18700))

- fix: remove `<svelte:head>` anchors on unmount ([#&#8203;18697](sveltejs/svelte#18697))

- fix: warn on undeclared shorthand event handlers on `<svelte:window>`, `<svelte:document>` and `<svelte:body>` ([#&#8203;18480](sveltejs/svelte#18480))

- perf: reuse the cached value in the `<option>`/`<select>` value guard ([#&#8203;18713](sveltejs/svelte#18713))

- fix: prevent malformed AST output for `<select>` with static `value` attribute ([#&#8203;18449](sveltejs/svelte#18449))

- fix: apply ownership mutation ignores to binding assignments ([#&#8203;18718](sveltejs/svelte#18718))

- fix: prevent onoutroend from firing twice when compilerOptions.hmr is true ([#&#8203;18655](sveltejs/svelte#18655))

- fix: preserve whitespace after inline elements when printing ([#&#8203;18685](sveltejs/svelte#18685))

- perf: fold SSR block-open markers into the branch's first push ([#&#8203;18712](sveltejs/svelte#18712))

- fix: run `onDestroy` callbacks when a server render throws ([#&#8203;18585](sveltejs/svelte#18585))

- fix: report `derived_invalid_export` for `export let x = $derived(...)` in runes mode ([#&#8203;18692](sveltejs/svelte#18692))

- fix: never apply class hash to elements inside `<svelte:head>` ([#&#8203;18160](sveltejs/svelte#18160))

- fix: keep `defaultChecked` on hydrated radio inputs with spread attributes ([#&#8203;18701](sveltejs/svelte#18701))

- fix: accept `onfocusin`/`onfocusout` in `a11y_mouse_events_have_key_events` ([#&#8203;18689](sveltejs/svelte#18689))

- perf: O(n²)→O(n) Map lookups for legacy `$:` reactive statement ordering ([#&#8203;18602](sveltejs/svelte#18602))

- fix: distinct memoizer on style/class directives ([#&#8203;18466](sveltejs/svelte#18466))

- fix: measure nested transitions before applying their starting styles ([#&#8203;18647](sveltejs/svelte#18647))

- fix: don't turn component instances stored in `$state` into state proxies ([#&#8203;18646](sveltejs/svelte#18646))

- perf: emit `$.only_child` for elements with a single child ([#&#8203;18717](sveltejs/svelte#18717))

- fix: omit `bind:focused` from SSR output (it has no HTML attribute) ([#&#8203;18724](sveltejs/svelte#18724))

- fix: more robust rendering of Svelte custom element slots ([#&#8203;18710](sveltejs/svelte#18710))

- perf: optimize simple object destructuring in `@const` tags ([#&#8203;18390](sveltejs/svelte#18390))

- fix: properly apply static textarea value attribute during CSR ([#&#8203;18727](sveltejs/svelte#18727))

- fix: end a restored reaction context at the end of its synchronous segment ([#&#8203;18694](sveltejs/svelte#18694))

- fix: keep the dependencies of a reaction that throws, so deriveds it read are neither leaked nor stuck in their error ([#&#8203;18703](sveltejs/svelte#18703))

- fix: don't resurrect outroing elements when an ancestor block is paused and resumed ([#&#8203;18431](sveltejs/svelte#18431))

- perf: use `$.comment()` for single-comment templates ([#&#8203;18714](sveltejs/svelte#18714))

- chore: move `@types/trusted-types` to devDependencies ([#&#8203;18730](sveltejs/svelte#18730))

- perf: store setters cache as `Set` instead of `Array` ([#&#8203;18251](sveltejs/svelte#18251))

- fix: transform derived assignments and select function bindings correctly during server-side rendering ([#&#8203;18669](sveltejs/svelte#18669))

- fix: keep boolean attributes with an empty string value when rendering attribute objects on the server ([#&#8203;18721](sveltejs/svelte#18721))

- fix: sync `SvelteURL` port signal when the protocol setter clears the port ([#&#8203;18705](sveltejs/svelte#18705))

- fix: block declaration tags and `{@const}` on async values read inside closures ([#&#8203;18533](sveltejs/svelte#18533))

- fix: avoid css tree-shaking for exported Snippet ([#&#8203;18540](sveltejs/svelte#18540))

- perf: treat `<img loading>` as a static element again ([#&#8203;18711](sveltejs/svelte#18711))

- fix: prevent `selectedcontent` mutation from changing the selected option ([#&#8203;18495](sveltejs/svelte#18495))

- fix: avoid `NaN` keyframe values in `slide` transition for elements without a layout box ([#&#8203;18430](sveltejs/svelte#18430))

- fix: preserve line feed character references in attribute values ([#&#8203;18691](sveltejs/svelte#18691))

- fix: decode uppercase-`X` hex numeric character references (`&#X...;`) ([#&#8203;18708](sveltejs/svelte#18708))

- chore: clarify when `$effect.pre` runs relative to DOM updates ([#&#8203;18534](sveltejs/svelte#18534))

- fix: scope SSR boundary failed snippets to their boundary ([#&#8203;18593](sveltejs/svelte#18593))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC41Mi4xIiwidXBkYXRlZEluVmVyIjoiNDQuNTIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
renovate Bot added a commit to cigaleapp/cigale that referenced this pull request Sep 6, 2026
##### [v5.57.0](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5570)

##### Minor Changes

- feat: export `RenderOutput`, `SyncRenderOutput`, `Csp` and `Sha256Source` from `svelte/server` ([#18648](sveltejs/svelte#18648))

- feat: add `has` function to `createContext` ([#18472](sveltejs/svelte#18472))

- feat: support `defaultValue` on `<select>` ([#18591](sveltejs/svelte#18591))

- feat: add getOrInsert/getOrInsertComputed to SvelteMap ([#18728](sveltejs/svelte#18728))

##### Patch Changes

- fix: block template store subscriptions on the promise that assigns the store ([#18582](sveltejs/svelte#18582))

- fix: route $derived teardown errors through invoke\_error\_boundary ([#18486](sveltejs/svelte#18486))

- fix: track SvelteDate snapshots in reactions ([#18700](sveltejs/svelte#18700))

- fix: remove `<svelte:head>` anchors on unmount ([#18697](sveltejs/svelte#18697))

- fix: warn on undeclared shorthand event handlers on `<svelte:window>`, `<svelte:document>` and `<svelte:body>` ([#18480](sveltejs/svelte#18480))

- perf: reuse the cached value in the `<option>`/`<select>` value guard ([#18713](sveltejs/svelte#18713))

- fix: prevent malformed AST output for `<select>` with static `value` attribute ([#18449](sveltejs/svelte#18449))

- fix: apply ownership mutation ignores to binding assignments ([#18718](sveltejs/svelte#18718))

- fix: prevent onoutroend from firing twice when compilerOptions.hmr is true ([#18655](sveltejs/svelte#18655))

- fix: preserve whitespace after inline elements when printing ([#18685](sveltejs/svelte#18685))

- perf: fold SSR block-open markers into the branch's first push ([#18712](sveltejs/svelte#18712))

- fix: run `onDestroy` callbacks when a server render throws ([#18585](sveltejs/svelte#18585))

- fix: report `derived_invalid_export` for `export let x = $derived(...)` in runes mode ([#18692](sveltejs/svelte#18692))

- fix: never apply class hash to elements inside `<svelte:head>` ([#18160](sveltejs/svelte#18160))

- fix: keep `defaultChecked` on hydrated radio inputs with spread attributes ([#18701](sveltejs/svelte#18701))

- fix: accept `onfocusin`/`onfocusout` in `a11y_mouse_events_have_key_events` ([#18689](sveltejs/svelte#18689))

- perf: O(n²)→O(n) Map lookups for legacy `$:` reactive statement ordering ([#18602](sveltejs/svelte#18602))

- fix: distinct memoizer on style/class directives ([#18466](sveltejs/svelte#18466))

- fix: measure nested transitions before applying their starting styles ([#18647](sveltejs/svelte#18647))

- fix: don't turn component instances stored in `$state` into state proxies ([#18646](sveltejs/svelte#18646))

- perf: emit `$.only_child` for elements with a single child ([#18717](sveltejs/svelte#18717))

- fix: omit `bind:focused` from SSR output (it has no HTML attribute) ([#18724](sveltejs/svelte#18724))

- fix: more robust rendering of Svelte custom element slots ([#18710](sveltejs/svelte#18710))

- perf: optimize simple object destructuring in `@const` tags ([#18390](sveltejs/svelte#18390))

- fix: properly apply static textarea value attribute during CSR ([#18727](sveltejs/svelte#18727))

- fix: end a restored reaction context at the end of its synchronous segment ([#18694](sveltejs/svelte#18694))

- fix: keep the dependencies of a reaction that throws, so deriveds it read are neither leaked nor stuck in their error ([#18703](sveltejs/svelte#18703))

- fix: don't resurrect outroing elements when an ancestor block is paused and resumed ([#18431](sveltejs/svelte#18431))

- perf: use `$.comment()` for single-comment templates ([#18714](sveltejs/svelte#18714))

- chore: move `@types/trusted-types` to devDependencies ([#18730](sveltejs/svelte#18730))

- perf: store setters cache as `Set` instead of `Array` ([#18251](sveltejs/svelte#18251))

- fix: transform derived assignments and select function bindings correctly during server-side rendering ([#18669](sveltejs/svelte#18669))

- fix: keep boolean attributes with an empty string value when rendering attribute objects on the server ([#18721](sveltejs/svelte#18721))

- fix: sync `SvelteURL` port signal when the protocol setter clears the port ([#18705](sveltejs/svelte#18705))

- fix: block declaration tags and `{@const}` on async values read inside closures ([#18533](sveltejs/svelte#18533))

- fix: avoid css tree-shaking for exported Snippet ([#18540](sveltejs/svelte#18540))

- perf: treat `<img loading>` as a static element again ([#18711](sveltejs/svelte#18711))

- fix: prevent `selectedcontent` mutation from changing the selected option ([#18495](sveltejs/svelte#18495))

- fix: avoid `NaN` keyframe values in `slide` transition for elements without a layout box ([#18430](sveltejs/svelte#18430))

- fix: preserve line feed character references in attribute values ([#18691](sveltejs/svelte#18691))

- fix: decode uppercase-`X` hex numeric character references (`&#X...;`) ([#18708](sveltejs/svelte#18708))

- chore: clarify when `$effect.pre` runs relative to DOM updates ([#18534](sveltejs/svelte#18534))

- fix: scope SSR boundary failed snippets to their boundary ([#18593](sveltejs/svelte#18593))
renovate Bot added a commit to cigaleapp/cigale that referenced this pull request Sep 7, 2026
##### [v5.57.0](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5570)

##### Minor Changes

- feat: export `RenderOutput`, `SyncRenderOutput`, `Csp` and `Sha256Source` from `svelte/server` ([#18648](sveltejs/svelte#18648))

- feat: add `has` function to `createContext` ([#18472](sveltejs/svelte#18472))

- feat: support `defaultValue` on `<select>` ([#18591](sveltejs/svelte#18591))

- feat: add getOrInsert/getOrInsertComputed to SvelteMap ([#18728](sveltejs/svelte#18728))

##### Patch Changes

- fix: block template store subscriptions on the promise that assigns the store ([#18582](sveltejs/svelte#18582))

- fix: route $derived teardown errors through invoke\_error\_boundary ([#18486](sveltejs/svelte#18486))

- fix: track SvelteDate snapshots in reactions ([#18700](sveltejs/svelte#18700))

- fix: remove `<svelte:head>` anchors on unmount ([#18697](sveltejs/svelte#18697))

- fix: warn on undeclared shorthand event handlers on `<svelte:window>`, `<svelte:document>` and `<svelte:body>` ([#18480](sveltejs/svelte#18480))

- perf: reuse the cached value in the `<option>`/`<select>` value guard ([#18713](sveltejs/svelte#18713))

- fix: prevent malformed AST output for `<select>` with static `value` attribute ([#18449](sveltejs/svelte#18449))

- fix: apply ownership mutation ignores to binding assignments ([#18718](sveltejs/svelte#18718))

- fix: prevent onoutroend from firing twice when compilerOptions.hmr is true ([#18655](sveltejs/svelte#18655))

- fix: preserve whitespace after inline elements when printing ([#18685](sveltejs/svelte#18685))

- perf: fold SSR block-open markers into the branch's first push ([#18712](sveltejs/svelte#18712))

- fix: run `onDestroy` callbacks when a server render throws ([#18585](sveltejs/svelte#18585))

- fix: report `derived_invalid_export` for `export let x = $derived(...)` in runes mode ([#18692](sveltejs/svelte#18692))

- fix: never apply class hash to elements inside `<svelte:head>` ([#18160](sveltejs/svelte#18160))

- fix: keep `defaultChecked` on hydrated radio inputs with spread attributes ([#18701](sveltejs/svelte#18701))

- fix: accept `onfocusin`/`onfocusout` in `a11y_mouse_events_have_key_events` ([#18689](sveltejs/svelte#18689))

- perf: O(n²)→O(n) Map lookups for legacy `$:` reactive statement ordering ([#18602](sveltejs/svelte#18602))

- fix: distinct memoizer on style/class directives ([#18466](sveltejs/svelte#18466))

- fix: measure nested transitions before applying their starting styles ([#18647](sveltejs/svelte#18647))

- fix: don't turn component instances stored in `$state` into state proxies ([#18646](sveltejs/svelte#18646))

- perf: emit `$.only_child` for elements with a single child ([#18717](sveltejs/svelte#18717))

- fix: omit `bind:focused` from SSR output (it has no HTML attribute) ([#18724](sveltejs/svelte#18724))

- fix: more robust rendering of Svelte custom element slots ([#18710](sveltejs/svelte#18710))

- perf: optimize simple object destructuring in `@const` tags ([#18390](sveltejs/svelte#18390))

- fix: properly apply static textarea value attribute during CSR ([#18727](sveltejs/svelte#18727))

- fix: end a restored reaction context at the end of its synchronous segment ([#18694](sveltejs/svelte#18694))

- fix: keep the dependencies of a reaction that throws, so deriveds it read are neither leaked nor stuck in their error ([#18703](sveltejs/svelte#18703))

- fix: don't resurrect outroing elements when an ancestor block is paused and resumed ([#18431](sveltejs/svelte#18431))

- perf: use `$.comment()` for single-comment templates ([#18714](sveltejs/svelte#18714))

- chore: move `@types/trusted-types` to devDependencies ([#18730](sveltejs/svelte#18730))

- perf: store setters cache as `Set` instead of `Array` ([#18251](sveltejs/svelte#18251))

- fix: transform derived assignments and select function bindings correctly during server-side rendering ([#18669](sveltejs/svelte#18669))

- fix: keep boolean attributes with an empty string value when rendering attribute objects on the server ([#18721](sveltejs/svelte#18721))

- fix: sync `SvelteURL` port signal when the protocol setter clears the port ([#18705](sveltejs/svelte#18705))

- fix: block declaration tags and `{@const}` on async values read inside closures ([#18533](sveltejs/svelte#18533))

- fix: avoid css tree-shaking for exported Snippet ([#18540](sveltejs/svelte#18540))

- perf: treat `<img loading>` as a static element again ([#18711](sveltejs/svelte#18711))

- fix: prevent `selectedcontent` mutation from changing the selected option ([#18495](sveltejs/svelte#18495))

- fix: avoid `NaN` keyframe values in `slide` transition for elements without a layout box ([#18430](sveltejs/svelte#18430))

- fix: preserve line feed character references in attribute values ([#18691](sveltejs/svelte#18691))

- fix: decode uppercase-`X` hex numeric character references (`&#X...;`) ([#18708](sveltejs/svelte#18708))

- chore: clarify when `$effect.pre` runs relative to DOM updates ([#18534](sveltejs/svelte#18534))

- fix: scope SSR boundary failed snippets to their boundary ([#18593](sveltejs/svelte#18593))
renovate Bot added a commit to cigaleapp/cigale that referenced this pull request Sep 7, 2026
##### [v5.57.0](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5570)

##### Minor Changes

- feat: export `RenderOutput`, `SyncRenderOutput`, `Csp` and `Sha256Source` from `svelte/server` ([#18648](sveltejs/svelte#18648))

- feat: add `has` function to `createContext` ([#18472](sveltejs/svelte#18472))

- feat: support `defaultValue` on `<select>` ([#18591](sveltejs/svelte#18591))

- feat: add getOrInsert/getOrInsertComputed to SvelteMap ([#18728](sveltejs/svelte#18728))

##### Patch Changes

- fix: block template store subscriptions on the promise that assigns the store ([#18582](sveltejs/svelte#18582))

- fix: route $derived teardown errors through invoke\_error\_boundary ([#18486](sveltejs/svelte#18486))

- fix: track SvelteDate snapshots in reactions ([#18700](sveltejs/svelte#18700))

- fix: remove `<svelte:head>` anchors on unmount ([#18697](sveltejs/svelte#18697))

- fix: warn on undeclared shorthand event handlers on `<svelte:window>`, `<svelte:document>` and `<svelte:body>` ([#18480](sveltejs/svelte#18480))

- perf: reuse the cached value in the `<option>`/`<select>` value guard ([#18713](sveltejs/svelte#18713))

- fix: prevent malformed AST output for `<select>` with static `value` attribute ([#18449](sveltejs/svelte#18449))

- fix: apply ownership mutation ignores to binding assignments ([#18718](sveltejs/svelte#18718))

- fix: prevent onoutroend from firing twice when compilerOptions.hmr is true ([#18655](sveltejs/svelte#18655))

- fix: preserve whitespace after inline elements when printing ([#18685](sveltejs/svelte#18685))

- perf: fold SSR block-open markers into the branch's first push ([#18712](sveltejs/svelte#18712))

- fix: run `onDestroy` callbacks when a server render throws ([#18585](sveltejs/svelte#18585))

- fix: report `derived_invalid_export` for `export let x = $derived(...)` in runes mode ([#18692](sveltejs/svelte#18692))

- fix: never apply class hash to elements inside `<svelte:head>` ([#18160](sveltejs/svelte#18160))

- fix: keep `defaultChecked` on hydrated radio inputs with spread attributes ([#18701](sveltejs/svelte#18701))

- fix: accept `onfocusin`/`onfocusout` in `a11y_mouse_events_have_key_events` ([#18689](sveltejs/svelte#18689))

- perf: O(n²)→O(n) Map lookups for legacy `$:` reactive statement ordering ([#18602](sveltejs/svelte#18602))

- fix: distinct memoizer on style/class directives ([#18466](sveltejs/svelte#18466))

- fix: measure nested transitions before applying their starting styles ([#18647](sveltejs/svelte#18647))

- fix: don't turn component instances stored in `$state` into state proxies ([#18646](sveltejs/svelte#18646))

- perf: emit `$.only_child` for elements with a single child ([#18717](sveltejs/svelte#18717))

- fix: omit `bind:focused` from SSR output (it has no HTML attribute) ([#18724](sveltejs/svelte#18724))

- fix: more robust rendering of Svelte custom element slots ([#18710](sveltejs/svelte#18710))

- perf: optimize simple object destructuring in `@const` tags ([#18390](sveltejs/svelte#18390))

- fix: properly apply static textarea value attribute during CSR ([#18727](sveltejs/svelte#18727))

- fix: end a restored reaction context at the end of its synchronous segment ([#18694](sveltejs/svelte#18694))

- fix: keep the dependencies of a reaction that throws, so deriveds it read are neither leaked nor stuck in their error ([#18703](sveltejs/svelte#18703))

- fix: don't resurrect outroing elements when an ancestor block is paused and resumed ([#18431](sveltejs/svelte#18431))

- perf: use `$.comment()` for single-comment templates ([#18714](sveltejs/svelte#18714))

- chore: move `@types/trusted-types` to devDependencies ([#18730](sveltejs/svelte#18730))

- perf: store setters cache as `Set` instead of `Array` ([#18251](sveltejs/svelte#18251))

- fix: transform derived assignments and select function bindings correctly during server-side rendering ([#18669](sveltejs/svelte#18669))

- fix: keep boolean attributes with an empty string value when rendering attribute objects on the server ([#18721](sveltejs/svelte#18721))

- fix: sync `SvelteURL` port signal when the protocol setter clears the port ([#18705](sveltejs/svelte#18705))

- fix: block declaration tags and `{@const}` on async values read inside closures ([#18533](sveltejs/svelte#18533))

- fix: avoid css tree-shaking for exported Snippet ([#18540](sveltejs/svelte#18540))

- perf: treat `<img loading>` as a static element again ([#18711](sveltejs/svelte#18711))

- fix: prevent `selectedcontent` mutation from changing the selected option ([#18495](sveltejs/svelte#18495))

- fix: avoid `NaN` keyframe values in `slide` transition for elements without a layout box ([#18430](sveltejs/svelte#18430))

- fix: preserve line feed character references in attribute values ([#18691](sveltejs/svelte#18691))

- fix: decode uppercase-`X` hex numeric character references (`&#X...;`) ([#18708](sveltejs/svelte#18708))

- chore: clarify when `$effect.pre` runs relative to DOM updates ([#18534](sveltejs/svelte#18534))

- fix: scope SSR boundary failed snippets to their boundary ([#18593](sveltejs/svelte#18593))
gwennlbh pushed a commit to cigaleapp/cigale that referenced this pull request Sep 7, 2026
##### [v5.57.0](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5570)

##### Minor Changes

- feat: export `RenderOutput`, `SyncRenderOutput`, `Csp` and `Sha256Source` from `svelte/server` ([#18648](sveltejs/svelte#18648))

- feat: add `has` function to `createContext` ([#18472](sveltejs/svelte#18472))

- feat: support `defaultValue` on `<select>` ([#18591](sveltejs/svelte#18591))

- feat: add getOrInsert/getOrInsertComputed to SvelteMap ([#18728](sveltejs/svelte#18728))

##### Patch Changes

- fix: block template store subscriptions on the promise that assigns the store ([#18582](sveltejs/svelte#18582))

- fix: route $derived teardown errors through invoke\_error\_boundary ([#18486](sveltejs/svelte#18486))

- fix: track SvelteDate snapshots in reactions ([#18700](sveltejs/svelte#18700))

- fix: remove `<svelte:head>` anchors on unmount ([#18697](sveltejs/svelte#18697))

- fix: warn on undeclared shorthand event handlers on `<svelte:window>`, `<svelte:document>` and `<svelte:body>` ([#18480](sveltejs/svelte#18480))

- perf: reuse the cached value in the `<option>`/`<select>` value guard ([#18713](sveltejs/svelte#18713))

- fix: prevent malformed AST output for `<select>` with static `value` attribute ([#18449](sveltejs/svelte#18449))

- fix: apply ownership mutation ignores to binding assignments ([#18718](sveltejs/svelte#18718))

- fix: prevent onoutroend from firing twice when compilerOptions.hmr is true ([#18655](sveltejs/svelte#18655))

- fix: preserve whitespace after inline elements when printing ([#18685](sveltejs/svelte#18685))

- perf: fold SSR block-open markers into the branch's first push ([#18712](sveltejs/svelte#18712))

- fix: run `onDestroy` callbacks when a server render throws ([#18585](sveltejs/svelte#18585))

- fix: report `derived_invalid_export` for `export let x = $derived(...)` in runes mode ([#18692](sveltejs/svelte#18692))

- fix: never apply class hash to elements inside `<svelte:head>` ([#18160](sveltejs/svelte#18160))

- fix: keep `defaultChecked` on hydrated radio inputs with spread attributes ([#18701](sveltejs/svelte#18701))

- fix: accept `onfocusin`/`onfocusout` in `a11y_mouse_events_have_key_events` ([#18689](sveltejs/svelte#18689))

- perf: O(n²)→O(n) Map lookups for legacy `$:` reactive statement ordering ([#18602](sveltejs/svelte#18602))

- fix: distinct memoizer on style/class directives ([#18466](sveltejs/svelte#18466))

- fix: measure nested transitions before applying their starting styles ([#18647](sveltejs/svelte#18647))

- fix: don't turn component instances stored in `$state` into state proxies ([#18646](sveltejs/svelte#18646))

- perf: emit `$.only_child` for elements with a single child ([#18717](sveltejs/svelte#18717))

- fix: omit `bind:focused` from SSR output (it has no HTML attribute) ([#18724](sveltejs/svelte#18724))

- fix: more robust rendering of Svelte custom element slots ([#18710](sveltejs/svelte#18710))

- perf: optimize simple object destructuring in `@const` tags ([#18390](sveltejs/svelte#18390))

- fix: properly apply static textarea value attribute during CSR ([#18727](sveltejs/svelte#18727))

- fix: end a restored reaction context at the end of its synchronous segment ([#18694](sveltejs/svelte#18694))

- fix: keep the dependencies of a reaction that throws, so deriveds it read are neither leaked nor stuck in their error ([#18703](sveltejs/svelte#18703))

- fix: don't resurrect outroing elements when an ancestor block is paused and resumed ([#18431](sveltejs/svelte#18431))

- perf: use `$.comment()` for single-comment templates ([#18714](sveltejs/svelte#18714))

- chore: move `@types/trusted-types` to devDependencies ([#18730](sveltejs/svelte#18730))

- perf: store setters cache as `Set` instead of `Array` ([#18251](sveltejs/svelte#18251))

- fix: transform derived assignments and select function bindings correctly during server-side rendering ([#18669](sveltejs/svelte#18669))

- fix: keep boolean attributes with an empty string value when rendering attribute objects on the server ([#18721](sveltejs/svelte#18721))

- fix: sync `SvelteURL` port signal when the protocol setter clears the port ([#18705](sveltejs/svelte#18705))

- fix: block declaration tags and `{@const}` on async values read inside closures ([#18533](sveltejs/svelte#18533))

- fix: avoid css tree-shaking for exported Snippet ([#18540](sveltejs/svelte#18540))

- perf: treat `<img loading>` as a static element again ([#18711](sveltejs/svelte#18711))

- fix: prevent `selectedcontent` mutation from changing the selected option ([#18495](sveltejs/svelte#18495))

- fix: avoid `NaN` keyframe values in `slide` transition for elements without a layout box ([#18430](sveltejs/svelte#18430))

- fix: preserve line feed character references in attribute values ([#18691](sveltejs/svelte#18691))

- fix: decode uppercase-`X` hex numeric character references (`&#X...;`) ([#18708](sveltejs/svelte#18708))

- chore: clarify when `$effect.pre` runs relative to DOM updates ([#18534](sveltejs/svelte#18534))

- fix: scope SSR boundary failed snippets to their boundary ([#18593](sveltejs/svelte#18593))

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improved error when attempting to export $derived state as a let?

2 participants