Repository navigation
fix: preserve select selection with spread attributes - #18561
Merged
paoloricciuti merged 2 commits intoJul 22, 2026
Merged
paoloricciuti merged 2 commits into
paoloricciuti merged 2 commits into
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/svelte/c/442556a9e363239c47466d4dc33c82ffd58d77fdOpen in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
🦋 Changeset detectedLatest commit: 442556a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
2 tasks done
paoloricciuti
approved these changes
Jul 22, 2026
Member
|
Thanks! 🧡 |
Merged
dummdidumm
pushed a commit
that referenced
this pull request
Jul 24, 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.56.8 ### Patch Changes - fix: call `onerror` and provide a working `reset` when hydrating a failed boundary ([#18556](#18556)) - fix: preserve select selection when spread attributes omit value ([#18561](#18561)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
khromov
added a commit
to khromov/mochi
that referenced
this pull request
Jul 29, 2026
Bumps Svelte from **5.56.7 → 5.56.8** across every workspace. ## Upstream changes Patch release, two fixes — the first lands directly on a Mochi code path, since the preprocessor auto-wraps every `mochi:hydrate*` island in a `<svelte:boundary>`: - fix: call `onerror` and provide a working `reset` when hydrating a failed boundary ([sveltejs/svelte#18556](sveltejs/svelte#18556)) - fix: preserve select selection when spread attributes omit value ([sveltejs/svelte#18561](sveltejs/svelte#18561)) ## Bump table | Workspace | Field | From | To | | --- | --- | --- | --- | | `packages/mochi` | devDependencies | `^5.56.7` | `^5.56.8` | | `packages/mochi-rsvelte` | devDependencies | `^5.56.7` | `^5.56.8` | | `packages/site` | dependencies | `^5.56.7` | `^5.56.8` | | `packages/demos` | dependencies | `^5.56.7` | `^5.56.8` | | `packages/docs` | dependencies | `^5.56.7` | `^5.56.8` | | `packages/minimal` | dependencies | `^5.56.7` | `^5.56.8` | | `packages/minimal-rsvelte` | dependencies | `^5.56.7` | `^5.56.8` | | `packages/support` | dependencies | `^5.56.7` | `^5.56.8` | ## Deliberately not changed - **`packages/mochi` `peerDependencies.svelte` stays at `^5.56.6`.** It's a floor for published consumers and already admits 5.56.8; raising it would force an upgrade for no API reason. Since published `mochi-framework` carries Svelte only as a devDependency plus this unchanged peer range, nothing consumer-visible moved — hence `chore(deps):` rather than `fix(deps):`, and no release is warranted. - Scope is Svelte only, not a full dependency sweep. Also currently outdated and left alone: `@lucide/svelte` (1.25.0 → 1.27.0), `@rsvelte/vite-plugin-svelte-native` (0.2.8 → 0.3.1), `svelte-check` (4.7.3 → 4.7.4, exact-pinned because it carries a patch keyed on the version), `typescript` (6.0.3 → 7.0.2). The `bun.lock` diff is Svelte-only; the one removed `svelte/devalue` entry is a dedupe artifact (devalue is now satisfied from the root). ## Verification - **`bun run syncpack`** — ✅ no issues; cross-workspace agreement holds, including the unchanged peer range. - **`bun run checks`** (lint:fix + format + typecheck + test) — ✅ all four stages green. Typecheck 0 errors across all workspaces; tests 142/142 mochi-framework files, 9/9 site, 2/2 support, demos/minimal/minimal-rsvelte all green, 0 failures. - **Clean reinstall + dedupe** — `rm -rf node_modules packages/*/node_modules && bun install`. `packages/*/node_modules/svelte` is empty and `node_modules/.bun` is absent, so there is exactly one hoisted `svelte@5.56.8`. (Duplicate copies mean two context maps and break `getContext` across the island boundary — invisible to CI.) - **`bun run build`** — ✅ output byte-identical to the pre-bump baseline apart from timings. No optimization skipped, no shake fallback: | | before | after | | --- | --- | --- | | `svelte-shaker` (site) | slimmed 33 of 163 | slimmed 33 of 163 | | site | 65 pages · 245 client files · 12 public · 7 image assets · 2 email templates | identical | | demos | 10 pages · 32 client files | identical | | support | 2 pages · 19 client files · 1 email template | identical | | minimal / minimal-rsvelte | 1 page · 10 client files each | identical | Per-file bundle sizes in the build listing are unchanged too. - **Browser smoke test** (`PORT=4444 bun run dev:site`, driven via chrome-devtools): - `/` — no console errors/warnings. - `/docs/queues/` — no console errors/warnings. - `/demos/error-boundaries/` — the demo most relevant to #18556. All five scenarios render their expected fallbacks (user-written boundary, `mochi:hydrate` SSR throw, `mochi:hydrate` client throw, `mochi:defer` server-island throw, healthy server island with an inner throwing `mochi:hydrate` child). All 22 requests 200, including both `/_mochi/island/*` fetches. The only console output is the demo's intentional `ThrowOnClient` failure. Debug bar reports **Svelte 5.56.8**. - `/demos/nested-islands/` — clean console, all four `/_mochi/island/*` fetches 200. - `/demos/is-hydratable/` — clean console, both island fetches 200. This is the canary for the duplicate-copy failure mode (`isHydratable()` is its first casualty), so it independently confirms the dedupe. - **`bun run cli-test`** — ✅ pass (scaffold, install, test, typecheck). `minimal` and `demos` both moved and double as `create-mochi` template sources.
renovate Bot
added a commit
to cigaleapp/cigale
that referenced
this pull request
Aug 2, 2026
##### [v5.56.8](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5568) ##### Patch Changes - fix: call `onerror` and provide a working `reset` when hydrating a failed boundary ([#18556](sveltejs/svelte#18556)) - fix: preserve select selection when spread attributes omit value ([#18561](sveltejs/svelte#18561)) ##### [v5.56.7](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5567) ##### Patch Changes - chore: provide `indent` option for `print` ([#18474](sveltejs/svelte#18474))
renovate Bot
added a commit
to cigaleapp/cigale
that referenced
this pull request
Aug 2, 2026
##### [v5.56.8](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5568) ##### Patch Changes - fix: call `onerror` and provide a working `reset` when hydrating a failed boundary ([#18556](sveltejs/svelte#18556)) - fix: preserve select selection when spread attributes omit value ([#18561](sveltejs/svelte#18561)) ##### [v5.56.7](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5567) ##### Patch Changes - chore: provide `indent` option for `print` ([#18474](sveltejs/svelte#18474))
renovate Bot
added a commit
to cigaleapp/cigale
that referenced
this pull request
Aug 2, 2026
##### [v5.56.8](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5568) ##### Patch Changes - fix: call `onerror` and provide a working `reset` when hydrating a failed boundary ([#18556](sveltejs/svelte#18556)) - fix: preserve select selection when spread attributes omit value ([#18561](sveltejs/svelte#18561)) ##### [v5.56.7](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5567) ##### Patch Changes - chore: provide `indent` option for `print` ([#18474](sveltejs/svelte#18474))
renovate Bot
added a commit
to cigaleapp/cigale
that referenced
this pull request
Aug 2, 2026
##### [v5.56.8](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5568) ##### Patch Changes - fix: call `onerror` and provide a working `reset` when hydrating a failed boundary ([#18556](sveltejs/svelte#18556)) - fix: preserve select selection when spread attributes omit value ([#18561](sveltejs/svelte#18561)) ##### [v5.56.7](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5567) ##### Patch Changes - chore: provide `indent` option for `print` ([#18474](sveltejs/svelte#18474))
renovate Bot
added a commit
to cigaleapp/cigale
that referenced
this pull request
Aug 2, 2026
##### [v5.56.8](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5568) ##### Patch Changes - fix: call `onerror` and provide a working `reset` when hydrating a failed boundary ([#18556](sveltejs/svelte#18556)) - fix: preserve select selection when spread attributes omit value ([#18561](sveltejs/svelte#18561)) ##### [v5.56.7](https://github.com/sveltejs/svelte/blob/HEAD/packages/svelte/CHANGELOG.md#5567) ##### Patch Changes - chore: provide `indent` option for `print` ([#18474](sveltejs/svelte#18474))
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18557
A
<select>with spread attributes initializes the option mutation observer even when those attributes never provide avalue. In that case the element has no internal__value, but the observer previously treated the missing property as an explicitundefinedvalue and deselected every option after an option was added or removed.Only reapply the programmatic selection when
__valueis actually present. This preserves the browser's current selection for spreads without a value while keeping the existing behavior for bindings, including an explicitly storedundefinedvalue.A runtime-legacy regression fixture covers both adding and removing an option in client and hydration modes.
Before submitting
fix:titlesvelteTest plan
FILTER=select-spread-preserve-selection pnpm test runtime-legacy --maxWorkers=1(2 tests passed: client and hydrate)git diff --checkpnpm testwas not run because the shared host was under resource pressure and broad test processes were explicitly avoidedpnpm lintandpnpm checkwere not run for the same reasonprettier-plugin-svelterequired the ungeneratedpackages/svelte/compiler/index.js; no broad build or dependency reinstall was runAI disclosure
AI-assisted: the implementation, regression test, and pull request text were prepared with OpenAI Codex and reviewed by the contributor.