Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: properly add owners to function bindings #14962

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Jan 8, 2025

alternative to #14960 — I might be missing something but I think we just need to call the getter inside the effect, rather than doing any fancy static analysis footwork

Closes #14956

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

@Rich-Harris
Copy link
Member Author

preview: https://svelte-dev-git-preview-svelte-14962-svelte.vercel.app/

this is an automated message

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Playground

pnpm add https://pkg.pr.new/svelte@14962

@paoloricciuti
Copy link
Member

Should we add back the Set thing i've added to prevent unnecessary effects?

@Rich-Harris
Copy link
Member Author

Seems like it's probably overkill - how often do you have multiple bindings pointing to the same value?

@paoloricciuti
Copy link
Member

Seems like it's probably overkill - how often do you have multiple bindings pointing to the same value?

I mean it's done at compile time but I think it's fine as is if we want

@dummdidumm dummdidumm merged commit c0842d1 into main Jan 9, 2025
11 checks passed
@dummdidumm dummdidumm deleted the ownership-function-bindings-alt branch January 9, 2025 10:49
@github-actions github-actions bot mentioned this pull request Jan 8, 2025
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.

ownership_invalid_mutation warning is erroneously shown when binding via getter / setter
3 participants