diff --git a/apps/svelte.dev/content/docs/kit/20-core-concepts/60-remote-functions.md b/apps/svelte.dev/content/docs/kit/20-core-concepts/60-remote-functions.md index 08d877549c..b7e6f95e6b 100644 --- a/apps/svelte.dev/content/docs/kit/20-core-concepts/60-remote-functions.md +++ b/apps/svelte.dev/content/docs/kit/20-core-concepts/60-remote-functions.md @@ -504,9 +504,11 @@ Now simply call `addLike`, from (for example) an event handler: > [!NOTE] Commands cannot be called during render. -### Single-flight mutations +### Updating queries + +To update `getLikes(item.id)`, or any other query, we need to tell SvelteKit _which_ queries need to be refreshed (unlike `form`, which by default invalidates everything, to approximate the behaviour of a native form submission). -As with forms, any queries on the page (such as `getLikes(item.id)` in the example above) will automatically be refreshed following a successful command. But we can make things more efficient by telling SvelteKit which queries will be affected by the command, either inside the command itself... +We either do that inside the command itself... ```js /// file: likes.remote.js diff --git a/apps/svelte.dev/content/docs/kit/25-build-and-deploy/40-adapter-node.md b/apps/svelte.dev/content/docs/kit/25-build-and-deploy/40-adapter-node.md index 8652b77f2e..acca177db0 100644 --- a/apps/svelte.dev/content/docs/kit/25-build-and-deploy/40-adapter-node.md +++ b/apps/svelte.dev/content/docs/kit/25-build-and-deploy/40-adapter-node.md @@ -210,7 +210,7 @@ The parameter `reason` has one of the following values: ## Socket activation -Most Linux operating systems today use a modern process manager called systemd to start the server and run and manage services. You can configure your server to allocate a socket and start and scale your app on demand. This is called [socket activation](http://0pointer.de/blog/projects/socket-activated-containers.html). In this case, the OS will pass two environment variables to your app — `LISTEN_PID` and `LISTEN_FDS`. The adapter will then listen on file descriptor 3 which refers to a systemd socket unit that you will have to create. +Most Linux operating systems today use a modern process manager called systemd to start the server and run and manage services. You can configure your server to allocate a socket and start and scale your app on demand. This is called [socket activation](https://0pointer.de/blog/projects/socket-activated-containers.html). In this case, the OS will pass two environment variables to your app — `LISTEN_PID` and `LISTEN_FDS`. The adapter will then listen on file descriptor 3 which refers to a systemd socket unit that you will have to create. > [!NOTE] You can still use [`envPrefix`](#Options-envPrefix) with systemd socket activation. `LISTEN_PID` and `LISTEN_FDS` are always read without a prefix. diff --git a/apps/svelte.dev/content/docs/kit/25-build-and-deploy/50-adapter-static.md b/apps/svelte.dev/content/docs/kit/25-build-and-deploy/50-adapter-static.md index 2635e56185..694eda0c47 100644 --- a/apps/svelte.dev/content/docs/kit/25-build-and-deploy/50-adapter-static.md +++ b/apps/svelte.dev/content/docs/kit/25-build-and-deploy/50-adapter-static.md @@ -139,7 +139,7 @@ jobs: cache: npm - name: Install dependencies - run: npm install + run: npm i - name: build env: diff --git a/apps/svelte.dev/content/docs/kit/40-best-practices/07-images.md b/apps/svelte.dev/content/docs/kit/40-best-practices/07-images.md index 62d0aae166..66a24c9e9d 100644 --- a/apps/svelte.dev/content/docs/kit/40-best-practices/07-images.md +++ b/apps/svelte.dev/content/docs/kit/40-best-practices/07-images.md @@ -34,7 +34,7 @@ Doing this manually is tedious. There are a variety of techniques you can use, d Install: ```sh -npm install --save-dev @sveltejs/enhanced-img +npm i -D @sveltejs/enhanced-img ``` Adjust `vite.config.js`: diff --git a/apps/svelte.dev/content/docs/kit/60-appendix/20-integrations.md b/apps/svelte.dev/content/docs/kit/60-appendix/20-integrations.md index 4958096fe3..e65b74127d 100644 --- a/apps/svelte.dev/content/docs/kit/60-appendix/20-integrations.md +++ b/apps/svelte.dev/content/docs/kit/60-appendix/20-integrations.md @@ -42,7 +42,7 @@ See [sveltesociety.dev](https://sveltesociety.dev/) for a full listing of [packa `svelte-preprocess` has some additional functionality not found in `vitePreprocess` such as support for Pug, Babel, and global styles. However, `vitePreprocess` may be faster and require less configuration, so it is used by default. Note that CoffeeScript is [not supported](https://github.com/sveltejs/kit/issues/2920#issuecomment-996469815) by SvelteKit. -You will need to install `svelte-preprocess` with `npm install --save-dev svelte-preprocess` and [add it to your `svelte.config.js`](https://github.com/sveltejs/svelte-preprocess/blob/main/docs/usage.md#with-svelte-config). After that, you will often need to [install the corresponding library](https://github.com/sveltejs/svelte-preprocess/blob/main/docs/getting-started.md) such as `npm install -D sass` or `npm install -D less`. +You will need to install `svelte-preprocess` with `npm i -D svelte-preprocess` and [add it to your `svelte.config.js`](https://github.com/sveltejs/svelte-preprocess/blob/main/docs/usage.md#with-svelte-config). After that, you will often need to [install the corresponding library](https://github.com/sveltejs/svelte-preprocess/blob/main/docs/getting-started.md) such as `npm i -D sass` or `npm i -D less`. ## Vite plugins diff --git a/apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md b/apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md index 17733ce3b8..f49f4fe491 100644 --- a/apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md +++ b/apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md @@ -1600,13 +1600,17 @@ Information about the target of a specific navigation.
```dts -interface NavigationTarget {/*…*/} +interface NavigationTarget< + Params extends + AppLayoutParams<'/'> = AppLayoutParams<'/'>, + RouteId extends AppRouteId | null = AppRouteId | null +> {/*…*/} ```
```dts -params: Record | null; +params: Params | null; ```
@@ -1630,7 +1634,7 @@ Info about the target route
```dts -id: string | null; +id: RouteId | null; ```
@@ -1928,14 +1932,16 @@ The return value of a remote `command` function. See [Remote functions](/docs/ki
```dts -type RemoteCommand = (arg: Input) => Promise< - Awaited -> & { - updates( - ...queries: Array< - RemoteQuery | RemoteQueryOverride - > - ): Promise>; +type RemoteCommand = { + (arg: Input): Promise> & { + updates( + ...queries: Array< + RemoteQuery | RemoteQueryOverride + > + ): Promise>; + }; + /** The number of pending command executions */ + get pending(): number; }; ``` @@ -1991,6 +1997,8 @@ type RemoteForm = { ): Omit, 'for'>; /** The result of the form submission */ get result(): Result | undefined; + /** The number of pending submissions */ + get pending(): number; /** Spread this onto a `