Skip to content

chore: iterate the query cache maps through a single generator - #16846

Merged
Rich-Harris merged 1 commit into
version-3from
cache-entries-generator
Aug 19, 2026
Merged

chore: iterate the query cache maps through a single generator#16846
Rich-Harris merged 1 commit into
version-3from
cache-entries-generator

Conversation

@Nic-Polumeyv

@Nic-Polumeyv Nic-Polumeyv commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

client.js walks query_map and live_query_map eight times across _invalidate and _goto, each as a hand-written for (const [id, entries] of map) for (const [payload, entry] of entries) pair, and five of those recompute create_remote_key(id, payload) inline to get the key the consumer actually wants.

This adds a cache_entries(map) generator yielding [key, entry] and collapses each site to a single loop. No behaviour change; the walk order and the set of resources touched are identical.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 19, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 9a27d0e:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/9a27d0e659d79015ab65aa9f1a15b5d7a192e6e0

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16846

@changeset-bot

changeset-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9a27d0e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@Nic-Polumeyv
Nic-Polumeyv force-pushed the cache-entries-generator branch 2 times, most recently from f8b810f to 9c03493 Compare August 19, 2026 16:29
@Nic-Polumeyv
Nic-Polumeyv changed the base branch from main to version-3 August 19, 2026 16:29
@svelte-docs-bot

Copy link
Copy Markdown

@Nic-Polumeyv
Nic-Polumeyv force-pushed the cache-entries-generator branch from 9c03493 to e97f363 Compare August 19, 2026 16:33
@Nic-Polumeyv
Nic-Polumeyv force-pushed the cache-entries-generator branch from e97f363 to 9a27d0e Compare August 19, 2026 16:34
@Rich-Harris
Rich-Harris merged commit d455628 into version-3 Aug 19, 2026
27 checks passed
@Rich-Harris
Rich-Harris deleted the cache-entries-generator branch August 19, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants