fix: make SvelteMap work with async mode#17908
Draft
Rich-Harris wants to merge 4 commits intoasync-svelte-setfrom
Draft
fix: make SvelteMap work with async mode#17908Rich-Harris wants to merge 4 commits intoasync-svelte-setfrom
Rich-Harris wants to merge 4 commits intoasync-svelte-setfrom
Conversation
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pushing this up even though it has failing tests. The reason the new test fails is because we keep doing
{await push(...)}every time a promise resolves, because the each block effect (which sets each item's.vsource) re-runs on every traversal. This is because#maybe_dirty_effectsset on traversalis_dirtyis returningtruewhen it should befalseI intend to investigate both of these, because it seems like we're creating inefficiency at best, and incorrect behaviour at worst.
One thing I noticed is that over-execute deriveds when time-travelling, because
effect_tracking()isfalseinsideis_dirty:svelte/packages/svelte/src/internal/client/reactivity/deriveds.js
Lines 403 to 407 in 58f161d
If we could fix that, and get the invalidation right, then maybe we could preserve derived values across batch runs? e.g. we include them in
batch.current, rather than just the ephemeralbatch_values. Unfortunately I anticipate this being a deep rabbit holeBefore 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