diff --git a/documentation/docs/10-getting-started/20-creating-a-project.md b/documentation/docs/10-getting-started/20-creating-a-project.md
index 856818974c9d..c5d7c3a305e9 100644
--- a/documentation/docs/10-getting-started/20-creating-a-project.md
+++ b/documentation/docs/10-getting-started/20-creating-a-project.md
@@ -7,11 +7,10 @@ The easiest way to start building a SvelteKit app is to run `npx sv create`:
```sh
npx sv create my-app
cd my-app
-npm install
npm run dev
```
-The first command will scaffold a new project in the `my-app` directory asking you if you'd like to set up some basic tooling such as TypeScript. See [integrations](./integrations) for pointers on setting up additional tooling. The subsequent commands will then install its dependencies and start a server on [localhost:5173](http://localhost:5173).
+The first command will scaffold a new project in the `my-app` directory asking if you'd like to set up some basic tooling such as TypeScript. See [the CLI docs](/docs/cli/overview) for information about these options and [the integrations page](./integrations) for pointers on setting up additional tooling. `npm run dev` will then start the development server on [localhost:5173](http://localhost:5173) - make sure you install dependencies before running this if you didn't do so during project creation.
There are two basic concepts:
diff --git a/documentation/docs/20-core-concepts/20-load.md b/documentation/docs/20-core-concepts/20-load.md
index e8cc305a19e6..49b456f9041d 100644
--- a/documentation/docs/20-core-concepts/20-load.md
+++ b/documentation/docs/20-core-concepts/20-load.md
@@ -188,7 +188,7 @@ Conceptually, they're the same thing, but there are some important differences t
Server `load` functions _always_ run on the server.
-By default, universal `load` functions run on the server during SSR when the user first visits your page. They will then run again during hydration, reusing any responses from [fetch requests](#Making-fetch-requests). All subsequent invocations of universal `load` functions happen in the browser. You can customize the behavior through [page options](page-options). If you disable [server side rendering](page-options#ssr), you'll get an SPA and universal `load` functions _always_ run on the client.
+By default, universal `load` functions run on the server during SSR when the user first visits your page. They will then run again during hydration, reusing any responses from [fetch requests](#Making-fetch-requests). All subsequent invocations of universal `load` functions happen in the browser. You can customize the behavior through [page options](page-options). If you disable [server-side rendering](page-options#ssr), you'll get an SPA and universal `load` functions _always_ run on the client.
If a route contains both universal and server `load` functions, the server `load` runs first.
diff --git a/documentation/docs/20-core-concepts/60-remote-functions.md b/documentation/docs/20-core-concepts/60-remote-functions.md
index b62e6585fcb5..a4607a4f19ed 100644
--- a/documentation/docs/20-core-concepts/60-remote-functions.md
+++ b/documentation/docs/20-core-concepts/60-remote-functions.md
@@ -6,7 +6,7 @@ title: Remote functions
Available since 2.27
-Remote functions are a tool for type-safe communication between client and server. They can be _called_ anywhere in your app, but always _run_ on the server, and as such can safely access [server-only modules](server-only-modules) containing things like environment variables and database clients.
+Remote functions are a tool for type-safe communication between client and server. They can be _called_ anywhere in your app, but always _run_ on the server, meaning they can safely access [server-only modules](server-only-modules) containing things like environment variables and database clients.
Combined with Svelte's experimental support for [`await`](/docs/svelte/await-expressions), it allows you to load and manipulate data directly inside your components.
@@ -113,7 +113,7 @@ Query functions can accept an argument, such as the `slug` of an individual post
let { params } = $props();
- const post = getPost(params.slug);
+ const post = await getPost(params.slug);
{post.title}
@@ -160,7 +160,7 @@ Any query can be updated via its `refresh` method:
```
-> [!NOTE] Queries are cached while they're on the page, meaning `getPosts() === getPosts()`. As such, you don't need a reference like `const posts = getPosts()` in order to refresh the query.
+> [!NOTE] Queries are cached while they're on the page, meaning `getPosts() === getPosts()`. This means you don't need a reference like `const posts = getPosts()` in order to refresh the query.
## form
@@ -656,7 +656,7 @@ export const getPost = prerender(
);
```
-> [!NOTE] Svelte does not yet support asynchronous server-side rendering, and as such it's likely that you're only calling remote functions from the browser, rather than during prerendering. Because of this you will need to use `inputs`, for now. We're actively working on this roadblock.
+> [!NOTE] Svelte does not yet support asynchronous server-side rendering, so it's likely that you're only calling remote functions from the browser, rather than during prerendering. Because of this, you will need to use `inputs`, for now. We're actively working on this roadblock.
By default, prerender functions are excluded from your server bundle, which means that you cannot call them with any arguments that were _not_ prerendered. You can set `dynamic: true` to change this behaviour:
diff --git a/documentation/docs/30-advanced/40-service-workers.md b/documentation/docs/30-advanced/40-service-workers.md
index f57dba4abc7e..1eabcc4b5275 100644
--- a/documentation/docs/30-advanced/40-service-workers.md
+++ b/documentation/docs/30-advanced/40-service-workers.md
@@ -126,7 +126,7 @@ navigator.serviceWorker.register('/service-worker.js', {
Setting up proper types for service workers requires some manual setup. Inside your `service-worker.js`, add the following to the top of your file:
-```original-js
+```js
///
///
///
@@ -134,7 +134,7 @@ Setting up proper types for service workers requires some manual setup. Inside y
const sw = /** @type {ServiceWorkerGlobalScope} */ (/** @type {unknown} */ (self));
```
-```generated-ts
+```ts
///
///
///
diff --git a/documentation/docs/60-appendix/30-migrating-to-sveltekit-2.md b/documentation/docs/60-appendix/30-migrating-to-sveltekit-2.md
index 72b3b2f3fbd4..ed7666c54800 100644
--- a/documentation/docs/60-appendix/30-migrating-to-sveltekit-2.md
+++ b/documentation/docs/60-appendix/30-migrating-to-sveltekit-2.md
@@ -90,7 +90,7 @@ This inconsistency is fixed in version 2. Paths are either always relative or al
## Server fetches are not trackable anymore
-Previously it was possible to track URLs from `fetch`es on the server in order to rerun load functions. This poses a possible security risk (private URLs leaking), and as such it was behind the `dangerZone.trackServerFetches` setting, which is now removed.
+Previously it was possible to track URLs from `fetch`es on the server in order to rerun load functions. This poses a possible security risk (private URLs leaking), and for this reason it was behind the `dangerZone.trackServerFetches` setting, which is now removed.
## `preloadCode` arguments must be prefixed with `base`
@@ -104,7 +104,7 @@ Additionally, `preloadCode` now takes a single argument rather than _n_ argument
SvelteKit 1 included a function called `resolvePath` which allows you to resolve a route ID (like `/blog/[slug]`) and a set of parameters (like `{ slug: 'hello' }`) to a pathname. Unfortunately the return value didn't include the `base` path, limiting its usefulness in cases where `base` was set.
-As such, SvelteKit 2 replaces `resolvePath` with a (slightly better named) function called `resolveRoute`, which is imported from `$app/paths` and which takes `base` into account.
+For this reason, SvelteKit 2 replaces `resolvePath` with a (slightly better named) function called `resolveRoute`, which is imported from `$app/paths` and which takes `base` into account.
```js
---import { resolvePath } from '@sveltejs/kit';
@@ -127,7 +127,7 @@ SvelteKit 2 cleans this up by calling `handleError` hooks with two new propertie
The `$env/dynamic/public` and `$env/dynamic/private` modules provide access to _run time_ environment variables, as opposed to the _build time_ environment variables exposed by `$env/static/public` and `$env/static/private`.
-During prerendering in SvelteKit 1, they are one and the same. As such, prerendered pages that make use of 'dynamic' environment variables are really 'baking in' build time values, which is incorrect. Worse, `$env/dynamic/public` is populated in the browser with these stale values if the user happens to land on a prerendered page before navigating to dynamically-rendered pages.
+During prerendering in SvelteKit 1, they are one and the same. This means that prerendered pages that make use of 'dynamic' environment variables are really 'baking in' build time values, which is incorrect. Worse, `$env/dynamic/public` is populated in the browser with these stale values if the user happens to land on a prerendered page before navigating to dynamically-rendered pages.
Because of this, dynamic environment variables can no longer be read during prerendering in SvelteKit 2 — you should use the `static` modules instead. If the user lands on a prerendered page, SvelteKit will request up-to-date values for `$env/dynamic/public` from the server (by default from a module called `/_app/env.js`) instead of reading them from the server-rendered HTML.
diff --git a/package.json b/package.json
index e36ec2939797..e203c771c373 100644
--- a/package.json
+++ b/package.json
@@ -29,9 +29,9 @@
"eslint": "^9.29.0",
"prettier": "^3.6.0",
"prettier-plugin-svelte": "^3.4.0",
- "typescript-eslint": "^8.35.0"
+ "typescript-eslint": "^8.39.0"
},
- "packageManager": "pnpm@10.13.1",
+ "packageManager": "pnpm@10.14.0",
"engines": {
"pnpm": ">=9.0.0"
},
diff --git a/packages/adapter-netlify/test/apps/basic/package.json b/packages/adapter-netlify/test/apps/basic/package.json
index 417ab3bc3286..be74b3f2b9ef 100644
--- a/packages/adapter-netlify/test/apps/basic/package.json
+++ b/packages/adapter-netlify/test/apps/basic/package.json
@@ -12,7 +12,7 @@
"devDependencies": {
"@sveltejs/kit": "workspace:^",
"@sveltejs/vite-plugin-svelte": "catalog:",
- "netlify-cli": "^22.1.5",
+ "netlify-cli": "^23.0.0",
"svelte": "^5.23.1",
"vite": "catalog:"
},
diff --git a/packages/adapter-netlify/test/apps/edge/package.json b/packages/adapter-netlify/test/apps/edge/package.json
index a559f3c73005..d458fb8af450 100644
--- a/packages/adapter-netlify/test/apps/edge/package.json
+++ b/packages/adapter-netlify/test/apps/edge/package.json
@@ -12,7 +12,7 @@
"devDependencies": {
"@sveltejs/kit": "workspace:^",
"@sveltejs/vite-plugin-svelte": "catalog:",
- "netlify-cli": "^22.1.5",
+ "netlify-cli": "^23.0.0",
"svelte": "^5.23.1",
"vite": "catalog:"
},
diff --git a/packages/adapter-vercel/test/utils.spec.js b/packages/adapter-vercel/test/utils.spec.js
index 866523a99351..34286d7c2ff1 100644
--- a/packages/adapter-vercel/test/utils.spec.js
+++ b/packages/adapter-vercel/test/utils.spec.js
@@ -124,9 +124,9 @@ test('pattern_to_src for route with optional parameter in the middle', () => {
});
test('pattern_to_src for route with rest parameter', () => {
- run_pattern_to_src_test('/foo/[...bar]', '^/foo(/.*)?/?');
+ run_pattern_to_src_test('/foo/[...bar]', '^/foo(/[^]*)?/?');
});
test('pattern_to_src for route with rest parameter in the middle', () => {
- run_pattern_to_src_test('/foo/[...bar]/baz', '^/foo(/.*)?/baz/?');
+ run_pattern_to_src_test('/foo/[...bar]/baz', '^/foo(/[^]*)?/baz/?');
});
diff --git a/packages/kit/CHANGELOG.md b/packages/kit/CHANGELOG.md
index 6d25ae260817..d283c3639f32 100644
--- a/packages/kit/CHANGELOG.md
+++ b/packages/kit/CHANGELOG.md
@@ -1,5 +1,17 @@
# @sveltejs/kit
+## 2.27.1
+### Patch Changes
+
+
+- fix: correctly type remote function input parameters from a schema ([#14098](https://github.com/sveltejs/kit/pull/14098))
+
+
+- fix: match URL-encoded newlines in rest route params ([#14102](https://github.com/sveltejs/kit/pull/14102))
+
+
+- fix: correctly spell server-side in error messages ([#14101](https://github.com/sveltejs/kit/pull/14101))
+
## 2.27.0
### Minor Changes
diff --git a/packages/kit/package.json b/packages/kit/package.json
index 6943548179f4..ab375785256c 100644
--- a/packages/kit/package.json
+++ b/packages/kit/package.json
@@ -1,6 +1,6 @@
{
"name": "@sveltejs/kit",
- "version": "2.27.0",
+ "version": "2.27.1",
"description": "SvelteKit is the fastest way to build Svelte apps",
"keywords": [
"framework",
diff --git a/packages/kit/src/core/generate_manifest/index.js b/packages/kit/src/core/generate_manifest/index.js
index 2c5c640470eb..8b775584c3a1 100644
--- a/packages/kit/src/core/generate_manifest/index.js
+++ b/packages/kit/src/core/generate_manifest/index.js
@@ -59,7 +59,7 @@ export function generate_manifest({ build_data, prerendered, relative_path, rout
assets.push(build_data.service_worker);
}
- // In case of server side route resolution, we need to include all matchers. Prerendered routes are not part
+ // In case of server-side route resolution, we need to include all matchers. Prerendered routes are not part
// of the server manifest, and they could reference matchers that then would not be included.
const matchers = new Set(
build_data.client?.nodes ? Object.keys(build_data.manifest_data.matchers) : undefined
diff --git a/packages/kit/src/core/sync/create_manifest_data/index.spec.js b/packages/kit/src/core/sync/create_manifest_data/index.spec.js
index 2642e0c3cce0..c681184446a6 100644
--- a/packages/kit/src/core/sync/create_manifest_data/index.spec.js
+++ b/packages/kit/src/core/sync/create_manifest_data/index.spec.js
@@ -268,7 +268,7 @@ test('sorts routes with rest correctly', () => {
},
{
id: '/a/[...rest]',
- pattern: '/^/a(?:/(.*))?/?$/',
+ pattern: '/^/a(?:/([^]*))?/?$/',
page: { layouts: [0], errors: [1], leaf: 2 }
},
{
@@ -277,7 +277,7 @@ test('sorts routes with rest correctly', () => {
},
{
id: '/b/[...rest]',
- pattern: '/^/b(?:/(.*))?/?$/',
+ pattern: '/^/b(?:/([^]*))?/?$/',
page: { layouts: [0], errors: [1], leaf: 3 }
}
]);
@@ -301,12 +301,12 @@ test('allows rest parameters inside segments', () => {
},
{
id: '/prefix-[...rest]',
- pattern: '/^/prefix-(.*?)/?$/',
+ pattern: '/^/prefix-([^]*?)/?$/',
page: { layouts: [0], errors: [1], leaf: 2 }
},
{
id: '/[...rest].json',
- pattern: '/^/(.*?).json/?$/',
+ pattern: '/^/([^]*?).json/?$/',
endpoint: {
file: 'samples/rest-prefix-suffix/[...rest].json/+server.js'
}
@@ -714,7 +714,7 @@ test('handles pages without .svelte file', () => {
},
{
id: '/error/[...path]',
- pattern: '/^/error(?:/(.*))?/?$/',
+ pattern: '/^/error(?:/([^]*))?/?$/',
page: { layouts: [0, undefined], errors: [1, 2], leaf: 6 }
},
{
diff --git a/packages/kit/src/runtime/app/server/remote/command.js b/packages/kit/src/runtime/app/server/remote/command.js
index 60884db61986..951ab3ab6ff8 100644
--- a/packages/kit/src/runtime/app/server/remote/command.js
+++ b/packages/kit/src/runtime/app/server/remote/command.js
@@ -39,7 +39,7 @@ import { get_event_state } from '../../../server/event-state.js';
* @overload
* @param {Schema} validate
* @param {(arg: StandardSchemaV1.InferOutput) => Output} fn
- * @returns {RemoteCommand, Output>}
+ * @returns {RemoteCommand, Output>}
* @since 2.27
*/
/**
diff --git a/packages/kit/src/runtime/app/server/remote/prerender.js b/packages/kit/src/runtime/app/server/remote/prerender.js
index 8efaf740d10e..ea4a3a909fb2 100644
--- a/packages/kit/src/runtime/app/server/remote/prerender.js
+++ b/packages/kit/src/runtime/app/server/remote/prerender.js
@@ -51,8 +51,8 @@ import { get_event_state } from '../../../server/event-state.js';
* @overload
* @param {Schema} schema
* @param {(arg: StandardSchemaV1.InferOutput) => MaybePromise