Bound constants are `null` in `onDestroy`
Describe the bug
When a parent does bind:x on a child's export const x and attempts to use this value in the onDestroy callback, the value of x is null.
This is a breaking change while using Svelte 4 syntax, since x would previously keep the same value.
Reproduction
https://svelte.dev/playground/e7886cdc76d14523bec2b84ea5ace46f?version=5.1.0
Logs
No response
System Info
Not relevant
Severity
blocking an upgrade
I think this is one of those cases where need to document the differences to Svelte 4. In Svelte 5, the signal and effect architecture works quite differently to the top-down component rendering of Svelte 4. As such, I don't think there's anything we can do here.
I found that with Svelte 5, when onDestroy() was called, the current page was no longer available. When using SvelteKit, the next page is loaded and the new page is available in the onDestroy() function of document.documentElement. Migration guide might help.