prune errors

elliott/hydratable
Elliott Johnson 3 days ago
parent a025b9a31a
commit 53ccd2e50a

@ -140,12 +140,6 @@ The `flushSync()` function can be used to flush any pending effects synchronousl
This restriction only applies when using the `experimental.async` option, which will be active by default in Svelte 6.
### fn_unavailable_on_client
```
`%name%`(...) is unavailable in the browser.
```
### fork_discarded
```

@ -8,12 +8,6 @@ Encountered asynchronous work while rendering synchronously.
You (or the framework you're using) called [`render(...)`](svelte-server#render) with a component containing an `await` expression. Either `await` the result of `render` or wrap the `await` (or the component containing it) in a [`<svelte:boundary>`](svelte-boundary) with a `pending` snippet.
### fn_unavailable_on_server
```
`%name%`(...) is unavailable on the server.
```
### html_deprecated
```

@ -108,10 +108,6 @@ The `flushSync()` function can be used to flush any pending effects synchronousl
This restriction only applies when using the `experimental.async` option, which will be active by default in Svelte 6.
## fn_unavailable_on_client
> `%name%`(...) is unavailable in the browser.
## fork_discarded
> Cannot commit a fork that was already discarded

@ -4,10 +4,6 @@
You (or the framework you're using) called [`render(...)`](svelte-server#render) with a component containing an `await` expression. Either `await` the result of `render` or wrap the `await` (or the component containing it) in a [`<svelte:boundary>`](svelte-boundary) with a `pending` snippet.
## fn_unavailable_on_server
> `%name%`(...) is unavailable on the server.
## html_deprecated
> The `html` property of server render results has been deprecated. Use `body` instead.

@ -245,23 +245,6 @@ export function flush_sync_in_effect() {
}
}
/**
* `%name%`(...) is unavailable in the browser.
* @param {string} name
* @returns {never}
*/
export function fn_unavailable_on_client(name) {
if (DEV) {
const error = new Error(`fn_unavailable_on_client\n\`${name}\`(...) is unavailable in the browser.\nhttps://svelte.dev/e/fn_unavailable_on_client`);
error.name = 'Svelte error';
throw error;
} else {
throw new Error(`https://svelte.dev/e/fn_unavailable_on_client`);
}
}
/**
* Cannot commit a fork that was already discarded
* @returns {never}

@ -14,19 +14,6 @@ export function await_invalid() {
throw error;
}
/**
* `%name%`(...) is unavailable on the server.
* @param {string} name
* @returns {never}
*/
export function fn_unavailable_on_server(name) {
const error = new Error(`fn_unavailable_on_server\n\`${name}\`(...) is unavailable on the server.\nhttps://svelte.dev/e/fn_unavailable_on_server`);
error.name = 'Svelte error';
throw error;
}
/**
* The `html` property of server render results has been deprecated. Use `body` instead.
* @returns {never}

@ -476,30 +476,7 @@ declare module 'svelte' {
encode?: undefined;
decode: Decode<T>;
};
/** Make the result of a function hydratable. This means it will be serialized on the server and available synchronously during hydration on the client. */
export type Hydratable = {
<T>(
/**
* A key to identify this hydratable value. Each hydratable value must have a unique key.
* If writing a library that utilizes `hydratable`, prefix your keys with your library name to prevent naming collisions.
*/
key: string,
/**
* A function that returns the value to be hydrated. On the server, this value will be stashed and serialized.
* On the client during hydration, the value will be used synchronously instead of invoking the function.
*/
fn: () => T,
options?: { transport?: Transport<T> }
): T;
/** Get a hydratable value from the server-rendered store. If used after hydration, will always return `undefined`. Only works on the client. */
get: <T>(key: string, options?: { decode?: Decode<T> }) => T | undefined;
/** Check if a hydratable value exists in the server-rendered store. */
has: (key: string) => boolean;
/** Set a hydratable value. Only works on the server during `render`. */
set: <T>(key: string, value: T, options?: { encode?: Encode<T> }) => void;
};
export const hydratable: Hydratable;
export function hydratable<T>(key: string, fn: () => T, transport?: Transport<T> | undefined): T;
/**
* Create a snippet programmatically
* */

Loading…
Cancel
Save