From 8aa34c1addc7f52e7c08ccd719209ea964ba48f2 Mon Sep 17 00:00:00 2001 From: Vhtmui <46163279+vhtmui@users.noreply.github.com> Date: Sat, 30 Nov 2024 02:04:29 +0800 Subject: [PATCH 1/7] fix: incorrect value in element. Co-authored-by: 15363205631 --- apps/svelte.dev/src/routes/tutorial/[...slug]/Controls.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/svelte.dev/src/routes/tutorial/[...slug]/Controls.svelte b/apps/svelte.dev/src/routes/tutorial/[...slug]/Controls.svelte index c883dcb50..14ff90479 100644 --- a/apps/svelte.dev/src/routes/tutorial/[...slug]/Controls.svelte +++ b/apps/svelte.dev/src/routes/tutorial/[...slug]/Controls.svelte @@ -17,7 +17,7 @@ // TODO this really sucks, why is `exercise.slug` not the slug? let actual_slug = $derived.by(() => { const parts = exercise.slug.split('/'); - return `${parts[1]}/${parts[3]}`; + return `${parts[1].includes('kit') ? 'kit' : 'svelte'}/${parts[3]}`; }); From 0b3567e0eaaa235ee88e09619aa330958508d2d7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 30 Nov 2024 12:25:55 -0500 Subject: [PATCH 2/7] Sync `kit` docs (#897) sync kit docs Co-authored-by: Rich-Harris <1162160+Rich-Harris@users.noreply.github.com> --- .../content/docs/kit/98-reference/10-@sveltejs-kit.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 0eb8a5b8c..973c5252e 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 @@ -94,9 +94,7 @@ Checks whether this is an action failure thrown by `fail`.
```dts -function isActionFailure( - e: unknown -): e is ActionFailure; +function isActionFailure(e: unknown): e is ActionFailure; ```
From 4486c859229d07a99b138b192928948aa4fe7521 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 30 Nov 2024 12:26:33 -0500 Subject: [PATCH 3/7] Sync `cli` docs (#898) sync cli docs Co-authored-by: Rich-Harris <1162160+Rich-Harris@users.noreply.github.com> --- apps/svelte.dev/content/docs/cli/20-commands/40-sv-migrate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/svelte.dev/content/docs/cli/20-commands/40-sv-migrate.md b/apps/svelte.dev/content/docs/cli/20-commands/40-sv-migrate.md index 8db5eb3b1..f0cdf1838 100644 --- a/apps/svelte.dev/content/docs/cli/20-commands/40-sv-migrate.md +++ b/apps/svelte.dev/content/docs/cli/20-commands/40-sv-migrate.md @@ -2,7 +2,7 @@ title: sv migrate --- -`sv migrate` migrates Svelte(Kit) codebases. It delegates to the [`svelte-migrate`](https://github.com/sveltejs/kit/blob/main/packages/migrate) package. +`sv migrate` migrates Svelte(Kit) codebases. It delegates to the [`svelte-migrate`](https://www.npmjs.com/package/svelte-migrate) package. Some migrations may annotate your codebase with tasks for completion that you can find by searching for `@migration`. From 9d357d29e5c812e26627494fa747560ac446b280 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 30 Nov 2024 12:27:32 -0500 Subject: [PATCH 4/7] Sync `svelte` docs (#901) sync svelte docs Co-authored-by: Rich-Harris <1162160+Rich-Harris@users.noreply.github.com> --- .../content/docs/svelte/98-reference/21-svelte-transition.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/svelte.dev/content/docs/svelte/98-reference/21-svelte-transition.md b/apps/svelte.dev/content/docs/svelte/98-reference/21-svelte-transition.md index a555815dd..5a3848c8a 100644 --- a/apps/svelte.dev/content/docs/svelte/98-reference/21-svelte-transition.md +++ b/apps/svelte.dev/content/docs/svelte/98-reference/21-svelte-transition.md @@ -143,7 +143,7 @@ function fly( ## scale -Animates the opacity and scale of an element. `in` transitions animate from an element's current (default) values to the provided values, passed as parameters. `out` transitions animate from the provided values to an element's default values. +Animates the opacity and scale of an element. `in` transitions animate from the provided values, passed as parameters, to an element's current (default) values. `out` transitions animate from an element's default values to the provided values.
From 229e7b13c3c0e7ee2e29789c194f6f86ec5a7c1c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 09:05:32 -0500 Subject: [PATCH 5/7] Sync `svelte` docs (#903) sync svelte docs Co-authored-by: Rich-Harris <1162160+Rich-Harris@users.noreply.github.com> --- .../05-special-elements/01-svelte-boundary.md | 79 +++++++++++++++++++ ...1-svelte-window.md => 02-svelte-window.md} | 0 ...elte-document.md => 03-svelte-document.md} | 0 .../{03-svelte-body.md => 04-svelte-body.md} | 0 .../{04-svelte-head.md => 05-svelte-head.md} | 0 ...svelte-element.md => 06-svelte-element.md} | 0 ...svelte-options.md => 07-svelte-options.md} | 0 .../98-reference/.generated/compile-errors.md | 12 +++ .../svelte/98-reference/21-svelte-compiler.md | 5 ++ .../svelte/98-reference/30-compiler-errors.md | 12 +++ 10 files changed, 108 insertions(+) create mode 100644 apps/svelte.dev/content/docs/svelte/05-special-elements/01-svelte-boundary.md rename apps/svelte.dev/content/docs/svelte/05-special-elements/{01-svelte-window.md => 02-svelte-window.md} (100%) rename apps/svelte.dev/content/docs/svelte/05-special-elements/{02-svelte-document.md => 03-svelte-document.md} (100%) rename apps/svelte.dev/content/docs/svelte/05-special-elements/{03-svelte-body.md => 04-svelte-body.md} (100%) rename apps/svelte.dev/content/docs/svelte/05-special-elements/{04-svelte-head.md => 05-svelte-head.md} (100%) rename apps/svelte.dev/content/docs/svelte/05-special-elements/{05-svelte-element.md => 06-svelte-element.md} (100%) rename apps/svelte.dev/content/docs/svelte/05-special-elements/{06-svelte-options.md => 07-svelte-options.md} (100%) diff --git a/apps/svelte.dev/content/docs/svelte/05-special-elements/01-svelte-boundary.md b/apps/svelte.dev/content/docs/svelte/05-special-elements/01-svelte-boundary.md new file mode 100644 index 000000000..2e9f85c83 --- /dev/null +++ b/apps/svelte.dev/content/docs/svelte/05-special-elements/01-svelte-boundary.md @@ -0,0 +1,79 @@ +--- +title: +--- + +```svelte +... +``` + +Boundaries allow you to guard against errors in part of your app from breaking the app as a whole, and to recover from those errors. + +If an error occurs while rendering or updating the children of a ``, or running any [`$effect`]($effect) functions contained therein, the contents will be removed. + +Errors occurring outside the rendering process (for example, in event handlers) are _not_ caught by error boundaries. + +## Properties + +For the boundary to do anything, one or both of `failed` and `onerror` must be provided. + +### `failed` + +If an `failed` snippet is provided, it will be rendered with the error that was thrown, and a `reset` function that recreates the contents ([demo](/playground/hello-world#H4sIAAAAAAAAE3VRy26DMBD8lS2tFCIh6JkAUlWp39Cq9EBg06CAbdlLArL87zWGKk8ORnhmd3ZnrD1WtOjFXqKO2BDGW96xqpBD5gXerm5QefG39mgQY9EIWHxueRMinLosti0UPsJLzggZKTeilLWgLGc51a3gkuCjKQ7DO7cXZotgJ3kLqzC6hmex1SZnSXTWYHcrj8LJjWTk0PHoZ8VqIdCOKayPykcpuQxAokJaG1dGybYj4gw4K5u6PKTasSbjXKgnIDlA8VvUdo-pzonraBY2bsH7HAl78mKSHZpgIcuHjq9jXSpZSLixRlveKYQUXhQVhL6GPobXAAb7BbNeyvNUs4qfRg3OnELLj5hqH9eQZqCnoBwR9lYcQxuVXeBzc8kMF8yXY4yNJ5oGiUzP_aaf_waTRGJib5_Ad3P_vbCuaYxzeNpbU0eUMPAOKh7Yw1YErgtoXyuYlPLzc10_xo_5A91zkQL_AgAA)): + +```svelte + + + + {#snippet failed(error, reset)} + + {/snippet} + +``` + +> [!NOTE] +> As with [snippets passed to components](snippet#Passing-snippets-to-components), the `failed` snippet can be passed explicitly as a property... +> +> ```svelte +> ... +> ``` +> +> ...or implicitly by declaring it directly inside the boundary, as in the example above. + +### `onerror` + +If an `onerror` function is provided, it will be called with the same two `error` and `reset` arguments. This is useful for tracking the error with an error reporting service... + +```svelte + report(e)}> + ... + +``` + +...or using `error` and `reset` outside the boundary itself: + +```svelte + + + + + + +{#if error} + +{/if} +``` + +If an error occurs inside the `onerror` function (or if you rethrow the error), it will be handled by a parent boundary if such exists. diff --git a/apps/svelte.dev/content/docs/svelte/05-special-elements/01-svelte-window.md b/apps/svelte.dev/content/docs/svelte/05-special-elements/02-svelte-window.md similarity index 100% rename from apps/svelte.dev/content/docs/svelte/05-special-elements/01-svelte-window.md rename to apps/svelte.dev/content/docs/svelte/05-special-elements/02-svelte-window.md diff --git a/apps/svelte.dev/content/docs/svelte/05-special-elements/02-svelte-document.md b/apps/svelte.dev/content/docs/svelte/05-special-elements/03-svelte-document.md similarity index 100% rename from apps/svelte.dev/content/docs/svelte/05-special-elements/02-svelte-document.md rename to apps/svelte.dev/content/docs/svelte/05-special-elements/03-svelte-document.md diff --git a/apps/svelte.dev/content/docs/svelte/05-special-elements/03-svelte-body.md b/apps/svelte.dev/content/docs/svelte/05-special-elements/04-svelte-body.md similarity index 100% rename from apps/svelte.dev/content/docs/svelte/05-special-elements/03-svelte-body.md rename to apps/svelte.dev/content/docs/svelte/05-special-elements/04-svelte-body.md diff --git a/apps/svelte.dev/content/docs/svelte/05-special-elements/04-svelte-head.md b/apps/svelte.dev/content/docs/svelte/05-special-elements/05-svelte-head.md similarity index 100% rename from apps/svelte.dev/content/docs/svelte/05-special-elements/04-svelte-head.md rename to apps/svelte.dev/content/docs/svelte/05-special-elements/05-svelte-head.md diff --git a/apps/svelte.dev/content/docs/svelte/05-special-elements/05-svelte-element.md b/apps/svelte.dev/content/docs/svelte/05-special-elements/06-svelte-element.md similarity index 100% rename from apps/svelte.dev/content/docs/svelte/05-special-elements/05-svelte-element.md rename to apps/svelte.dev/content/docs/svelte/05-special-elements/06-svelte-element.md diff --git a/apps/svelte.dev/content/docs/svelte/05-special-elements/06-svelte-options.md b/apps/svelte.dev/content/docs/svelte/05-special-elements/07-svelte-options.md similarity index 100% rename from apps/svelte.dev/content/docs/svelte/05-special-elements/06-svelte-options.md rename to apps/svelte.dev/content/docs/svelte/05-special-elements/07-svelte-options.md diff --git a/apps/svelte.dev/content/docs/svelte/98-reference/.generated/compile-errors.md b/apps/svelte.dev/content/docs/svelte/98-reference/.generated/compile-errors.md index 16cd361e5..77166097a 100644 --- a/apps/svelte.dev/content/docs/svelte/98-reference/.generated/compile-errors.md +++ b/apps/svelte.dev/content/docs/svelte/98-reference/.generated/compile-errors.md @@ -762,6 +762,18 @@ A component can have a single top-level `