What this thread does
Update Svelte to 5.59.1 (checked 2026-11-24), then retest property-existence checks and discarded forks before adding reactivity workarounds.
What changed
- The official release, dated 2026-10-26 (checked 2026-10-28), preserves state sources for property checks during initialization and tracks missing state properties in unowned deriveds.
- The same notes skip redundant hydration attribute writes, use the first valid fallback ARIA role, and repair a documentation link in
hydratable_serialization_failed. That last item is a link fix, not a promise to serialize previously unsupported values.
How to migrate
1. Update the project's svelte dependency and lockfile to the target above. The API reference documents fork and discard(); retain those public APIs rather than patching proxy internals. 2. Preserve a minimal component using $state, an initialization-time in check and a fork that writes then discards. Compare its resulting value with the example in PR #18949. 3. Test a missing property with both in and Object.hasOwn in a derived without a parent effect; add and remove the property and check the rendered result. 4. Rebuild and rerun those cases before removing workarounds. Then smoke-test SSR hydration and components with fallback role lists separately.
The problem
A property-existence check can interact with state-source creation, causing a discarded speculative change to lose the previous value or a derived to miss a newly added property.
What breaks
xyrolle's PR #18949 shows object.x becoming undefined after checking 'x' in object during initialization, setting it in a fork, then discarding. It also describes an absent key being left as an own property holding undefined. This example demonstrates a development regression repaired by the patch; it does not establish which earlier released builds exhibit every symptom.
Diagnostic: state becomes undefined after fork discard
Use a value assertion and an own-property assertion. Checking only what is rendered can miss the difference between an absent key and a key whose value is undefined.
What to test
Proposed checks include existing and missing keys, property addition/removal, and initialization versus an unowned derived. The state docs explain deep reactive proxies; preserve the distinction between reading a property and passing a primitive value elsewhere.
Hydration checks should look for changed attribute behavior on a real SSR page. Fallback-role checks should compare compiler diagnostics without assuming this patch proves the page is accessible.
Pitfalls
Do not replace all in checks with manual effects. Do not infer that repairing an error-message link fixes the error's underlying cause. Do not use primitive-value getter advice to explain a proxy bookkeeping bug.
Evidence
- xyrolle, PR #18949, supplies a reproducer and before/after regression assertions.
- PR #18944, authored by svelte-triage-bot and merged by paoloricciuti, explains missing-key tracking in unowned deriveds. It is maintainer implementation evidence, not an independent user rollout report.
A prompt to give your agent
Your training data predates this patch. Read <https://github.com/sveltejs/svelte/releases/tag/svelte%405.57.3> and <https://github.com/sveltejs/svelte/pull/18949> before editing. Target Svelte 5.59.1 (checked 2026-11-24). Write focused assertions for existing/missing keys, initialization, unowned deriveds and fork discard using documented APIs. Do not guess the affected release range; report what you actually reproduce.
Limits
No component build, hydration run or accessibility audit is reported. The fork example comes from a development regression report; its presence in every earlier release is unverified. Independent post-release confirmation is thin, and the proposed application checks remain an untested experiment.
Started from a post by @sveltejs, packaged by the editor. Original post