diff --git a/documentation/docs/03-template-syntax/01-basic-markup.md b/documentation/docs/03-template-syntax/01-basic-markup.md index 774ac6ca3e7e..b41dc187c337 100644 --- a/documentation/docs/03-template-syntax/01-basic-markup.md +++ b/documentation/docs/03-template-syntax/01-basic-markup.md @@ -109,7 +109,7 @@ Timing-wise, event attributes always fire after events from bindings (e.g. `onin When using `ontouchstart` and `ontouchmove` event attributes, the handlers are [passive](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#using_passive_listeners) for better performance. This greatly improves responsiveness by allowing the browser to scroll the document immediately, rather than waiting to see if the event handler calls `event.preventDefault()`. -In the very rare cases that you need to prevent these event defaults, you should use [`on`](https://svelte-5-preview.vercel.app/docs/imports#svelte-events) instead (for example inside an action). +In the very rare cases that you need to prevent these event defaults, you should use [`on`](svelte-events#on) instead (for example inside an action). ### Event delegation diff --git a/documentation/docs/07-misc/07-v5-migration-guide.md b/documentation/docs/07-misc/07-v5-migration-guide.md index deffca288d03..17a5bf03f59f 100644 --- a/documentation/docs/07-misc/07-v5-migration-guide.md +++ b/documentation/docs/07-misc/07-v5-migration-guide.md @@ -727,7 +727,7 @@ This is no longer true in Svelte 5: When using `onwheel`, `onmousewheel`, `ontouchstart` and `ontouchmove` event attributes, the handlers are [passive](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#using_passive_listeners) to align with browser defaults. This greatly improves responsiveness by allowing the browser to scroll the document immediately, rather than waiting to see if the event handler calls `event.preventDefault()`. -In the very rare cases that you need to prevent these event defaults, you should use [`on`](/docs/svelte/svelte-events#on) instead (for example inside an action). +In the very rare cases that you need to prevent these event defaults, you should use [`on`](svelte-events#on) instead (for example inside an action). ### Attribute/prop syntax is stricter diff --git a/documentation/docs/98-reference/.generated/client-errors.md b/documentation/docs/98-reference/.generated/client-errors.md index d6bd276de72d..9879b67b33ad 100644 --- a/documentation/docs/98-reference/.generated/client-errors.md +++ b/documentation/docs/98-reference/.generated/client-errors.md @@ -19,13 +19,13 @@ A component is attempting to bind to a non-bindable property `%key%` belonging t ### component_api_changed ``` -%parent% called `%method%` on an instance of %component%, which is no longer valid in Svelte 5. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information +%parent% called `%method%` on an instance of %component%, which is no longer valid in Svelte 5. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information ``` ### component_api_invalid_new ``` -Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information +Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information ``` ### derived_references_self diff --git a/documentation/docs/98-reference/.generated/client-warnings.md b/documentation/docs/98-reference/.generated/client-warnings.md index 2eabff6958b4..441887e95d96 100644 --- a/documentation/docs/98-reference/.generated/client-warnings.md +++ b/documentation/docs/98-reference/.generated/client-warnings.md @@ -16,7 +16,7 @@ Your `console.%method%` contained `$state` proxies. Consider using `$inspect(... When logging a [proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy), browser devtools will log the proxy itself rather than the value it represents. In the case of Svelte, the 'target' of a `$state` proxy might not resemble its current value, which can be confusing. -The easiest way to log a value as it changes over time is to use the [`$inspect`](https://svelte-5-preview.vercel.app/docs/runes#$inspect) rune. Alternatively, to log things on a one-off basis (for example, inside an event handler) you can use [`$state.snapshot`](https://svelte-5-preview.vercel.app/docs/runes#$state-snapshot) to take a snapshot of the current value. +The easiest way to log a value as it changes over time is to use the [`$inspect`]($inspect) rune. Alternatively, to log things on a one-off basis (for example, inside an event handler) you can use [`$state.snapshot`]($state#$state.snapshot) to take a snapshot of the current value. ### event_handler_invalid diff --git a/packages/svelte/messages/client-errors/errors.md b/packages/svelte/messages/client-errors/errors.md index 954214cb81c3..517b028fa20f 100644 --- a/packages/svelte/messages/client-errors/errors.md +++ b/packages/svelte/messages/client-errors/errors.md @@ -12,11 +12,11 @@ ## component_api_changed -> %parent% called `%method%` on an instance of %component%, which is no longer valid in Svelte 5. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information +> %parent% called `%method%` on an instance of %component%, which is no longer valid in Svelte 5. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information ## component_api_invalid_new -> Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information +> Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information ## derived_references_self diff --git a/packages/svelte/messages/client-warnings/warnings.md b/packages/svelte/messages/client-warnings/warnings.md index c6f1b0aae897..e9014207fd2b 100644 --- a/packages/svelte/messages/client-warnings/warnings.md +++ b/packages/svelte/messages/client-warnings/warnings.md @@ -10,7 +10,7 @@ When logging a [proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy), browser devtools will log the proxy itself rather than the value it represents. In the case of Svelte, the 'target' of a `$state` proxy might not resemble its current value, which can be confusing. -The easiest way to log a value as it changes over time is to use the [`$inspect`](https://svelte-5-preview.vercel.app/docs/runes#$inspect) rune. Alternatively, to log things on a one-off basis (for example, inside an event handler) you can use [`$state.snapshot`](https://svelte-5-preview.vercel.app/docs/runes#$state-snapshot) to take a snapshot of the current value. +The easiest way to log a value as it changes over time is to use the [`$inspect`](https://svelte.dev/docs/svelte/$inspect) rune. Alternatively, to log things on a one-off basis (for example, inside an event handler) you can use [`$state.snapshot`](https://svelte.dev/docs/svelte/$state#$state.snapshot) to take a snapshot of the current value. ## event_handler_invalid diff --git a/packages/svelte/src/ambient.d.ts b/packages/svelte/src/ambient.d.ts index 6af8ca51565a..88879394ed4f 100644 --- a/packages/svelte/src/ambient.d.ts +++ b/packages/svelte/src/ambient.d.ts @@ -24,7 +24,7 @@ declare module '*.svelte' { * let count = $state(0); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$state + * https://svelte.dev/docs/svelte/$state * * @param initial The initial value */ @@ -120,7 +120,7 @@ declare namespace $state { * * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$state-raw + * https://svelte.dev/docs/svelte/$state#$state.raw * * @param initial The initial value */ @@ -141,7 +141,7 @@ declare namespace $state { * * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$state.snapshot + * https://svelte.dev/docs/svelte/$state#$state.snapshot * * @param state The value to snapshot */ @@ -178,7 +178,7 @@ declare namespace $state { * let double = $derived(count * 2); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$derived + * https://svelte.dev/docs/svelte/$derived * * @param expression The derived state expression */ @@ -200,7 +200,7 @@ declare namespace $derived { * }); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$derived-by + * https://svelte.dev/docs/svelte/$derived#$derived.by */ export function by(fn: () => T): T; @@ -239,7 +239,7 @@ declare namespace $derived { * * Does not run during server side rendering. * - * https://svelte-5-preview.vercel.app/docs/runes#$effect + * https://svelte.dev/docs/svelte/$effect * @param fn The function to execute */ declare function $effect(fn: () => void | (() => void)): void; @@ -258,7 +258,7 @@ declare namespace $effect { * * Does not run during server side rendering. * - * https://svelte-5-preview.vercel.app/docs/runes#$effect-pre + * https://svelte.dev/docs/svelte/$effect#$effect.pre * @param fn The function to execute */ export function pre(fn: () => void | (() => void)): void; @@ -281,7 +281,7 @@ declare namespace $effect { * * This allows you to (for example) add things like subscriptions without causing memory leaks, by putting them in child effects. * - * https://svelte-5-preview.vercel.app/docs/runes#$effect-tracking + * https://svelte.dev/docs/svelte/$effect#$effect.tracking */ export function tracking(): boolean; @@ -309,7 +309,7 @@ declare namespace $effect { * * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$effect-root + * https://svelte.dev/docs/svelte/$effect#$effect.root */ export function root(fn: () => void | (() => void)): () => void; @@ -342,7 +342,7 @@ declare namespace $effect { * let { optionalProp = 42, requiredProp, bindableProp = $bindable() }: { optionalProp?: number; requiredProps: string; bindableProp: boolean } = $props(); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$props + * https://svelte.dev/docs/svelte/$props */ declare function $props(): any; @@ -353,7 +353,7 @@ declare function $props(): any; * let { propName = $bindable() }: { propName: boolean } = $props(); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$bindable + * https://svelte.dev/docs/svelte/$bindable */ declare function $bindable(fallback?: T): T; @@ -373,7 +373,7 @@ declare function $bindable(fallback?: T): T; * $inspect(x, y).with(() => { debugger; }); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$inspect + * https://svelte.dev/docs/svelte/$inspect */ declare function $inspect( ...values: T @@ -396,6 +396,6 @@ declare function $inspect( * * Only available inside custom element components, and only on the client-side. * - * https://svelte-5-preview.vercel.app/docs/runes#$host + * https://svelte.dev/docs/svelte/$host */ declare function $host(): El; diff --git a/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js b/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js index 5735e94ca489..c164aa421916 100644 --- a/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js +++ b/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js @@ -344,7 +344,7 @@ export function server_component(analysis, options) { b.block([ b.throw_error( `Component.render(...) is no longer valid in Svelte 5. ` + - 'See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information' + 'See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information' ) ]) ) diff --git a/packages/svelte/src/index-client.js b/packages/svelte/src/index-client.js index 2916aaecb1a6..d3556c1ddc0e 100644 --- a/packages/svelte/src/index-client.js +++ b/packages/svelte/src/index-client.js @@ -82,7 +82,7 @@ function create_custom_event(type, detail, { bubbles = false, cancelable = false * }>(); * ``` * - * @deprecated Use callback props and/or the `$host()` rune instead — see https://svelte-5-preview.vercel.app/docs/deprecations#createeventdispatcher + * @deprecated Use callback props and/or the `$host()` rune instead — see https://svelte.dev/docs/svelte/v5-migration-guide#Event-changes-Component-events * @template {Record} [EventMap = any] * @returns {EventDispatcher} */ @@ -121,7 +121,7 @@ export function createEventDispatcher() { * * In runes mode use `$effect.pre` instead. * - * @deprecated Use `$effect.pre` instead — see https://svelte-5-preview.vercel.app/docs/deprecations#beforeupdate-and-afterupdate + * @deprecated Use `$effect.pre` instead — see https://svelte.dev/docs/svelte/v5-migration-guide#Other-breaking-changes-beforeUpdate-afterUpdate-changes * @param {() => void} fn * @returns {void} */ @@ -144,7 +144,7 @@ export function beforeUpdate(fn) { * * In runes mode use `$effect` instead. * - * @deprecated Use `$effect` instead — see https://svelte-5-preview.vercel.app/docs/deprecations#beforeupdate-and-afterupdate + * @deprecated Use `$effect` instead — see https://svelte.dev/docs/svelte/v5-migration-guide#Other-breaking-changes-beforeUpdate-afterUpdate-changes * @param {() => void} fn * @returns {void} */ diff --git a/packages/svelte/src/index.d.ts b/packages/svelte/src/index.d.ts index 76ea112cd28b..23af6ab5470a 100644 --- a/packages/svelte/src/index.d.ts +++ b/packages/svelte/src/index.d.ts @@ -5,7 +5,7 @@ import './ambient.js'; /** * @deprecated In Svelte 4, components are classes. In Svelte 5, they are functions. * Use `mount` instead to instantiate components. - * See [breaking changes](https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes) + * See [breaking changes](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) * for more info. */ export interface ComponentConstructorOptions< @@ -39,7 +39,7 @@ type Properties = Props & * This was the base class for Svelte components in Svelte 4. Svelte 5+ components * are completely different under the hood. For typing, use `Component` instead. * To instantiate components, use `mount` instead`. - * See [breaking changes documentation](https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes) for more info. + * See [breaking changes documentation](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more info. */ export class SvelteComponent< Props extends Record = Record, @@ -53,7 +53,7 @@ export class SvelteComponent< /** * @deprecated This constructor only exists when using the `asClassComponent` compatibility helper, which * is a stop-gap solution. Migrate towards using `mount` instead. See - * https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more info. + * https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more info. */ constructor(options: ComponentConstructorOptions>); /** @@ -83,14 +83,14 @@ export class SvelteComponent< /** * @deprecated This method only exists when using one of the legacy compatibility helpers, which - * is a stop-gap solution. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes + * is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes * for more info. */ $destroy(): void; /** * @deprecated This method only exists when using one of the legacy compatibility helpers, which - * is a stop-gap solution. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes + * is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes * for more info. */ $on>( @@ -100,7 +100,7 @@ export class SvelteComponent< /** * @deprecated This method only exists when using one of the legacy compatibility helpers, which - * is a stop-gap solution. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes + * is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes * for more info. */ $set(props: Partial): void; @@ -153,13 +153,13 @@ export interface Component< ): { /** * @deprecated This method only exists when using one of the legacy compatibility helpers, which - * is a stop-gap solution. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes + * is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes * for more info. */ $on?(type: string, callback: (e: any) => void): () => void; /** * @deprecated This method only exists when using one of the legacy compatibility helpers, which - * is a stop-gap solution. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes + * is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes * for more info. */ $set?(props: Partial): void; @@ -171,7 +171,7 @@ export interface Component< } /** - * @deprecated Use `Component` instead. See [breaking changes documentation](https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes) for more information. + * @deprecated Use `Component` instead. See [breaking changes documentation](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more information. */ export class SvelteComponentTyped< Props extends Record = Record, @@ -278,7 +278,7 @@ declare const SnippetReturn: unique symbol; * ``` * You can only call a snippet through the `{@render ...}` tag. * - * https://svelte-5-preview.vercel.app/docs/snippets + * https://svelte.dev/docs/svelte/snippet * * @template Parameters the parameters that the snippet expects (if any) as a tuple. */ diff --git a/packages/svelte/src/internal/client/errors.js b/packages/svelte/src/internal/client/errors.js index 2a8f0e891441..2d95c42365e9 100644 --- a/packages/svelte/src/internal/client/errors.js +++ b/packages/svelte/src/internal/client/errors.js @@ -57,7 +57,7 @@ export function bind_not_bindable(key, component, name) { } /** - * %parent% called `%method%` on an instance of %component%, which is no longer valid in Svelte 5. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information + * %parent% called `%method%` on an instance of %component%, which is no longer valid in Svelte 5. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information * @param {string} parent * @param {string} method * @param {string} component @@ -65,7 +65,7 @@ export function bind_not_bindable(key, component, name) { */ export function component_api_changed(parent, method, component) { if (DEV) { - const error = new Error(`component_api_changed\n${parent} called \`${method}\` on an instance of ${component}, which is no longer valid in Svelte 5. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information`); + const error = new Error(`component_api_changed\n${parent} called \`${method}\` on an instance of ${component}, which is no longer valid in Svelte 5. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information`); error.name = 'Svelte error'; throw error; @@ -76,14 +76,14 @@ export function component_api_changed(parent, method, component) { } /** - * Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information + * Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information * @param {string} component * @param {string} name * @returns {never} */ export function component_api_invalid_new(component, name) { if (DEV) { - const error = new Error(`component_api_invalid_new\nAttempted to instantiate ${component} with \`new ${name}\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \`compatibility.componentApi\` compiler option to \`4\` to keep it working. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information`); + const error = new Error(`component_api_invalid_new\nAttempted to instantiate ${component} with \`new ${name}\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \`compatibility.componentApi\` compiler option to \`4\` to keep it working. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information`); error.name = 'Svelte error'; throw error; diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index 074c81588a32..22a0d5c44697 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -833,7 +833,7 @@ export function invalidate_inner_signals(fn) { /** * Use `untrack` to prevent something from being treated as an `$effect`/`$derived` dependency. * - * https://svelte-5-preview.vercel.app/docs/functions#untrack + * https://svelte.dev/docs/svelte/svelte#untrack * @template T * @param {() => T} fn * @returns {T} diff --git a/packages/svelte/types/index.d.ts b/packages/svelte/types/index.d.ts index 49ff2db8ceab..47277f709e33 100644 --- a/packages/svelte/types/index.d.ts +++ b/packages/svelte/types/index.d.ts @@ -2,7 +2,7 @@ declare module 'svelte' { /** * @deprecated In Svelte 4, components are classes. In Svelte 5, they are functions. * Use `mount` instead to instantiate components. - * See [breaking changes](https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes) + * See [breaking changes](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) * for more info. */ export interface ComponentConstructorOptions< @@ -36,7 +36,7 @@ declare module 'svelte' { * This was the base class for Svelte components in Svelte 4. Svelte 5+ components * are completely different under the hood. For typing, use `Component` instead. * To instantiate components, use `mount` instead`. - * See [breaking changes documentation](https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes) for more info. + * See [breaking changes documentation](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more info. */ export class SvelteComponent< Props extends Record = Record, @@ -50,7 +50,7 @@ declare module 'svelte' { /** * @deprecated This constructor only exists when using the `asClassComponent` compatibility helper, which * is a stop-gap solution. Migrate towards using `mount` instead. See - * https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more info. + * https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more info. */ constructor(options: ComponentConstructorOptions>); /** @@ -80,14 +80,14 @@ declare module 'svelte' { /** * @deprecated This method only exists when using one of the legacy compatibility helpers, which - * is a stop-gap solution. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes + * is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes * for more info. */ $destroy(): void; /** * @deprecated This method only exists when using one of the legacy compatibility helpers, which - * is a stop-gap solution. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes + * is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes * for more info. */ $on>( @@ -97,7 +97,7 @@ declare module 'svelte' { /** * @deprecated This method only exists when using one of the legacy compatibility helpers, which - * is a stop-gap solution. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes + * is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes * for more info. */ $set(props: Partial): void; @@ -150,13 +150,13 @@ declare module 'svelte' { ): { /** * @deprecated This method only exists when using one of the legacy compatibility helpers, which - * is a stop-gap solution. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes + * is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes * for more info. */ $on?(type: string, callback: (e: any) => void): () => void; /** * @deprecated This method only exists when using one of the legacy compatibility helpers, which - * is a stop-gap solution. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes + * is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes * for more info. */ $set?(props: Partial): void; @@ -168,7 +168,7 @@ declare module 'svelte' { } /** - * @deprecated Use `Component` instead. See [breaking changes documentation](https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes) for more information. + * @deprecated Use `Component` instead. See [breaking changes documentation](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more information. */ export class SvelteComponentTyped< Props extends Record = Record, @@ -275,7 +275,7 @@ declare module 'svelte' { * ``` * You can only call a snippet through the `{@render ...}` tag. * - * https://svelte-5-preview.vercel.app/docs/snippets + * https://svelte.dev/docs/svelte/snippet * * @template Parameters the parameters that the snippet expects (if any) as a tuple. */ @@ -385,7 +385,7 @@ declare module 'svelte' { * }>(); * ``` * - * @deprecated Use callback props and/or the `$host()` rune instead — see https://svelte-5-preview.vercel.app/docs/deprecations#createeventdispatcher + * @deprecated Use callback props and/or the `$host()` rune instead — see https://svelte.dev/docs/svelte/v5-migration-guide#Event-changes-Component-events * */ export function createEventDispatcher = any>(): EventDispatcher; /** @@ -395,7 +395,7 @@ declare module 'svelte' { * * In runes mode use `$effect.pre` instead. * - * @deprecated Use `$effect.pre` instead — see https://svelte-5-preview.vercel.app/docs/deprecations#beforeupdate-and-afterupdate + * @deprecated Use `$effect.pre` instead — see https://svelte.dev/docs/svelte/v5-migration-guide#Other-breaking-changes-beforeUpdate-afterUpdate-changes * */ export function beforeUpdate(fn: () => void): void; /** @@ -405,7 +405,7 @@ declare module 'svelte' { * * In runes mode use `$effect` instead. * - * @deprecated Use `$effect` instead — see https://svelte-5-preview.vercel.app/docs/deprecations#beforeupdate-and-afterupdate + * @deprecated Use `$effect` instead — see https://svelte.dev/docs/svelte/v5-migration-guide#Other-breaking-changes-beforeUpdate-afterUpdate-changes * */ export function afterUpdate(fn: () => void): void; /** @@ -457,7 +457,7 @@ declare module 'svelte' { /** * Use `untrack` to prevent something from being treated as an `$effect`/`$derived` dependency. * - * https://svelte-5-preview.vercel.app/docs/functions#untrack + * https://svelte.dev/docs/svelte/svelte#untrack * */ export function untrack(fn: () => T): T; /** @@ -2320,7 +2320,7 @@ declare module 'svelte/types/compiler/interfaces' { * let count = $state(0); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$state + * https://svelte.dev/docs/svelte/$state * * @param initial The initial value */ @@ -2416,7 +2416,7 @@ declare namespace $state { * * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$state-raw + * https://svelte.dev/docs/svelte/$state#$state.raw * * @param initial The initial value */ @@ -2437,7 +2437,7 @@ declare namespace $state { * * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$state.snapshot + * https://svelte.dev/docs/svelte/$state#$state.snapshot * * @param state The value to snapshot */ @@ -2474,7 +2474,7 @@ declare namespace $state { * let double = $derived(count * 2); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$derived + * https://svelte.dev/docs/svelte/$derived * * @param expression The derived state expression */ @@ -2496,7 +2496,7 @@ declare namespace $derived { * }); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$derived-by + * https://svelte.dev/docs/svelte/$derived#$derived.by */ export function by(fn: () => T): T; @@ -2535,7 +2535,7 @@ declare namespace $derived { * * Does not run during server side rendering. * - * https://svelte-5-preview.vercel.app/docs/runes#$effect + * https://svelte.dev/docs/svelte/$effect * @param fn The function to execute */ declare function $effect(fn: () => void | (() => void)): void; @@ -2554,7 +2554,7 @@ declare namespace $effect { * * Does not run during server side rendering. * - * https://svelte-5-preview.vercel.app/docs/runes#$effect-pre + * https://svelte.dev/docs/svelte/$effect#$effect.pre * @param fn The function to execute */ export function pre(fn: () => void | (() => void)): void; @@ -2577,7 +2577,7 @@ declare namespace $effect { * * This allows you to (for example) add things like subscriptions without causing memory leaks, by putting them in child effects. * - * https://svelte-5-preview.vercel.app/docs/runes#$effect-tracking + * https://svelte.dev/docs/svelte/$effect#$effect.tracking */ export function tracking(): boolean; @@ -2605,7 +2605,7 @@ declare namespace $effect { * * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$effect-root + * https://svelte.dev/docs/svelte/$effect#$effect.root */ export function root(fn: () => void | (() => void)): () => void; @@ -2638,7 +2638,7 @@ declare namespace $effect { * let { optionalProp = 42, requiredProp, bindableProp = $bindable() }: { optionalProp?: number; requiredProps: string; bindableProp: boolean } = $props(); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$props + * https://svelte.dev/docs/svelte/$props */ declare function $props(): any; @@ -2649,7 +2649,7 @@ declare function $props(): any; * let { propName = $bindable() }: { propName: boolean } = $props(); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$bindable + * https://svelte.dev/docs/svelte/$bindable */ declare function $bindable(fallback?: T): T; @@ -2669,7 +2669,7 @@ declare function $bindable(fallback?: T): T; * $inspect(x, y).with(() => { debugger; }); * ``` * - * https://svelte-5-preview.vercel.app/docs/runes#$inspect + * https://svelte.dev/docs/svelte/$inspect */ declare function $inspect( ...values: T @@ -2692,7 +2692,7 @@ declare function $inspect( * * Only available inside custom element components, and only on the client-side. * - * https://svelte-5-preview.vercel.app/docs/runes#$host + * https://svelte.dev/docs/svelte/$host */ declare function $host(): El; diff --git a/sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md b/sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md index f45b2e041692..5f60560301de 100644 --- a/sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md +++ b/sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md @@ -31,7 +31,7 @@ import App from './App.svelte' + const app = mount(App, { target: document.getElementById("app"), events: { event: callback } }); ``` -> Note that using `events` is discouraged — instead, [use callbacks](https://svelte-5-preview.vercel.app/docs/event-handlers) +> Note that using `events` is discouraged — instead, [use callbacks](https://svelte.dev/docs/svelte/v5-migration-guide#Event-changes) For `$set`, use `$state` instead to create a reactive property object and manipulate it. If you're doing this inside a `.js` or `.ts` file, adjust the ending to include `.svelte`, i.e. `.svelte.js` or `.svelte.ts`. @@ -242,7 +242,7 @@ This is [no longer true in Svelte 5](/#H4sIAAAAAAAAE4WQwU7DMAyGX8VESANpXe8lq9Q8A When using `onwheel`, `onmousewheel`, `ontouchstart` and `ontouchmove` event attributes, the handlers are [passive](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#using_passive_listeners) to align with browser defaults. This greatly improves responsiveness by allowing the browser to scroll the document immediately, rather than waiting to see if the event handler calls `event.preventDefault()`. -In the very rare cases that you need to prevent these event defaults, you should use [`on`](https://svelte-5-preview.vercel.app/docs/imports#svelte-events) instead (for example inside an action). +In the very rare cases that you need to prevent these event defaults, you should use [`on`](svelte-events#on) instead (for example inside an action). ### Attribute/prop syntax is stricter