Skip to content

Commit 16551c8

Browse files
authored
sync docs (#725)
* sync docs * Update apps/svelte.dev/content/docs/cli/20-commands/10-sv-create.md
1 parent 0eb5659 commit 16551c8

File tree

16 files changed

+27
-24
lines changed

16 files changed

+27
-24
lines changed

apps/svelte.dev/content/docs/cli/20-commands/20-sv-add.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ You can select multiple space-separated add-ons from [the list below](#Official-
3333
- `paraglide`
3434
- `playwright`
3535
- `prettier`
36-
- `routify`
3736
- `storybook`
3837
- `tailwindcss`
3938
- `vitest`

apps/svelte.dev/content/docs/svelte/01-introduction/02-getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ There are also plugins for [Rollup](https://github.com/sveltejs/rollup-plugin-sv
2121

2222
## Editor tooling
2323

24-
The Svelte team maintains a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) and there are integrations with various other [editors](https://sveltesociety.dev/resources#editor-support) and tools as well.
24+
The Svelte team maintains a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode), and there are integrations with various other [editors](https://sveltesociety.dev/resources#editor-support) and tools as well.
2525

2626
You can also check your code from the command line using [sv check](https://github.com/sveltejs/cli).
2727

apps/svelte.dev/content/docs/svelte/01-introduction/03-svelte-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ A `<script>` tag with a `module` attribute runs once when the module first evalu
5050

5151
You can `export` bindings from this block, and they will become exports of the compiled module. You cannot `export default`, since the default export is the component itself.
5252

53-
> [!NOTE] If you are using TypeScript and import such exports from a `module` block into a `.ts` file, make sure to have your editor setup so that TypeScript knows about them. This is the case for our VS Code extension and the IntelliJ plugin, in other cases you might need to setup our [TypeScript editor plugin](https://www.npmjs.com/package/typescript-svelte-plugin).
53+
> [!NOTE] If you are using TypeScript and import such exports from a `module` block into a `.ts` file, make sure to have your editor setup so that TypeScript knows about them. This is the case for our VS Code extension and the IntelliJ plugin, but in other cases you might need to setup our [TypeScript editor plugin](https://www.npmjs.com/package/typescript-svelte-plugin).
5454
5555
> [!LEGACY]
5656
> In Svelte 4, this script tag was created using `<script context="module">`

apps/svelte.dev/content/docs/svelte/02-runes/03-$derived.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The expression inside `$derived(...)` should be free of side-effects. Svelte wil
2121

2222
As with `$state`, you can mark class fields as `$derived`.
2323

24-
> [!NOTE] Code in Svelte components is only executed once at creation, without the `$derived` rune `double` would maintain it's original value.
24+
> [!NOTE] Code in Svelte components is only executed once at creation. Without the `$derived` rune, `doubled` would maintain its original value even when `count` changes.
2525
2626
## `$derived.by`
2727

apps/svelte.dev/content/docs/svelte/02-runes/04-$effect.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,7 @@ export default function readable<T>(
243243

244244
## `$effect.root`
245245

246-
The `$effect.root` rune is an advanced feature that creates a non-tracked scope that doesn't auto-cleanup. This is useful for
247-
nested effects that you want to manually control. This rune also allows for creation of effects outside of the component initialisation phase.
246+
The `$effect.root` rune is an advanced feature that creates a non-tracked scope that doesn't auto-cleanup. This is useful for nested effects that you want to manually control. This rune also allows for the creation of effects outside of the component initialisation phase.
248247

249248
```svelte
250249
<script>

apps/svelte.dev/content/docs/svelte/03-template-syntax/05-await.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Await blocks allow you to branch on the three possible states of a [`Promise`](h
3939

4040
> [!NOTE] During server-side rendering, only the pending branch will be rendered.
4141
>
42-
> If the provided expression is not a `Promise` only the `:then` branch will be rendered, including during server-side rendering.
42+
> If the provided expression is not a `Promise`, only the `:then` branch will be rendered, including during server-side rendering.
4343
4444
The `catch` block can be omitted if you don't need to render anything when the promise rejects (or no error is possible).
4545

apps/svelte.dev/content/docs/svelte/03-template-syntax/06-snippet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Snippets, and [render tags](@render), are a way to create reusable chunks of mar
5353
{/each}
5454
```
5555

56-
Like function declarations, snippets can have an arbitrary number of parameters, which can have default values, and you can destructure each parameter. You cannot use rest parameters however.
56+
Like function declarations, snippets can have an arbitrary number of parameters, which can have default values, and you can destructure each parameter. You cannot use rest parameters, however.
5757

5858
## Snippet scope
5959

apps/svelte.dev/content/docs/svelte/03-template-syntax/15-animate.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22
title: animate:
33
---
44

5-
6-
7-
85
An animation is triggered when the contents of a [keyed each block](each#Keyed-each-blocks) are re-ordered. Animations do not run when an element is added or removed, only when the index of an existing data item within the each block changes. Animate directives must be on an element that is an _immediate_ child of a keyed each block.
96

107
Animations can be used with Svelte's [built-in animation functions](svelte-animate) or [custom animation functions](#Custom-animation-functions).
118

129
```svelte
13-
<!-- When `list` is reordered the animation will run-->
10+
<!-- When `list` is reordered the animation will run -->
1411
{#each list as item, index (item)}
1512
<li animate:flip>{item}</li>
1613
{/each}
@@ -115,4 +112,3 @@ A custom animation function can also return a `tick` function, which is called _
115112
<div animate:whizz>{item}</div>
116113
{/each}
117114
```
118-

apps/svelte.dev/content/docs/svelte/04-styling/04-nested-style-elements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Nested <style> elements
33
---
44

5-
There should only be 1 top-level `<style>` tag per component.
5+
There can only be one top-level `<style>` tag per component.
66

77
However, it is possible to have a `<style>` tag nested inside other elements or logic blocks.
88

apps/svelte.dev/content/docs/svelte/05-special-elements/06-svelte-options.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@ title: <svelte:options>
88

99
The `<svelte:options>` element provides a place to specify per-component compiler options, which are detailed in the [compiler section](svelte-compiler#compile). The possible options are:
1010

11-
- `immutable={true}` — you never use mutable data, so the compiler can do simple referential equality checks to determine if values have changed
12-
- `immutable={false}` — the default. Svelte will be more conservative about whether or not mutable objects have changed
13-
- `accessors={true}` — adds getters and setters for the component's props
14-
- `accessors={false}` — the default
1511
- `runes={true}` — forces a component into _runes mode_ (see the [Legacy APIs](legacy-overview) section)
1612
- `runes={false}` — forces a component into _legacy mode_
17-
- `namespace="..."` — the namespace where this component will be used, most commonly "svg"; use the "foreign" namespace to opt out of case-insensitive attribute names and HTML-specific warnings
13+
- `namespace="..."` — the namespace where this component will be used, can be "html" (the default), "svg" or "mathml"
1814
- `customElement={...}` — the [options](custom-elements#Component-options) to use when compiling this component as a custom element. If a string is passed, it is used as the `tag` option
15+
- `css="injected"` — the component will inject its styles inline: During server side rendering, it's injected as a `<style>` tag in the `head`, during client side rendering, it's loaded via JavaScript
16+
17+
> [!LEGACY] Deprecated options
18+
> Svelte 4 also included the following options. They are deprecated in Svelte 5 and non-functional in runes mode.
19+
>
20+
> - `immutable={true}` — you never use mutable data, so the compiler can do simple referential equality checks to determine if values have changed
21+
> - `immutable={false}` — the default. Svelte will be more conservative about whether or not mutable objects have changed
22+
> - `accessors={true}` — adds getters and setters for the component's props
23+
> - `accessors={false}` — the default
1924
2025
```svelte
2126
<svelte:options customElement="my-custom-element" />

0 commit comments

Comments
 (0)