-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat: add warning for non-updated bindable #17600
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 8dea7d1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Ocean-OS
left a comment
There was a problem hiding this 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.
|
Mmm unless we count "passed to a function" as updated and we don't warn in that case. |
|
True, but that still would count something like let foo = { prop };
mutate(foo);as a non-mutated prop. |
|
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? |
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
feat:,fix:,chore:, ordocs:.packages/svelte/src, add a changeset (npx changeset).Tests and linting
pnpm testand lint the project withpnpm lint