-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix: prevent ownership warnings if the fallback of a bindable is used #15720
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
Conversation
|
🦋 Changeset detectedLatest commit: 24d4df3 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 |
I think to avoid unexpected behavior like this, we should either use a (weak?)map of bindable fallback proxies instead of adding a property to each one, or omit the symbol from the proxy when using |
Uh weird it should be non enumerable...this definitely needs fixing. Will do tomorrow |
Making a property not enumerable doesn't omit it from |
What if instead we check if the property is actually in |
Dang I knew there was a simpler solution...will fix later! |
@dummdidumm implemented your suggestion 😄 |
return ( | ||
!!get_descriptor(props, prop_name)?.set || | ||
(is_entry_props && prop_name in props) || | ||
!(prop_name in props) |
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.
While that's all correct the function name now is confusing because it no longer is what this check is about. is_bound_or_unset
maybe?
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.
Mmm yeah let me change that, even tho I read that as "if it's unset is automatically bound" but maybe it's better to rename it
Closes #15717
I wonder if there's a better way to do this but i couldn't find one. This seems to work however and I'm not to worried about the weirdness because it's in dev only. WDYT?
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 test
and lint the project withpnpm lint