diff --git a/.changeset/sixty-shrimps-mate.md b/.changeset/sixty-shrimps-mate.md
new file mode 100644
index 00000000..f81a7df0
--- /dev/null
+++ b/.changeset/sixty-shrimps-mate.md
@@ -0,0 +1,5 @@
+---
+'sv': patch
+---
+
+feat: migrate to `$app/state`
diff --git a/packages/addons/paraglide/index.ts b/packages/addons/paraglide/index.ts
index 920ce648..6a55ae8f 100644
--- a/packages/addons/paraglide/index.ts
+++ b/packages/addons/paraglide/index.ts
@@ -231,7 +231,7 @@ export default defineAddon({
imports.addDefault(script.ast, '$lib/paraglide/messages.js', '* as m');
imports.addNamed(script.ast, '$app/navigation', { goto: 'goto' });
- imports.addNamed(script.ast, '$app/stores', { page: 'page' });
+ imports.addNamed(script.ast, '$app/state', { page: 'page' });
imports.addNamed(script.ast, '$lib/i18n', { i18n: 'i18n' });
if (typescript) {
imports.addNamed(
@@ -253,7 +253,7 @@ export default defineAddon({
${ts('', '* @param {import("$lib/paraglide/runtime").AvailableLanguageTag} newLanguage')}
${ts('', '*/')}
function switchToLanguage(newLanguage${ts(': AvailableLanguageTag')}) {
- const canonicalPath = i18n.route($page.url.pathname);
+ const canonicalPath = i18n.route(page.url.pathname);
const localisedPath = i18n.resolveRoute(canonicalPath, newLanguage);
goto(localisedPath);
}
diff --git a/packages/core/tests/js/common/jsdoc-comment/input.ts b/packages/core/tests/js/common/jsdoc-comment/input.ts
index a3423c81..13e8e7f5 100644
--- a/packages/core/tests/js/common/jsdoc-comment/input.ts
+++ b/packages/core/tests/js/common/jsdoc-comment/input.ts
@@ -1,5 +1,5 @@
function switchToLanguage(newLanguage) {
- const canonicalPath = i18n.route($page.url.pathname);
+ const canonicalPath = i18n.route(page.url.pathname);
const localisedPath = i18n.resolveRoute(canonicalPath, newLanguage);
goto(localisedPath);
}
diff --git a/packages/core/tests/js/common/jsdoc-comment/output.ts b/packages/core/tests/js/common/jsdoc-comment/output.ts
index 2394044f..c762d4d8 100644
--- a/packages/core/tests/js/common/jsdoc-comment/output.ts
+++ b/packages/core/tests/js/common/jsdoc-comment/output.ts
@@ -2,7 +2,7 @@
* @param {import("$lib/paraglide/runtime").AvailableLanguageTag} newLanguage
*/
function switchToLanguage(newLanguage) {
- const canonicalPath = i18n.route($page.url.pathname);
+ const canonicalPath = i18n.route(page.url.pathname);
const localisedPath = i18n.resolveRoute(canonicalPath, newLanguage);
goto(localisedPath);
}
diff --git a/packages/create/templates/demo/src/routes/Header.svelte b/packages/create/templates/demo/src/routes/Header.svelte
index bf33c490..1eb310ba 100644
--- a/packages/create/templates/demo/src/routes/Header.svelte
+++ b/packages/create/templates/demo/src/routes/Header.svelte
@@ -1,5 +1,5 @@
@@ -16,13 +16,13 @@