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: documentation/docs/10-getting-started/30-project-structure.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,9 +54,9 @@ The `src` directory contains the meat of your project. Everything except `src/ro
54
54
-`hooks.server.js` contains your server [hooks](/docs/hooks)
55
55
-`service-worker.js` contains your [service worker](/docs/service-workers)
56
56
57
-
You can use `.ts` files instead of `.js` files, if using TypeScript.
57
+
(Whether the project contains `.js` or `.ts` files depends on whether you opt to use TypeScript when you create your project. You can switch between JavaScript and TypeScript in the documentation using the toggle at the bottom of this page.)
58
58
59
-
If you added [Vitest](https://vitest.dev) when you set up your project, your unit tests will live in the `src` directory with a `.test.js`(or `.test.ts`) extension.
59
+
If you added [Vitest](https://vitest.dev) when you set up your project, your unit tests will live in the `src` directory with a `.test.js` extension.
Copy file name to clipboardExpand all lines: documentation/docs/20-core-concepts/10-routing.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ A `+page.svelte` component defines a page of your app. By default, pages are ren
46
46
47
47
### +page.js
48
48
49
-
Often, a page will need to load some data before it can be rendered. For this, we add a `+page.js`(or `+page.ts`, if you're TypeScript-inclined) module that exports a `load` function:
49
+
Often, a page will need to load some data before it can be rendered. For this, we add a `+page.js` module that exports a `load` function:
50
50
51
51
```js
52
52
/// file: src/routes/blog/[slug]/+page.js
@@ -248,7 +248,7 @@ Like `+layout.js`, `+layout.server.js` can export [page options](page-options)
248
248
249
249
## +server
250
250
251
-
As well as pages, you can define routes with a `+server.js` file (sometimes referred to as an 'API route' or an 'endpoint'), which gives you full control over the response. Your `+server.js` file (or `+server.ts`) exports functions corresponding to HTTP verbs like `GET`, `POST`, `PATCH`, `PUT`, `DELETE`, and `OPTIONS` that take a `RequestEvent` argument and return a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object.
251
+
As well as pages, you can define routes with a `+server.js` file (sometimes referred to as an 'API route' or an 'endpoint'), which gives you full control over the response. Your `+server.js` file exports functions corresponding to HTTP verbs like `GET`, `POST`, `PATCH`, `PUT`, `DELETE`, and `OPTIONS` that take a `RequestEvent` argument and return a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object.
252
252
253
253
For example we could create an `/api/random-number` route with a `GET` handler:
Copy file name to clipboardExpand all lines: documentation/docs/20-core-concepts/20-load.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
@@ -6,7 +6,7 @@ Before a [`+page.svelte`](routing#page-page-svelte) component (and its containin
6
6
7
7
## Page data
8
8
9
-
A `+page.svelte` file can have a sibling `+page.js`(or `+page.ts`) that exports a `load` function, the return value of which is available to the page via the `data` prop:
9
+
A `+page.svelte` file can have a sibling `+page.js` that exports a `load` function, the return value of which is available to the page via the `data` prop:
Copy file name to clipboardExpand all lines: documentation/docs/20-core-concepts/40-page-options.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,8 +78,6 @@ For that reason among others, it's recommended that you always include a file ex
78
78
79
79
For _pages_, we skirt around this problem by writing `foo/index.html` instead of `foo`.
80
80
81
-
Note that this will disable client-side routing for any navigation from this page, regardless of whether the router is already active.
82
-
83
81
### Troubleshooting
84
82
85
83
If you encounter an error like 'The following routes were marked as prerenderable, but were not prerendered' it's because the route in question (or a parent layout, if it's a page) has `export const prerender = true` but the page wasn't actually prerendered, because it wasn't reached by the prerendering crawler.
0 commit comments