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
`true` if the request comes from the client asking for `+page/layout.server.js` data. The `url` property will be stripped of the internal information
related to the data request in this case. Use this property instead if the distinction is important to you.
+page/layout.server.js
It is unclear where the forward slash begins and ends on the split. Does layout start with a plus? does +page also have a .server? Can also be confused with paths.
In turn, annotating the `load` function with `PageLoad`, `PageServerLoad`, `LayoutLoad` or `LayoutServerLoad` (for `+page.js`, `+page.server.js`, `+layout.js` and `+layout.server.js` respectively) ensures that `params` and the return value are correctly typed.
Here it is listed separately, but always shows .js even though you toggle it to TS
Alternatively, you can set `export const prerender = true` in your root `+layout.js` or `+layout.server.js` and prerender everything except pages that are explicitly marked as _not_ prerenderable:
It doesn't list all the options; the rest is listed in the description. It is also very tight, it lists it out separately but uses a forward slash with no spacing.
Suggested Fixes
Dedicated UI
I suggest the docs site create a UI similar to <select /> that can handle this kind of permutation.
Prior Art:
I can't find any :/
Formatted Text
[+page.server.js | +layout.server.ts]
This gives it a distinctive look so readers can quickly skip over it.
Plain Text
+page.server.js, +layout.server.js
This is just formatted like English.
Additional Details
Currently, there are many reserved name combinations for which we cannot simply say *.server.js or +layout.*; it just starts to become cryptic.
Here is a list of all current file names with special meaning:
+page.svelte
+page.js
+page.server.js
+layout.svelte
+layout.js
+layout.server.js
+server.js
+error.svelte
*.svelte.js
Plus 7 more .ts files
The text was updated successfully, but these errors were encountered:
Issue
In the docs, a feature or API often applies to more than 1 reserved file. But they're displayed inconsistently.
Example 1
svelte.dev/apps/svelte.dev/content/docs/kit/98-reference/[email protected]
Lines 2000 to 2001 in 2e91d80
+page/layout.server.js
It is unclear where the forward slash begins and ends on the split. Does
layout
start with a plus? does+page
also have a.server
? Can also be confused with paths.Example 2
svelte.dev/apps/svelte.dev/content/docs/kit/20-core-concepts/10-routing.md
Line 396 in 2e91d80
Here it is listed separately, but always shows
.js
even though you toggle it to TSExample 3
svelte.dev/apps/svelte.dev/content/docs/kit/20-core-concepts/40-page-options.md
Lines 15 to 20 in 2e91d80
It doesn't list all the options; the rest is listed in the description. It is also very tight, it lists it out separately but uses a forward slash with no spacing.
Suggested Fixes
Dedicated UI
I suggest the docs site create a UI similar to
<select />
that can handle this kind of permutation.Prior Art:
Formatted Text
Plain Text
Additional Details
Currently, there are many reserved name combinations for which we cannot simply say
*.server.js
or+layout.*
; it just starts to become cryptic.Here is a list of all current file names with special meaning:
Plus 7 more .ts files
The text was updated successfully, but these errors were encountered: