Skip to content

breaking: deprecate invalidate/invalidateAll#16289

Merged
Rich-Harris merged 8 commits into
version-3from
refresh-invalidate
Jul 10, 2026
Merged

breaking: deprecate invalidate/invalidateAll#16289
Rich-Harris merged 8 commits into
version-3from
refresh-invalidate

Conversation

@dummdidumm

@dummdidumm dummdidumm commented Jul 9, 2026

Copy link
Copy Markdown
Member
  • Add option to invalidate to not reset page.state (we don't want to add refresh for this as we may want to introduce it in relation to queries and not for load functions)
  • Deprecated invalidateAll in favor of refreshAll (also on goto)
  • Removed the includeLoadFunctions option from refreshAll - it now always reruns load functions

Closes #11783 Closes #13139

…lidateAll`

- Added a `refresh` method that works like `invalidate` but does not reset `page.state`
- Added new `refresh` method (which also doesn't reset `page.state`)
- Deprecated `invalidate(All)` in favor of `refresh(All)` (also on `goto`)
- Removed the `includeLoadFunctions` option from `refreshAll` - it now always reruns `load` functions

Closes #11783
Closes #13139
@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9851cce

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 Major

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

@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 9, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 9851cce:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/9851cce2901cdfc261c932660b268aed4ec38378

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

@svelte-docs-bot

Copy link
Copy Markdown

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

Generated goto type definitions in packages/kit/types/index.d.ts are stale — the refreshAll and refresh options are missing from the opts object even though the source JSDoc declares them.

Fix on Vercel

@dummdidumm dummdidumm changed the title breaking: add refresh/refreshAll and deprecate invalidate/invalidateAll breaking: deprecate invalidate/invalidateAll Jul 9, 2026
Comment thread packages/kit/src/runtime/client/client.js Outdated
Comment thread packages/kit/src/exports/public.d.ts Outdated
Comment thread documentation/docs/20-core-concepts/20-load.md Outdated
Comment thread .changeset/refresh-page-state.md Outdated
Comment thread packages/kit/src/exports/public.d.ts Outdated
Comment thread packages/kit/src/exports/public.d.ts Outdated
Comment thread packages/kit/src/exports/public.d.ts Outdated
Comment thread packages/kit/src/exports/public.d.ts Outdated
Comment thread packages/kit/src/runtime/client/client.js Outdated
Comment thread packages/kit/src/runtime/client/client.js Outdated
Comment thread packages/kit/src/runtime/client/client.js Outdated
Comment thread packages/kit/src/runtime/client/client.js Outdated
@teemingc

teemingc commented Jul 10, 2026

Copy link
Copy Markdown
Member

LGTM. Just a few changes needed like the snake case parameter in invalidate and removing references to refresh

Comment thread packages/kit/src/exports/public.d.ts Outdated
Co-authored-by: Tee Ming <chewteeming01@gmail.com>
Comment thread packages/kit/src/runtime/client/client.js
Comment thread packages/kit/types/index.d.ts Outdated
@Rich-Harris Rich-Harris dismissed teemingc’s stale review July 10, 2026 17:31

changes were made

@Rich-Harris Rich-Harris merged commit 8293144 into version-3 Jul 10, 2026
18 checks passed
@Rich-Harris Rich-Harris deleted the refresh-invalidate branch July 10, 2026 18:24
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.

Invalidate data without resetting $page.state $page.state is cleared when invalidate is invoked

3 participants