Skip to content

Conversation

@trueadm
Copy link
Contributor

@trueadm trueadm commented Jun 28, 2024

Fixes #12186

@changeset-bot
Copy link

changeset-bot bot commented Jun 28, 2024

🦋 Changeset detected

Latest commit: 1c99218

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

@Rich-Harris
Copy link
Member

I don't follow where exactly, but this is causing additional effects to be created. Using the test in this PR:

export default function App($$anchor) {
  // ...

  var div = $.sibling($.sibling(button, true));

  {
    var div_1 = $.child(div);

    {
      // ...

+     $.template_effect(() => {});
    }

    var div_2 = $.sibling($.sibling(div_1, true));

    {
      // ...

+     $.template_effect(() => {});
    }

+   $.template_effect(() => {});
  }

  $.append($$anchor, fragment);
}

$.delegate(["click"]);

Also, how complicated would it be to only create the block statement in cases where a snippet is declared?

@trueadm
Copy link
Contributor Author

trueadm commented Jun 29, 2024

I don't follow where exactly, but this is causing additional effects to be created. Using the test in this PR:

export default function App($$anchor) {
  // ...

  var div = $.sibling($.sibling(button, true));

  {
    var div_1 = $.child(div);

    {
      // ...

+     $.template_effect(() => {});
    }

    var div_2 = $.sibling($.sibling(div_1, true));

    {
      // ...

+     $.template_effect(() => {});
    }

+   $.template_effect(() => {});
  }

  $.append($$anchor, fragment);
}

$.delegate(["click"]);

Also, how complicated would it be to only create the block statement in cases where a snippet is declared?

Fixed!

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.

Svelte 5: Snippets aren't deconflicted

3 participants