Skip to content

fix: set correct parent for lazily created derived inside SvelteDate#18509

Open
JaiWey wants to merge 2 commits into
sveltejs:mainfrom
JaiWey:issue-18419-SvelteDate
Open

fix: set correct parent for lazily created derived inside SvelteDate#18509
JaiWey wants to merge 2 commits into
sveltejs:mainfrom
JaiWey:issue-18419-SvelteDate

Conversation

@JaiWey

@JaiWey JaiWey commented Jul 6, 2026

Copy link
Copy Markdown

Fixes #18419

The deriveds inside SvelteDate are created lazily, previously the parent effect property could possibly be a to-destory branch effect, which makes the derived shared between multiple components inert after the branch is destroyed. So similar to the #reaction, add an #effect property to save, set and restore the correct effect inside SvelteDate.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.
  • If this PR changes code within packages/svelte/src, add a changeset (npx changeset).

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 6, 2026

Copy link
Copy Markdown

Install the latest version of svelte from 94a71ef:

pnpm add https://pkg.svelte.dev/svelte/c/94a71ef6535cd0592fc9ce20716944e7dfa6d0ff

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

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 Jul 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 94a71ef

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

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.

Using SvelteDate results in derived_inert warning and loss of reactivity

1 participant