-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: update untracked writes for BLOCK_EFFECT
s too
#16110
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
Open
paoloricciuti
wants to merge
7
commits into
main
Choose a base branch
from
derived-reactions-maybe-dirty-marked
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+61
−0
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
02a30b5
fix: mark reactions of `MAYBE_DIRTY` reactions too
paoloricciuti 20cc0fe
fix: `set_untracked_writes` for `BLOCK_EFFECT`'s too
paoloricciuti 9b3677d
chore: changeset
paoloricciuti 88ad663
Update packages/svelte/src/internal/client/reactivity/sources.js
dummdidumm 863f6c1
Update sources.js
dummdidumm b7e7034
Merge remote-tracking branch 'origin/main' into derived-reactions-may…
paoloricciuti 7c9c46c
chore: revert
paoloricciuti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: mark reactions of `MAYBE_DIRTY` reactions too | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/svelte/tests/runtime-runes/samples/derived-dirty-after-read/A.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script> | ||
let {config, value = $bindable()} = $props(); | ||
|
||
$effect.pre(() => { | ||
config; | ||
value = {} | ||
}); | ||
</script> | ||
|
||
a |
10 changes: 10 additions & 0 deletions
10
packages/svelte/tests/runtime-runes/samples/derived-dirty-after-read/B.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script> | ||
let {config, value = $bindable()} = $props(); | ||
|
||
$effect.pre(() => { | ||
config; | ||
value = {} | ||
}); | ||
</script> | ||
|
||
b |
14 changes: 14 additions & 0 deletions
14
packages/svelte/tests/runtime-runes/samples/derived-dirty-after-read/_config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { flushSync } from 'svelte'; | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
html: '<button></button> a', | ||
async test({ assert, target }) { | ||
const btn = target.querySelector('button'); | ||
flushSync(() => { | ||
btn?.click(); | ||
}); | ||
|
||
assert.htmlEqual(target.innerHTML, `<button></button> b`); | ||
} | ||
}); |
22 changes: 22 additions & 0 deletions
22
packages/svelte/tests/runtime-runes/samples/derived-dirty-after-read/main.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script> | ||
import A from "./A.svelte"; | ||
import B from "./B.svelte"; | ||
|
||
let schema = $state("any"); | ||
let value = $state({}); | ||
|
||
let config = $derived.by(() => { | ||
value; | ||
return schema; | ||
}); | ||
|
||
let Thing = $derived.by(() => { | ||
return config === "any" ? A : B; | ||
}); | ||
</script> | ||
|
||
<button onclick={()=>{ | ||
schema = "one"; | ||
}}></button> | ||
|
||
<Thing {config} bind:value/> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.