Skip to content

Commit aa0f154

Browse files
authored
Merge branch 'main' into main
2 parents d6881b5 + 373d1a6 commit aa0f154

File tree

27 files changed

+119
-43
lines changed

27 files changed

+119
-43
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
### A note on documentation PRs
2-
3-
If this is a documentation PR (i.e. changing content within `apps/svelte.dev/content/docs`), then this is the wrong repository to make those changes. The content in this folder is synced from other repositories. Therefore, these changes should be made in their respective repositories (at https://github.com/sveltejs/svelte or https://github.com/sveltejs/kit, or example).
1+
<!-- If this is a documentation PR (i.e. changing content within `apps/svelte.dev/content/docs`), then this is the wrong repository to make those changes. The content in this folder is synced from other repositories. Therefore, these changes should be made in their respective repositories (at https://github.com/sveltejs/svelte or https://github.com/sveltejs/kit, or example). -->
42

53
### Before submitting the PR, please make sure you do the following
64

apps/svelte.dev/content/blog/2017-09-06-the-zen-of-just-writing-css.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This article isn't in any way intended as criticism of the hard work the CSS-in-
1717

1818
Everything in CSS is global. Because of that, styles intended for one bit of markup often end up affecting another. Because of _that_, developers often resort to wild namespacing conventions (not 'rules', since they're very difficult to enforce) that mostly just increase your risk of RSI.
1919

20-
It gets worse when you're working on a team. No-one dares touch styles authored by someone else, because it's often unclear what they're doing, what markup they apply to, and what disasters will unfold if you remove them.
20+
It gets worse when you're working on a team. No one dares touch styles authored by someone else, because it's often unclear what they're doing, what markup they apply to, and what disasters will unfold if you remove them.
2121

2222
The consequence of all this is the **append-only stylesheet**. There's no way of knowing which code can safely be removed, so it's common to undo some existing style with another, more specific style — even on relatively small projects.
2323

apps/svelte.dev/content/blog/2018-12-27-virtual-dom-is-pure-overhead.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Misunderstood claims about virtual DOM performance date back to the launch of Re
4242
<figcaption>Screenshot from <a href="https://www.youtube.com/watch?v=x7cQ3mrcKaY">Rethinking Best Practices</a> at JSConfEU 2013</figcaption>
4343
</figure>
4444

45-
But hang on a minute! The virtual DOM operations are _in addition to_ the eventual operations on the real DOM. The only way it could be faster is if we were comparing it to a less efficient framework (there were plenty to go around back in 2013!), or arguing against a straw man — that the alternative is to do something no-one actually does:
45+
But hang on a minute! The virtual DOM operations are _in addition to_ the eventual operations on the real DOM. The only way it could be faster is if we were comparing it to a less efficient framework (there were plenty to go around back in 2013!), or arguing against a straw man — that the alternative is to do something no one actually does:
4646

4747
```js
4848
// @noErrors

apps/svelte.dev/content/blog/2023-03-09-zero-config-type-safety.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export type PageData = Kit.ReturnType<
9898
>;
9999
```
100100

101-
We don't actually write `$types.d.ts` into your `src` directory — that would be messy, and no-one likes messy code. Instead, we use a TypeScript feature called [`rootDirs`](https://www.typescriptlang.org/tsconfig#rootDirs), which lets us map ‘virtual’ directories to real ones. By setting `rootDirs` to the project root (the default) and additionally to `.svelte-kit/types` (the output folder of all the generated types) and then mirroring the route structure inside it we get the desired behavior:
101+
We don't actually write `$types.d.ts` into your `src` directory — that would be messy, and no one likes messy code. Instead, we use a TypeScript feature called [`rootDirs`](https://www.typescriptlang.org/tsconfig#rootDirs), which lets us map ‘virtual’ directories to real ones. By setting `rootDirs` to the project root (the default) and additionally to `.svelte-kit/types` (the output folder of all the generated types) and then mirroring the route structure inside it we get the desired behavior:
102102

103103
```tree
104104
// on disk:

apps/svelte.dev/content/docs/kit/10-getting-started/20-creating-a-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Creating a project
55

66
The easiest way to start building a SvelteKit app is to run `npx sv create`:
77

8-
```bash
8+
```sh
99
npx sv create my-app
1010
cd my-app
1111
npm install

apps/svelte.dev/content/docs/kit/20-core-concepts/40-page-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Since these routes cannot be dynamically server-rendered, this will cause errors
8989

9090
SvelteKit will discover pages to prerender automatically, by starting at _entry points_ and crawling them. By default, all your non-dynamic routes are considered entry points — for example, if you have these routes...
9191

92-
```bash
92+
```sh
9393
/ # non-dynamic
9494
/blog # non-dynamic
9595
/blog/[slug] # dynamic, because of `[slug]`

apps/svelte.dev/content/docs/kit/25-build-and-deploy/40-adapter-node.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ First, build your app with `npm run build`. This will create the production serv
2727

2828
You will need the output directory, the project's `package.json`, and the production dependencies in `node_modules` to run the application. Production dependencies can be generated by copying the `package.json` and `package-lock.json` and then running `npm ci --omit dev` (you can skip this step if your app doesn't have any dependencies). You can then start your app with this command:
2929

30-
```bash
30+
```sh
3131
node build
3232
```
3333

@@ -45,41 +45,41 @@ In `dev` and `preview`, SvelteKit will read environment variables from your `.en
4545

4646
In production, `.env` files are _not_ automatically loaded. To do so, install `dotenv` in your project...
4747

48-
```bash
48+
```sh
4949
npm install dotenv
5050
```
5151

5252
...and invoke it before running the built app:
5353

54-
```bash
54+
```sh
5555
node +++-r dotenv/config+++ build
5656
```
5757

5858
If you use Node.js v20.6+, you can use the [`--env-file`](https://nodejs.org/en/learn/command-line/how-to-read-environment-variables-from-nodejs) flag instead:
5959

60-
```bash
60+
```sh
6161
node +++--env-file=.env+++ build
6262
```
6363

6464
### `PORT`, `HOST` and `SOCKET_PATH`
6565

6666
By default, the server will accept connections on `0.0.0.0` using port 3000. These can be customised with the `PORT` and `HOST` environment variables:
6767

68-
```bash
68+
```sh
6969
HOST=127.0.0.1 PORT=4000 node build
7070
```
7171

7272
Alternatively, the server can be configured to accept connections on a specified socket path. When this is done using the `SOCKET_PATH` environment variable, the `HOST` and `PORT` environment variables will be disregarded.
7373

74-
```bash
74+
```sh
7575
SOCKET_PATH=/tmp/socket node build
7676
```
7777

7878
### `ORIGIN`, `PROTOCOL_HEADER`, `HOST_HEADER`, and `PORT_HEADER`
7979

8080
HTTP doesn't give SvelteKit a reliable way to know the URL that is currently being requested. The simplest way to tell SvelteKit where the app is being served is to set the `ORIGIN` environment variable:
8181

82-
```bash
82+
```sh
8383
ORIGIN=https://my.site node build
8484

8585
# or e.g. for local previewing and testing
@@ -88,7 +88,7 @@ ORIGIN=http://localhost:3000 node build
8888

8989
With this, a request for the `/stuff` pathname will correctly resolve to `https://my.site/stuff`. Alternatively, you can specify headers that tell SvelteKit about the request protocol and host, from which it can construct the origin URL:
9090

91-
```bash
91+
```sh
9292
PROTOCOL_HEADER=x-forwarded-proto HOST_HEADER=x-forwarded-host node build
9393
```
9494

@@ -104,7 +104,7 @@ If `adapter-node` can't correctly determine the URL of your deployment, you may
104104

105105
The [`RequestEvent`](@sveltejs-kit#RequestEvent) object passed to hooks and endpoints includes an `event.getClientAddress()` function that returns the client's IP address. By default this is the connecting `remoteAddress`. If your server is behind one or more proxies (such as a load balancer), this value will contain the innermost proxy's IP address rather than the client's, so we need to specify an `ADDRESS_HEADER` to read the address from:
106106

107-
```bash
107+
```sh
108108
ADDRESS_HEADER=True-Client-IP node build
109109
```
110110

@@ -175,7 +175,7 @@ If you need to change the name of the environment variables used to configure th
175175
envPrefix: 'MY_CUSTOM_';
176176
```
177177

178-
```bash
178+
```sh
179179
MY_CUSTOM_HOST=127.0.0.1 \
180180
MY_CUSTOM_PORT=4000 \
181181
MY_CUSTOM_ORIGIN=https://my.site \

apps/svelte.dev/content/docs/kit/25-build-and-deploy/70-adapter-cloudflare-workers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ https://dash.cloudflare.com/<your-account-id>/home
6565
6666
You will need to install [Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/) and log in, if you haven't already:
6767

68-
```bash
68+
```sh
6969
npm i -D wrangler
7070
wrangler login
7171
```
7272

7373
Then, you can build your app and deploy it:
7474

75-
```bash
75+
```sh
7676
wrangler deploy
7777
```
7878

apps/svelte.dev/content/docs/kit/25-build-and-deploy/90-adapter-vercel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Set this string as an environment variable on Vercel by logging in and going to
132132

133133
To get this key known about for local development, you can use the [Vercel CLI](https://vercel.com/docs/cli/env) by running the `vercel env pull` command locally like so:
134134

135-
```bash
135+
```sh
136136
vercel env pull .env.development.local
137137
```
138138

apps/svelte.dev/content/docs/kit/30-advanced/10-advanced-routing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Advanced routing
77

88
If the number of route segments is unknown, you can use rest syntax — for example you might implement GitHub's file viewer like so...
99

10-
```bash
10+
```sh
1111
/[org]/[repo]/tree/[branch]/[...file]
1212
```
1313

@@ -102,7 +102,7 @@ Each module in the `params` directory corresponds to a matcher, with the excepti
102102

103103
It's possible for multiple routes to match a given path. For example each of these routes would match `/foo-abc`:
104104

105-
```bash
105+
```sh
106106
src/routes/[...catchall]/+page.svelte
107107
src/routes/[[a=x]]/+page.svelte
108108
src/routes/[b]/+page.svelte
@@ -119,7 +119,7 @@ SvelteKit needs to know which route is being requested. To do so, it sorts them
119119

120120
...resulting in this ordering, meaning that `/foo-abc` will invoke `src/routes/foo-abc/+page.svelte`, and `/foo-def` will invoke `src/routes/foo-[c]/+page.svelte` rather than less specific routes:
121121

122-
```bash
122+
```sh
123123
src/routes/foo-abc/+page.svelte
124124
src/routes/foo-[c]/+page.svelte
125125
src/routes/[[a=x]]/+page.svelte

0 commit comments

Comments
 (0)