Skip to content

Commit 7396e71

Browse files
committed
Merge remote-tracking branch 'sveltejs/main' into update-up-to-20230408
2 parents 59937ef + 0994534 commit 7396e71

File tree

148 files changed

+1765
-1535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1765
-1535
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ A soup-to-nuts interactive tutorial on how to build apps with Svelte.
66

77
This repo uses [pnpm](https://pnpm.io/).
88

9-
## Running the app
9+
## Developing the app
1010

11-
First, run `node scripts/create-common-bundle`. This packages up everything that's needed to run a SvelteKit app (Vite, Esbuild, SvelteKit, Svelte compiler etc) which can subsequently be unpacked on a server to create and run and instance of a SvelteKit application (which powers the output window of the tutorial).
11+
First, run `node scripts/create-common-bundle`. This packages up everything that's needed to run a SvelteKit app (Vite, Esbuild, SvelteKit, Svelte compiler etc) which can subsequently be unpacked on a server to create and run and instance of a SvelteKit application (which powers the output window of the tutorial). Then, run `dev`:
1212

13-
The next steps depend on whether you want to run this locally in filesystem mode, or in WebContainer mode. For now, it works with filesystem mode only locally. In future, it will run both locally and on the web (using [WebContainers](https://blog.stackblitz.com/posts/introducing-webcontainers/)).
13+
```bash
14+
node scripts/create-common-bundle
15+
pnpm dev
16+
```
1417

15-
### Local/filesystem mode
18+
To build for production and run locally:
1619

17-
1. add an `.env` file with `PUBLIC_USE_FILESYSTEM=true` in it
18-
2. Run the app locally with `pnpm dev` or `pnpm build && pnpm preview`.
19-
20-
### WebContainer mode
21-
22-
1. if an `.env` file exists, modify it so there's `PUBLIC_USE_FILESYSTEM=` in it
23-
2. Run the app locally with `pnpm dev` or `pnpm build && pnpm preview`.
20+
```bash
21+
pnpm build
22+
pnpm preview
23+
```
2424

2525
## Creating new tutorials
2626

2727
Tutorials live inside `content`. Each tutorial consists of a `README.md`, which is the text to the left, and `app-a` and `app-b` folders, which represent the initial and solved state. Files that stay the same can be omitted from `app-b`. Files are marked as deleted in `app-b` if they start with `__delete`. Folders that are marked as deleted in `app-b` if they contain a file named `__delete`.
2828

2929
## Bumping tutorial dependencies
3030

31-
Bump the dependency (for example Svelte) in both the root and the `content/common` `package.json`. In the root do `pnpm i` (to update `pnpm-lock.yaml`), in `content/common` do `npm i` (to update `package-lock.json`). After deployment things might be out of date because Vercel caches things, redeploy without cache in that case.
31+
Bump the dependency (for example Svelte) in both the root and the `content/common` `package.json`. In the root do `pnpm i` (to update `pnpm-lock.yaml`), in `content/common` do `npm i` (to update `package-lock.json`).

backend/+server.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

backend/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

backend/[id]/+server.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

backend/apps.js

Lines changed: 0 additions & 208 deletions
This file was deleted.

backend/destroy/+server.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

backend/ws.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

content/tutorial/02-advanced-svelte/07-composition/01-slots/app-a/src/lib/Card.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
font-family: 'Silian Rail';
2020
width: 24em;
2121
aspect-ratio: 3.5 / 2.0;
22-
background: url(./paper.svg);
22+
background: url(./paper.svg) no-repeat 50% 50%;
23+
background-size: cover;
2324
border-radius: 2px;
2425
filter: drop-shadow(0.1em 0.1em 0.1em rgba(0, 0, 0, 0.2));
2526
padding: 1.5em 1em 1em 1em;

content/tutorial/02-advanced-svelte/07-composition/01-slots/app-b/src/lib/Card.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
font-family: 'Silian Rail';
2020
width: 24em;
2121
aspect-ratio: 3.5 / 2.0;
22-
background: url(./paper.svg);
22+
background: url(./paper.svg) no-repeat 50% 50%;
23+
background-size: cover;
2324
border-radius: 2px;
2425
filter: drop-shadow(0.1em 0.1em 0.1em rgba(0, 0, 0, 0.2));
2526
padding: 1.5em 1em 1em 1em;

content/tutorial/02-advanced-svelte/07-composition/02-named-slots/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ title: Named slots
2222
</div>
2323
```
2424

25-
`<small>` 要素にいくつかスタイルを追加して、自身の行におさまるようにします。`<Card>` のコンテンツは `Card.svelte` から `font-family` (この書体は ['Silian Rail'](https://www.youtube.com/watch?v=aZVkW9p-cCU) と呼ばれます) などのスタイルを継承しますが、通常のスコープのルールが適用されるため、この要素がある場所、つまり `App.svelte` にスタイルを追加します:
25+
`App.svelte``<small>` 要素にいくつかスタイルを追加して、自身の行におさまるようにします。`<Card>` のコンテンツは `Card.svelte` から `font-family` (この書体は ['Silian Rail'](https://www.youtube.com/watch?v=aZVkW9p-cCU) と呼ばれます) などのスタイルを継承しますが、通常のスコープのルールが適用されるため、この要素がある場所、つまり `App.svelte` にスタイルを追加します:
2626

2727
```svelte
2828
/// file: App.svelte

0 commit comments

Comments
 (0)