Skip to content

Commit

Permalink
docs: summarize behavior of routes files (#11720)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
  • Loading branch information
Pierstoval and benmccann committed Jun 19, 2024
1 parent 4cbf219 commit 434ce18
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions documentation/docs/20-core-concepts/10-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ At the heart of SvelteKit is a _filesystem-based router_. The routes of your app
Each route directory contains one or more _route files_, which can be identified by their `+` prefix.

We'll introduce these files in a moment in more detail, but here are a few simple rules to help you remember how SvelteKit's routing works:

* All files can run on the server
* All files run on the client except `+server` files

This comment has been minimized.

Copy link
@eltigerchino

eltigerchino Jun 20, 2024

Member

I might be too late, but I think:

  1. It's obvious if a file runs on the server e.g., +page.server.js, +server.js, so we may not need to mention this.
  2. A file without the server keyword can either run on the client, server, or both, depending on the page options enabled (ssr / csr). It might be misleading to say "all files run on the client".
* `+layout` and `+error` files apply to subdirectories as well as the directory they live in

## +page

### +page.svelte
Expand Down

0 comments on commit 434ce18

Please sign in to comment.