-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
make internal sources ownerless #13013
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: 2db64e0 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 |
One thing I notice: in the case of a state proxy that does not have a top-level source, we don't trigger the guard logic — for example if we tweak the example in #10308 <script>
let elapsed = $derived.by(() => {
let object = $state({ seconds: 0 });
setInterval(() => {
console.log('incrementing');
object.seconds += 1;
}, 1000);
return object.seconds;
});
</script>
<p>{elapsed}</p> That's true on |
WIP fix for #13011. Essentially, all the sources that we create internally (
version
sources on proxies and reactive sets/maps/etc) need to be ownerless to avoid triggering the self-dependency guard.One way to do that is to add
, null
to all the internalsource
call-sites, which is what I've started doing here. But really, that's backwards — the real (and future-proof) fix is to have an internal representation of$state
that is distinct fromsource
. Working on that nowBefore submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint