Skip to content

Conversation

@paoloricciuti
Copy link
Member

Closes #17589

I wonder if this should actually be considered a breaking change...it's just a warning but what if someone CI depends on no warnings to pass?

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

@changeset-bot
Copy link

changeset-bot bot commented Jan 31, 2026

🦋 Changeset detected

Latest commit: 8dea7d1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Minor

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

@github-actions
Copy link
Contributor

Playground

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

@svelte-docs-bot
Copy link

Copy link
Member

@Ocean-OS Ocean-OS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code seems good to me, but I'm questioning whether the mutation part should be removed, since I have a feeling a decent amount of components indirectly (at least to the compiler) mutate bindable props, e.g.

<script>
  let { prop = $bindable() } = $props();
  function_that_mutates_prop(prop);
</script>

which would lead to a false positive.

@paoloricciuti
Copy link
Member Author

Mmm unless we count "passed to a function" as updated and we don't warn in that case.

@Ocean-OS
Copy link
Member

Ocean-OS commented Feb 2, 2026

True, but that still would count something like

let foo = { prop };
mutate(foo);

as a non-mutated prop.
I'm not trying to be contradictory, I just feel that there are more potential edge cases here than we realize.

@paoloricciuti
Copy link
Member Author

Yeah but i think it's fine in this case...you can always update the function to actually mutate and then the warning would not make sense so better not fire "it there is the possibility". I feel like not including mutation would be worse than this no?

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.

Warning for unused $bindable()

3 participants