You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/svelte.dev/content/blog/2024-12-01-whats-new-in-svelte-december-2024.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ The features since last month can be found below:
43
43
-[PixelAttack](https://jason1610.github.io/PixelAttack/) takes an image, pixelizes it and makes the pixels fight each other
44
44
-[NeoHtop](https://github.com/Abdenasser/neohtop) is a modern, process monitoring tool that combines the power of terminal-based system monitors with a clean, desktop-native UI
45
45
-[WebVM](https://github.com/leaningtech/webvm) is a Linux virtual machine that runs in your browser
46
-
-[Sveltris](https://svelte.dev/playground/8594eea15c6244908c3efad284fe2aa4?version=5.2.1) is Tetris built entirely in the Svelte REPL
46
+
-[Sveltris](/playground/8594eea15c6244908c3efad284fe2aa4?version=5.2.1) is Tetris built entirely in the Svelte REPL
Copy file name to clipboardExpand all lines: apps/svelte.dev/content/docs/kit/20-core-concepts/50-state-management.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ You might wonder how we're able to use `page.data` and other [app state]($app-st
111
111
<p>Welcome {user().name}</p>
112
112
```
113
113
114
-
> [!NOTE] We're passing a function into `setContext` to keep reactivity across boundaries. Read more about it [here](https://svelte.dev/docs/svelte/$state#Passing-state-into-functions)
114
+
> [!NOTE] We're passing a function into `setContext` to keep reactivity across boundaries. Read more about it [here](/docs/svelte/$state#Passing-state-into-functions)
115
115
116
116
> [!LEGACY]
117
117
> You also use stores from `svelte/store` for this, but when using Svelte 5 it is recommended to make use of universal reactivity instead.
Copy file name to clipboardExpand all lines: apps/svelte.dev/content/docs/kit/60-appendix/50-additional-resources.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,4 +21,4 @@ SvelteKit users have also published plenty of examples on GitHub, under the [#sv
21
21
22
22
## Support
23
23
24
-
You can ask for help on [Discord](https://svelte.dev/chat) and [StackOverflow](https://stackoverflow.com/questions/tagged/sveltekit). Please first search for information related to your issue in the FAQ, Google or another search engine, issue tracker, and Discord chat history in order to be respectful of others' time. There are many more people asking questions than answering them, so this will help in allowing the community to grow in a scalable fashion.
24
+
You can ask for help on [Discord](/chat) and [StackOverflow](https://stackoverflow.com/questions/tagged/sveltekit). Please first search for information related to your issue in the FAQ, Google or another search engine, issue tracker, and Discord chat history in order to be respectful of others' time. There are many more people asking questions than answering them, so this will help in allowing the community to grow in a scalable fashion.
Generate a server-side manifest to initialise the SvelteKit [server](https://svelte.dev/docs/kit/@sveltejs-kit#Server) with.
683
+
Generate a server-side manifest to initialise the SvelteKit [server](/docs/kit/@sveltejs-kit#Server) with.
684
684
685
685
</div>
686
686
</div>
@@ -1226,10 +1226,10 @@ fetch: typeof fetch;
1226
1226
- It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request.
1227
1227
- It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context).
1228
1228
- 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.
1229
-
- During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle)
1229
+
- During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](/docs/kit/hooks#Server-hooks-handle)
1230
1230
- During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
1231
1231
1232
-
You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies)
1232
+
You can learn more about making credentialed requests with cookies [here](/docs/kit/load#Cookies)
Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once.
1277
1277
1278
-
You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API in a server-only `load` function instead.
1278
+
You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](/docs/kit/@sveltejs-kit#Cookies) API in a server-only `load` function instead.
1279
1279
1280
1280
`setHeaders` has no effect when a `load` function runs in the browser.
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()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun.
1309
+
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/kit/$app-navigation#invalidate) to cause `load` to rerun.
1310
1310
1311
1311
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`.
1312
1312
@@ -1784,7 +1784,7 @@ state: App.PageState;
1784
1784
1785
1785
<divclass="ts-block-property-details">
1786
1786
1787
-
The page state, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`.
1787
+
The page state, which can be manipulated using the [`pushState`](/docs/kit/$app-navigation#pushState) and [`replaceState`](/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`.
1788
1788
1789
1789
</div>
1790
1790
</div>
@@ -1797,7 +1797,7 @@ form: any;
1797
1797
1798
1798
<divclass="ts-block-property-details">
1799
1799
1800
-
Filled only after a form submission. See [form actions](https://svelte.dev/docs/kit/form-actions) for more info.
1800
+
Filled only after a form submission. See [form actions](/docs/kit/form-actions) for more info.
1801
1801
1802
1802
</div>
1803
1803
</div></div>
@@ -1899,10 +1899,10 @@ fetch: typeof fetch;
1899
1899
- It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request.
1900
1900
- It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context).
1901
1901
- 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.
1902
-
- During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle)
1902
+
- During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](/docs/kit/hooks#Server-hooks-handle)
1903
1903
- During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
1904
1904
1905
-
You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies)
1905
+
You can learn more about making credentialed requests with cookies [here](/docs/kit/load#Cookies)
1906
1906
1907
1907
</div>
1908
1908
</div>
@@ -1928,7 +1928,7 @@ locals: App.Locals;
1928
1928
1929
1929
<divclass="ts-block-property-details">
1930
1930
1931
-
Contains custom data that was added to the request within the [`server handle hook`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle).
1931
+
Contains custom data that was added to the request within the [`server handle hook`](/docs/kit/hooks#Server-hooks-handle).
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()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun.
2489
+
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/kit/$app-navigation#invalidate) to cause `load` to rerun.
2490
2490
2491
2491
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`.
Options passed to [`svelte.compile`](https://svelte.dev/docs/svelte/svelte-compiler#CompileOptions).
52
+
Options passed to [`svelte.compile`](/docs/svelte/svelte-compiler#CompileOptions).
53
53
54
54
</div>
55
55
</div>
@@ -139,7 +139,7 @@ The `kit` property configures SvelteKit, and can have the following properties:
139
139
140
140
</div>
141
141
142
-
Your [adapter](https://svelte.dev/docs/kit/adapters) is run when executing `vite build`. It determines how the output is converted for different platforms.
142
+
Your [adapter](/docs/kit/adapters) is run when executing `vite build`. It determines how the output is converted for different platforms.
143
143
144
144
<divclass="ts-block-property-children">
145
145
@@ -247,9 +247,9 @@ When pages are prerendered, the CSP header is added via a `<meta http-equiv>` ta
247
247
248
248
> [!NOTE] When `mode` is `'auto'`, SvelteKit will use nonces for dynamically rendered pages and hashes for prerendered pages. Using nonces with prerendered pages is insecure and therefore forbidden.
249
249
250
-
> [!NOTE] Note that most [Svelte transitions](https://svelte.dev/tutorial/svelte/transition) work by creating an inline `<style>` element. If you use these in your app, you must either leave the `style-src` directive unspecified or add `unsafe-inline`.
250
+
> [!NOTE] Note that most [Svelte transitions](/tutorial/svelte/transition) work by creating an inline `<style>` element. If you use these in your app, you must either leave the `style-src` directive unspecified or add `unsafe-inline`.
251
251
252
-
If this level of configuration is insufficient and you have more dynamic requirements, you can use the [`handle` hook](https://svelte.dev/docs/kit/hooks#Server-hooks-handle) to roll your own CSP.
252
+
If this level of configuration is insufficient and you have more dynamic requirements, you can use the [`handle` hook](/docs/kit/hooks#Server-hooks-handle) to roll your own CSP.
253
253
254
254
<divclass="ts-block-property-children">
255
255
@@ -394,7 +394,7 @@ publicPrefix?: string;
394
394
395
395
</div>
396
396
397
-
A prefix that signals that an environment variable is safe to expose to client-side code. See [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) and [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public). Note that Vite's [`envPrefix`](https://vitejs.dev/config/shared-options.html#envprefix) must be set separately if you are using Vite's environment variable handling - though use of that feature should generally be unnecessary.
397
+
A prefix that signals that an environment variable is safe to expose to client-side code. See [`$env/static/public`](/docs/kit/$env-static-public) and [`$env/dynamic/public`](/docs/kit/$env-dynamic-public). Note that Vite's [`envPrefix`](https://vitejs.dev/config/shared-options.html#envprefix) must be set separately if you are using Vite's environment variable handling - though use of that feature should generally be unnecessary.
398
398
399
399
</div>
400
400
</div>
@@ -414,7 +414,7 @@ privatePrefix?: string;
414
414
415
415
</div>
416
416
417
-
A prefix that signals that an environment variable is unsafe to expose to client-side code. Environment variables matching neither the public nor the private prefix will be discarded completely. See [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) and [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private).
417
+
A prefix that signals that an environment variable is unsafe to expose to client-side code. Environment variables matching neither the public nor the private prefix will be discarded completely. See [`$env/static/private`](/docs/kit/$env-static-private) and [`$env/dynamic/private`](/docs/kit/$env-dynamic-private).
418
418
419
419
</div>
420
420
</div>
@@ -476,7 +476,7 @@ client?: string;
476
476
477
477
</div>
478
478
479
-
The location of your client [hooks](https://svelte.dev/docs/kit/hooks).
479
+
The location of your client [hooks](/docs/kit/hooks).
480
480
481
481
</div>
482
482
</div>
@@ -495,7 +495,7 @@ server?: string;
495
495
496
496
</div>
497
497
498
-
The location of your server [hooks](https://svelte.dev/docs/kit/hooks).
498
+
The location of your server [hooks](/docs/kit/hooks).
499
499
500
500
</div>
501
501
</div>
@@ -515,7 +515,7 @@ universal?: string;
515
515
516
516
</div>
517
517
518
-
The location of your universal [hooks](https://svelte.dev/docs/kit/hooks).
518
+
The location of your universal [hooks](/docs/kit/hooks).
519
519
520
520
</div>
521
521
</div></div>
@@ -556,7 +556,7 @@ params?: string;
556
556
557
557
</div>
558
558
559
-
a directory containing [parameter matchers](https://svelte.dev/docs/kit/advanced-routing#Matching)
559
+
a directory containing [parameter matchers](/docs/kit/advanced-routing#Matching)
560
560
561
561
</div>
562
562
</div>
@@ -575,7 +575,7 @@ routes?: string;
575
575
576
576
</div>
577
577
578
-
the files that define the structure of your app (see [Routing](https://svelte.dev/docs/kit/routing))
578
+
the files that define the structure of your app (see [Routing](/docs/kit/routing))
579
579
580
580
</div>
581
581
</div>
@@ -594,7 +594,7 @@ serviceWorker?: string;
594
594
595
595
</div>
596
596
597
-
the location of your service worker's entry point (see [Service workers](https://svelte.dev/docs/kit/service-workers))
597
+
the location of your service worker's entry point (see [Service workers](/docs/kit/service-workers))
598
598
599
599
</div>
600
600
</div>
@@ -798,7 +798,7 @@ base?: '' | `/${string}`;
798
798
799
799
</div>
800
800
801
-
A root-relative path that must start, but not end with `/` (e.g. `/base-path`), unless it is the empty string. This specifies where your app is served from and allows the app to live on a non-root path. Note that you need to prepend all your root-relative links with the base value or they will point to the root of your domain, not your `base` (this is how the browser works). You can use [`base` from `$app/paths`](https://svelte.dev/docs/kit/$app-paths#base) for that: `<a href="{base}/your-page">Link</a>`. If you find yourself writing this often, it may make sense to extract this into a reusable component.
801
+
A root-relative path that must start, but not end with `/` (e.g. `/base-path`), unless it is the empty string. This specifies where your app is served from and allows the app to live on a non-root path. Note that you need to prepend all your root-relative links with the base value or they will point to the root of your domain, not your `base` (this is how the browser works). You can use [`base` from `$app/paths`](/docs/kit/$app-paths#base) for that: `<a href="{base}/your-page">Link</a>`. If you find yourself writing this often, it may make sense to extract this into a reusable component.
802
802
803
803
</div>
804
804
</div>
@@ -823,7 +823,7 @@ Whether to use relative asset paths.
823
823
If `true`, `base` and `assets` imported from `$app/paths` will be replaced with relative asset paths during server-side rendering, resulting in more portable HTML.
824
824
If `false`, `%sveltekit.assets%` and references to build artifacts will always be root-relative paths, unless `paths.assets` is an external URL
825
825
826
-
[Single-page app](https://svelte.dev/docs/kit/single-page-apps) fallback pages will always use absolute paths, regardless of this setting.
826
+
[Single-page app](/docs/kit/single-page-apps) fallback pages will always use absolute paths, regardless of this setting.
827
827
828
828
If your app uses a `<base>` element, you should set this to `false`, otherwise asset URLs will incorrectly be resolved against the `<base>` URL rather than the current page.
829
829
@@ -842,7 +842,7 @@ In 1.0, `undefined` was a valid value, which was set by default. In that case, i
842
842
843
843
</div>
844
844
845
-
See [Prerendering](https://svelte.dev/docs/kit/page-options#prerender).
845
+
See [Prerendering](/docs/kit/page-options#prerender).
846
846
847
847
<divclass="ts-block-property-children">
848
848
@@ -1174,7 +1174,7 @@ Not all navigations will result in an error though, for example if the JavaScrip
1174
1174
</script>
1175
1175
```
1176
1176
1177
-
If you set `pollInterval` to a non-zero value, SvelteKit will poll for new versions in the background and set the value of [`updated.current`](https://svelte.dev/docs/kit/$app-state#updated) `true` when it detects one.
1177
+
If you set `pollInterval` to a non-zero value, SvelteKit will poll for new versions in the background and set the value of [`updated.current`](/docs/kit/$app-state#updated) `true` when it detects one.
0 commit comments