@sveltejs/kit 1.0.0-next.521 → 1.0.0-next.523
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/adapt/builder.js +6 -9
- package/src/core/config/options.js +2 -2
- package/src/core/prerender/prerender.js +2 -2
- package/src/core/sync/create_manifest_data/index.js +2 -2
- package/src/core/sync/create_manifest_data/sort.js +3 -5
- package/src/runtime/client/fetcher.js +1 -1
- package/src/runtime/server/page/load_data.js +1 -1
- package/src/runtime/server/page/render.js +1 -1
- package/src/runtime/server/utils.js +1 -1
- package/src/utils/routing.js +14 -5
- package/types/index.d.ts +187 -0
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { pipeline } from 'stream';
|
|
|
5
5
|
import { promisify } from 'util';
|
|
6
6
|
import { copy, rimraf, mkdirp } from '../../utils/filesystem.js';
|
|
7
7
|
import { generate_manifest } from '../generate_manifest/index.js';
|
|
8
|
-
import {
|
|
8
|
+
import { get_route_segments } from '../../utils/routing.js';
|
|
9
9
|
|
|
10
10
|
const pipe = promisify(pipeline);
|
|
11
11
|
|
|
@@ -48,14 +48,11 @@ export function create_builder({ config, build_data, routes, prerendered, log })
|
|
|
48
48
|
|
|
49
49
|
return {
|
|
50
50
|
id: route.id,
|
|
51
|
-
segments: route.id
|
|
52
|
-
.
|
|
53
|
-
.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
rest: segment.includes('[...'),
|
|
57
|
-
content: segment
|
|
58
|
-
})),
|
|
51
|
+
segments: get_route_segments(route.id).map((segment) => ({
|
|
52
|
+
dynamic: segment.includes('['),
|
|
53
|
+
rest: segment.includes('[...'),
|
|
54
|
+
content: segment
|
|
55
|
+
})),
|
|
59
56
|
pattern: route.pattern,
|
|
60
57
|
methods: Array.from(methods)
|
|
61
58
|
};
|
|
@@ -88,7 +88,7 @@ const options = object(
|
|
|
88
88
|
// TODO: remove this for the 1.0 release
|
|
89
89
|
amp: error(
|
|
90
90
|
(keypath) =>
|
|
91
|
-
`${keypath} has been removed. See https://kit.svelte.dev/docs/seo#amp for details on how to support AMP`
|
|
91
|
+
`${keypath} has been removed. See https://kit.svelte.dev/docs/seo#manual-setup-amp for details on how to support AMP`
|
|
92
92
|
),
|
|
93
93
|
|
|
94
94
|
appDir: validate('_app', (input, keypath) => {
|
|
@@ -321,7 +321,7 @@ const options = object(
|
|
|
321
321
|
// TODO remove this for 1.0
|
|
322
322
|
ssr: error(
|
|
323
323
|
(keypath) =>
|
|
324
|
-
`${keypath} has been removed — use the handle hook instead: https://kit.svelte.dev/docs/hooks#handle`
|
|
324
|
+
`${keypath} has been removed — use the handle hook instead: https://kit.svelte.dev/docs/hooks#server-hooks-handle`
|
|
325
325
|
),
|
|
326
326
|
|
|
327
327
|
// TODO remove this for 1.0
|
|
@@ -9,7 +9,7 @@ import { crawl } from './crawl.js';
|
|
|
9
9
|
import { escape_html_attr } from '../../utils/escape.js';
|
|
10
10
|
import { logger } from '../utils.js';
|
|
11
11
|
import { load_config } from '../config/index.js';
|
|
12
|
-
import {
|
|
12
|
+
import { get_route_segments } from '../../utils/routing.js';
|
|
13
13
|
import { get_option } from '../../runtime/server/utils.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -370,7 +370,7 @@ export async function prerender() {
|
|
|
370
370
|
for (const [id, prerender] of prerender_map) {
|
|
371
371
|
if (prerender) {
|
|
372
372
|
if (id.includes('[')) continue;
|
|
373
|
-
const path = `/${id
|
|
373
|
+
const path = `/${get_route_segments(id).join('/')}`;
|
|
374
374
|
enqueue(null, config.paths.base + path);
|
|
375
375
|
}
|
|
376
376
|
}
|
|
@@ -207,7 +207,7 @@ function create_routes_and_nodes(cwd, config, fallback) {
|
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
209
|
|
|
210
|
-
walk(0, '', '', null);
|
|
210
|
+
walk(0, '/', '', null);
|
|
211
211
|
|
|
212
212
|
if (routes.length === 1) {
|
|
213
213
|
const root = routes[0];
|
|
@@ -223,7 +223,7 @@ function create_routes_and_nodes(cwd, config, fallback) {
|
|
|
223
223
|
// If there's no routes directory, we'll just create a single empty route. This ensures the root layout and
|
|
224
224
|
// error components are included in the manifest, which is needed for subsequent build/dev commands to work
|
|
225
225
|
routes.push({
|
|
226
|
-
id: '',
|
|
226
|
+
id: '/',
|
|
227
227
|
segment: '',
|
|
228
228
|
pattern: /^$/,
|
|
229
229
|
names: [],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { get_route_segments } from '../../../utils/routing.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef {{
|
|
@@ -133,13 +133,11 @@ export function sort_routes(routes) {
|
|
|
133
133
|
|
|
134
134
|
/** @param {string} id */
|
|
135
135
|
function split_route_id(id) {
|
|
136
|
-
return (
|
|
136
|
+
return get_route_segments(
|
|
137
137
|
id
|
|
138
138
|
// remove all [[optional]] parts unless they're at the very end
|
|
139
139
|
.replace(/\[\[[^\]]+\]\](?!$)/g, '')
|
|
140
|
-
|
|
141
|
-
.filter((segment) => segment !== '' && affects_path(segment))
|
|
142
|
-
);
|
|
140
|
+
).filter(Boolean);
|
|
143
141
|
}
|
|
144
142
|
|
|
145
143
|
/**
|
|
@@ -29,7 +29,7 @@ if (import.meta.env.DEV) {
|
|
|
29
29
|
const heuristic = can_inspect_stack_trace ? stack.includes('load_node') : loading;
|
|
30
30
|
if (heuristic) {
|
|
31
31
|
console.warn(
|
|
32
|
-
`Loading ${url} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://kit.svelte.dev/docs/load#
|
|
32
|
+
`Loading ${url} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://kit.svelte.dev/docs/load#making-fetch-requests`
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -184,7 +184,7 @@ export async function load_data({
|
|
|
184
184
|
const included = resolve_opts.filterSerializedResponseHeaders(lower, value);
|
|
185
185
|
if (!included) {
|
|
186
186
|
throw new Error(
|
|
187
|
-
`Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://kit.svelte.dev/docs/hooks#handle (at ${event.routeId})`
|
|
187
|
+
`Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://kit.svelte.dev/docs/hooks#server-hooks-handle (at ${event.routeId})`
|
|
188
188
|
);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
@@ -179,7 +179,7 @@ export async function render_response({
|
|
|
179
179
|
const match = /\[(\d+)\]\.data\.(.+)/.exec(error.path);
|
|
180
180
|
if (match) {
|
|
181
181
|
throw new Error(
|
|
182
|
-
`Data returned from \`load\` while rendering
|
|
182
|
+
`Data returned from \`load\` while rendering ${event.routeId} is not serializable: ${error.message} (data.${match[2]})`
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
185
|
throw error;
|
|
@@ -83,7 +83,7 @@ export function data_response(data, event) {
|
|
|
83
83
|
const error = /** @type {any} */ (e);
|
|
84
84
|
const match = /\[(\d+)\]\.data\.(.+)/.exec(error.path);
|
|
85
85
|
const message = match
|
|
86
|
-
? `Data returned from \`load\` while rendering
|
|
86
|
+
? `Data returned from \`load\` while rendering ${event.routeId} is not serializable: ${error.message} (data.${match[2]})`
|
|
87
87
|
: error.message;
|
|
88
88
|
return new Response(JSON.stringify(message), { headers, status: 500 });
|
|
89
89
|
}
|
package/src/utils/routing.js
CHANGED
|
@@ -13,12 +13,10 @@ export function parse_route_id(id) {
|
|
|
13
13
|
let add_trailing_slash = true;
|
|
14
14
|
|
|
15
15
|
const pattern =
|
|
16
|
-
id === ''
|
|
16
|
+
id === '/'
|
|
17
17
|
? /^\/$/
|
|
18
18
|
: new RegExp(
|
|
19
|
-
`^${id
|
|
20
|
-
.split(/(?:\/|$)/)
|
|
21
|
-
.filter(affects_path)
|
|
19
|
+
`^${get_route_segments(id)
|
|
22
20
|
.map((segment, i, segments) => {
|
|
23
21
|
const decoded_segment = decodeURIComponent(segment);
|
|
24
22
|
// special case — /[...rest]/ could contain zero segments
|
|
@@ -97,10 +95,21 @@ export function parse_route_id(id) {
|
|
|
97
95
|
* Returns `false` for `(group)` segments
|
|
98
96
|
* @param {string} segment
|
|
99
97
|
*/
|
|
100
|
-
|
|
98
|
+
function affects_path(segment) {
|
|
101
99
|
return !/^\([^)]+\)$/.test(segment);
|
|
102
100
|
}
|
|
103
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Splits a route id into its segments, removing segments that
|
|
104
|
+
* don't affect the path (i.e. groups). The root route is represented by `/`
|
|
105
|
+
* and will be returned as `['']`.
|
|
106
|
+
* @param {string} route
|
|
107
|
+
* @returns string[]
|
|
108
|
+
*/
|
|
109
|
+
export function get_route_segments(route) {
|
|
110
|
+
return route.slice(1).split('/').filter(affects_path);
|
|
111
|
+
}
|
|
112
|
+
|
|
104
113
|
/**
|
|
105
114
|
* @param {RegExpMatchArray} match
|
|
106
115
|
* @param {string[]} names
|
package/types/index.d.ts
CHANGED
|
@@ -271,18 +271,108 @@ export interface LoadEvent<
|
|
|
271
271
|
Data extends Record<string, unknown> | null = Record<string, any> | null,
|
|
272
272
|
ParentData extends Record<string, unknown> = Record<string, any>
|
|
273
273
|
> extends NavigationEvent<Params> {
|
|
274
|
+
/**
|
|
275
|
+
* `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features:
|
|
276
|
+
*
|
|
277
|
+
* - it can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request
|
|
278
|
+
* - it can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context)
|
|
279
|
+
* - internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call
|
|
280
|
+
* - during server-side rendering, the response will be captured and inlined into the rendered HTML. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://kit.svelte.dev/docs/hooks#server-hooks-handle)
|
|
281
|
+
* - during hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request
|
|
282
|
+
*
|
|
283
|
+
* > Cookies will only be passed through if the target host is the same as the SvelteKit application or a more specific subdomain of it.
|
|
284
|
+
*/
|
|
274
285
|
fetch: typeof fetch;
|
|
286
|
+
/**
|
|
287
|
+
* Contains the data returned by the route's server `load` function (in `+layout.server.js` or `+page.server.js`), if any.
|
|
288
|
+
*/
|
|
275
289
|
data: Data;
|
|
290
|
+
/**
|
|
291
|
+
* If you need to set headers for the response, you can do so using the this method. This is useful if you want the page to be cached, for example:
|
|
292
|
+
*
|
|
293
|
+
* ```js
|
|
294
|
+
* /// file: src/routes/blog/+page.js
|
|
295
|
+
* export async function load({ fetch, setHeaders }) {
|
|
296
|
+
* const url = `https://cms.example.com/articles.json`;
|
|
297
|
+
* const response = await fetch(url);
|
|
298
|
+
*
|
|
299
|
+
* setHeaders({
|
|
300
|
+
* age: response.headers.get('age'),
|
|
301
|
+
* 'cache-control': response.headers.get('cache-control')
|
|
302
|
+
* });
|
|
303
|
+
*
|
|
304
|
+
* return response.json();
|
|
305
|
+
* }
|
|
306
|
+
* ```
|
|
307
|
+
*
|
|
308
|
+
* Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once.
|
|
309
|
+
*
|
|
310
|
+
* You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://kit.svelte.dev/docs/types#sveltejs-kit-cookies) API in a server-only `load` function instead.
|
|
311
|
+
*
|
|
312
|
+
* `setHeaders` has no effect when a `load` function runs in the browser.
|
|
313
|
+
*/
|
|
276
314
|
setHeaders: (headers: Record<string, string>) => void;
|
|
315
|
+
/**
|
|
316
|
+
* `await parent()` returns data from parent `+layout.js` `load` functions.
|
|
317
|
+
* Implicitly, a missing `+layout.js` is treated as a `({ data }) => data` function, meaning that it will return and forward data from parent `+layout.server.js` files.
|
|
318
|
+
*
|
|
319
|
+
* Be careful not to introduce accidental waterfalls when using `await parent()`. If for example you only want to merge parent data into the returned output, call it _after_ fetching your other data.
|
|
320
|
+
*/
|
|
277
321
|
parent: () => Promise<ParentData>;
|
|
322
|
+
/**
|
|
323
|
+
* This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](/docs/modules#$app-navigation-invalidate) to cause `load` to rerun.
|
|
324
|
+
*
|
|
325
|
+
* Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`.
|
|
326
|
+
*
|
|
327
|
+
* URLs can be absolute or relative to the page being loaded, and must be [encoded](https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding).
|
|
328
|
+
*
|
|
329
|
+
* Custom identifiers have to be prefixed with one or more lowercase letters followed by a colon to conform to the [URI specification](https://www.rfc-editor.org/rfc/rfc3986.html).
|
|
330
|
+
*
|
|
331
|
+
* The following example shows how to use `depends` to register a dependency on a custom identifier, which is `invalidate`d after a button click, making the `load` function rerun.
|
|
332
|
+
*
|
|
333
|
+
* ```js
|
|
334
|
+
* /// file: src/routes/+page.js
|
|
335
|
+
* let count = 0;
|
|
336
|
+
* export async function load({ depends }) {
|
|
337
|
+
* depends('increase:count');
|
|
338
|
+
*
|
|
339
|
+
* return { count: count++ };
|
|
340
|
+
* }
|
|
341
|
+
* ```
|
|
342
|
+
*
|
|
343
|
+
* ```html
|
|
344
|
+
* /// file: src/routes/+page.svelte
|
|
345
|
+
* <script>
|
|
346
|
+
* import { invalidate } from '$app/navigation';
|
|
347
|
+
*
|
|
348
|
+
* export let data;
|
|
349
|
+
*
|
|
350
|
+
* const increase = async () => {
|
|
351
|
+
* await invalidate('increase:count');
|
|
352
|
+
* }
|
|
353
|
+
* </script>
|
|
354
|
+
*
|
|
355
|
+
* <p>{data.count}<p>
|
|
356
|
+
* <button on:click={increase}>Increase Count</button>
|
|
357
|
+
* ```
|
|
358
|
+
*/
|
|
278
359
|
depends: (...deps: string[]) => void;
|
|
279
360
|
}
|
|
280
361
|
|
|
281
362
|
export interface NavigationEvent<
|
|
282
363
|
Params extends Partial<Record<string, string>> = Partial<Record<string, string>>
|
|
283
364
|
> {
|
|
365
|
+
/**
|
|
366
|
+
* The parameters of the current page - e.g. for a route like `/blog/[slug]`, the `slug` parameter
|
|
367
|
+
*/
|
|
284
368
|
params: Params;
|
|
369
|
+
/**
|
|
370
|
+
* The route ID of the current page - e.g. for `src/routes/blog/[slug]`, it would be `blog/[slug]`
|
|
371
|
+
*/
|
|
285
372
|
routeId: string | null;
|
|
373
|
+
/**
|
|
374
|
+
* The URL of the current page
|
|
375
|
+
*/
|
|
286
376
|
url: URL;
|
|
287
377
|
}
|
|
288
378
|
|
|
@@ -342,15 +432,70 @@ export interface ParamMatcher {
|
|
|
342
432
|
export interface RequestEvent<
|
|
343
433
|
Params extends Partial<Record<string, string>> = Partial<Record<string, string>>
|
|
344
434
|
> {
|
|
435
|
+
/**
|
|
436
|
+
* Get or set cookies related to the current request
|
|
437
|
+
*/
|
|
345
438
|
cookies: Cookies;
|
|
439
|
+
/**
|
|
440
|
+
* `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features:
|
|
441
|
+
*
|
|
442
|
+
* - it can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request
|
|
443
|
+
* - it can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context)
|
|
444
|
+
* - internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call
|
|
445
|
+
*
|
|
446
|
+
* > Cookies will only be passed through if the target host is the same as the SvelteKit application or a more specific subdomain of it.
|
|
447
|
+
*/
|
|
346
448
|
fetch: typeof fetch;
|
|
449
|
+
/**
|
|
450
|
+
* The client's IP address, set by the adapter.
|
|
451
|
+
*/
|
|
347
452
|
getClientAddress: () => string;
|
|
453
|
+
/**
|
|
454
|
+
* Contains custom data that was added to the request within the [`handle hook`](https://kit.svelte.dev/docs/hooks#server-hooks-handle).
|
|
455
|
+
*/
|
|
348
456
|
locals: App.Locals;
|
|
457
|
+
/**
|
|
458
|
+
* The parameters of the current page or endpoint - e.g. for a route like `/blog/[slug]`, the `slug` parameter
|
|
459
|
+
*/
|
|
349
460
|
params: Params;
|
|
461
|
+
/**
|
|
462
|
+
* Additional data made available through the adapter.
|
|
463
|
+
*/
|
|
350
464
|
platform: Readonly<App.Platform>;
|
|
465
|
+
/**
|
|
466
|
+
* The original request object
|
|
467
|
+
*/
|
|
351
468
|
request: Request;
|
|
469
|
+
/**
|
|
470
|
+
* The route ID of the current page - e.g. for `src/routes/blog/[slug]`, it would be `blog/[slug]`
|
|
471
|
+
*/
|
|
352
472
|
routeId: string | null;
|
|
473
|
+
/**
|
|
474
|
+
* If you need to set headers for the response, you can do so using the this method. This is useful if you want the page to be cached, for example:
|
|
475
|
+
*
|
|
476
|
+
* ```js
|
|
477
|
+
* /// file: src/routes/blog/+page.js
|
|
478
|
+
* export async function load({ fetch, setHeaders }) {
|
|
479
|
+
* const url = `https://cms.example.com/articles.json`;
|
|
480
|
+
* const response = await fetch(url);
|
|
481
|
+
*
|
|
482
|
+
* setHeaders({
|
|
483
|
+
* age: response.headers.get('age'),
|
|
484
|
+
* 'cache-control': response.headers.get('cache-control')
|
|
485
|
+
* });
|
|
486
|
+
*
|
|
487
|
+
* return response.json();
|
|
488
|
+
* }
|
|
489
|
+
* ```
|
|
490
|
+
*
|
|
491
|
+
* Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once.
|
|
492
|
+
*
|
|
493
|
+
* You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://kit.svelte.dev/docs/types#sveltejs-kit-cookies) API instead.
|
|
494
|
+
*/
|
|
353
495
|
setHeaders: (headers: Record<string, string>) => void;
|
|
496
|
+
/**
|
|
497
|
+
* The URL of the current page or endpoint
|
|
498
|
+
*/
|
|
354
499
|
url: URL;
|
|
355
500
|
}
|
|
356
501
|
|
|
@@ -415,7 +560,49 @@ export interface ServerLoadEvent<
|
|
|
415
560
|
Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
|
|
416
561
|
ParentData extends Record<string, any> = Record<string, any>
|
|
417
562
|
> extends RequestEvent<Params> {
|
|
563
|
+
/**
|
|
564
|
+
* `await parent()` returns data from parent `+layout.server.js` `load` functions.
|
|
565
|
+
*
|
|
566
|
+
* Be careful not to introduce accidental waterfalls when using `await parent()`. If for example you only want to merge parent data into the returned output, call it _after_ fetching your other data.
|
|
567
|
+
*/
|
|
418
568
|
parent: () => Promise<ParentData>;
|
|
569
|
+
/**
|
|
570
|
+
* This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](/docs/modules#$app-navigation-invalidate) to cause `load` to rerun.
|
|
571
|
+
*
|
|
572
|
+
* Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`.
|
|
573
|
+
*
|
|
574
|
+
* URLs can be absolute or relative to the page being loaded, and must be [encoded](https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding).
|
|
575
|
+
*
|
|
576
|
+
* Custom identifiers have to be prefixed with one or more lowercase letters followed by a colon to conform to the [URI specification](https://www.rfc-editor.org/rfc/rfc3986.html).
|
|
577
|
+
*
|
|
578
|
+
* The following example shows how to use `depends` to register a dependency on a custom identifier, which is `invalidate`d after a button click, making the `load` function rerun.
|
|
579
|
+
*
|
|
580
|
+
* ```js
|
|
581
|
+
* /// file: src/routes/+page.js
|
|
582
|
+
* let count = 0;
|
|
583
|
+
* export async function load({ depends }) {
|
|
584
|
+
* depends('increase:count');
|
|
585
|
+
*
|
|
586
|
+
* return { count: count++ };
|
|
587
|
+
* }
|
|
588
|
+
* ```
|
|
589
|
+
*
|
|
590
|
+
* ```html
|
|
591
|
+
* /// file: src/routes/+page.svelte
|
|
592
|
+
* <script>
|
|
593
|
+
* import { invalidate } from '$app/navigation';
|
|
594
|
+
*
|
|
595
|
+
* export let data;
|
|
596
|
+
*
|
|
597
|
+
* const increase = async () => {
|
|
598
|
+
* await invalidate('increase:count');
|
|
599
|
+
* }
|
|
600
|
+
* </script>
|
|
601
|
+
*
|
|
602
|
+
* <p>{data.count}<p>
|
|
603
|
+
* <button on:click={increase}>Increase Count</button>
|
|
604
|
+
* ```
|
|
605
|
+
*/
|
|
419
606
|
depends: (...deps: string[]) => void;
|
|
420
607
|
}
|
|
421
608
|
|