Skip to content

Commit 0f7d41d

Browse files
authored
Merge pull request #15 from tomoam/sync-upstream-20250121
2025/01/21 迄の更新に追従
2 parents 4a9c346 + 90964b9 commit 0f7d41d

File tree

411 files changed

+8431
-3416
lines changed

Some content is hidden

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

411 files changed

+8431
-3416
lines changed

apps/svelte.dev/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ SUPABASE_KEY=
33

44
GITHUB_CLIENT_ID=
55
GITHUB_CLIENT_SECRET=
6+
7+
# disable prerendering with `PRERENDER=false pnpm build` — this is useful for speeding up builds when previewing locally
8+
PRERENDER=true

apps/svelte.dev/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/src/routes/_home/Supporters/contributors.js
77
/src/routes/_home/Supporters/donors.jpg
88
/src/routes/_home/Supporters/donors.js
9+
/scripts/svelte-template
10+
/static/svelte-template.json
911

1012
# git-repositories of synced docs go here
1113
/repos/

apps/svelte.dev/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,11 @@ When writing content for the tutorial, you need to be aware of the differences o
3535
### Dependencies
3636

3737
If you look in the site's package.json you'll notice several dependencies that don't appear to be used, such as `@testing-library/svelte`. These are present because they're referenced in the docs, and Twoslash needs to be able to find type definitions in order to typecheck snippets. Installing the dependencies was deemed preferable to faking it with `declare module`, since we're liable to end up with fictional types that way.
38+
39+
### Prerendering
40+
41+
Most of the site is prerendered. Since that involves some fairly expensive work, it can take a while. To build the site _without_ prerendering — for example, because you need to debug an issue that's affecting production builds — set the `PRERENDER` environment variable to `false`:
42+
43+
```bash
44+
PRERENDER=false pnpm build
45+
```

apps/svelte.dev/content/blog/2021-04-01-whats-new-in-svelte-april-2021.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ authorURL: https://dreamindani.com
1414

1515
## SvelteとLanguageツールの新着情報(New in Svelte & Language Tools)
1616

17-
- Slotted components (`<svelte:fragment slot="...">`を含む) を使用すると、コンポーネントの利用者が特定のスロットにリッチなコンテンツを割り当てることができます (**Svelte 3.35.0, Language Tools [104.5.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-104.5.0)**, [docs](/docs/special-elements#svelte-fragment)[tutorial](https://svelte.jp/tutorial/svelte-fragment) をチェックしてみてください)
17+
- Slotted components (`<svelte:fragment slot="...">`を含む) を使用すると、コンポーネントの利用者が特定のスロットにリッチなコンテンツを割り当てることができます (**Svelte 3.35.0, Language Tools [104.5.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-104.5.0)**)
1818
- Linked editing がSvelteファイル内のHTMLで機能するようになりました (**Language Tools, [104.6.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-104.6.0)**)
1919
- 型定義 `svelte.d.ts` が正常に解決されるようになり、ライブラリの作成者がSvelteコンポーネントと一緒に型定義を配布できるようになりました (**Language Tools, [104.7.0](https://github.com/sveltejs/language-tools/releases/tag/extensions-104.7.0)**)
2020
- ViteでSvelteを使用するのに [vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte) が利用可能になりました。`npm init @vitejs/app` はこのプラグインを使用したSvelteオプションが含まれています。

apps/svelte.dev/content/blog/2023-02-21-streaming-snapshots-sveltekit.md

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ export const load: PageServerLoad = () => {
2929
};
3030
```
3131

32-
<<<<<<< HEAD
33-
SvelteKit は自動的にこの `fetchPost` の呼び出しを await してからページのレンダリングを開始します。なぜならそれがトップレベルだからです。しかし、ネストした `fetchComments` の呼び出しが完了するのは待ちません – ページはレンダリングされ、`data.streamed.comments` はリクエストが完了すると解決する promise となります。`+page.svelte` で、Svelte の [await block](/docs/logic-blocks#await) を使用してロード中の状態を表示することもできます:
34-
=======
35-
SvelteKit will automatically await the `fetchPost` call before it starts rendering the page, since it’s at the top level. However, it won’t wait for the nested `fetchComments` call to complete – the page will render and `data.streamed.comments` will be a promise that will resolve as the request completes. We can show a loading state in the corresponding `+page.svelte` using Svelte’s [await block](/docs/svelte/await):
36-
>>>>>>> sveltejs/main
32+
SvelteKit は自動的にこの `fetchPost` の呼び出しを await してからページのレンダリングを開始します。なぜならそれがトップレベルだからです。しかし、ネストした `fetchComments` の呼び出しが完了するのは待ちません – ページはレンダリングされ、`data.streamed.comments` はリクエストが完了すると解決する promise となります。`+page.svelte` で、Svelte の [await block](/docs/svelte/await) を使用してロード中の状態を表示することもできます:
3733

3834
```svelte
3935
<script lang="ts">
@@ -125,11 +121,7 @@ const data = {
125121

126122
注意事項: この機能には JavaScript が必要です。そのため、重要でないデータのみ、ストリーミングすることを推奨します。すべてのユーザーがエクスペリエンスのコアを利用できるようにするためです。
127123

128-
<<<<<<< HEAD
129-
この機能の詳細については、[ドキュメント](https://kit.svelte.jp/docs/load#streaming-with-promises)をご覧ください。デモは [sveltekit-on-the-edge.vercel.app](https://sveltekit-on-the-edge.vercel.app/edge) (ロケーションデータをわざと遅延させ、ストリーミングしています) でご覧頂けますし、[ご自身で Vercel にデプロイ](https://vercel.com/templates/svelte/sveltekit-edge-functions)することもできます。Vercel では Edge Functions と Serverless Functions のどちらもストリーミングをサポートしています。
130-
=======
131-
For more on this feature, see [the documentation](/docs/kit/load#Streaming-with-promises). You can see a demo at [sveltekit-on-the-edge.vercel.app](https://sveltekit-on-the-edge.vercel.app/edge) (the location data is artificially delayed and streamed in) or [deploy your own on Vercel](https://vercel.com/templates/svelte/sveltekit-edge-functions), where streaming is supported in both Edge Functions and Serverless Functions.
132-
>>>>>>> sveltejs/main
124+
この機能の詳細については、[ドキュメント](/docs/kit/load#Streaming-with-promises)をご覧ください。デモは [sveltekit-on-the-edge.vercel.app](https://sveltekit-on-the-edge.vercel.app/edge) (ロケーションデータをわざと遅延させ、ストリーミングしています) でご覧頂けますし、[ご自身で Vercel にデプロイ](https://vercel.com/templates/svelte/sveltekit-edge-functions)することもできます。Vercel では Edge Functions と Serverless Functions のどちらもストリーミングをサポートしています。
133125

134126
私たちは、Qwik、Remix、Solid、Marko、React などの、このアイデアの先行実装からインスピレーションを受けました。深く感謝します。
135127

@@ -162,19 +154,11 @@ For more on this feature, see [the documentation](/docs/kit/load#Streaming-with-
162154

163155
フォームの input の値やスクロールポジションなどは一般的な例で、JSON-serializable なデータならなんでも snapshot に保存することができます。snapshot のデータは [sessionStorage](https://developer.mozilla.org/ja/docs/Web/API/Window/sessionStorage) に保存されるので、ページがリロードされたときや、ユーザーがまったく別のサイトに移動したときにも保持されます。`sessionStorage` に保存されるため、サーバーサイドレンダリング中にアクセスすることはできません。
164156

165-
<<<<<<< HEAD
166-
詳細は、[ドキュメント](https://kit.svelte.jp/docs/snapshots)をご覧ください。
157+
詳細は、[ドキュメント](/docs/kit/snapshots)をご覧ください。
167158

168159
## Route-level deployment configuration
169160

170-
SvelteKit はプラットフォームごとに固有の [adapter](https://kit.svelte.jp/docs/adapters) を使用してプロダクションへのデプロイ用にアプリのコードを変換しています。これまでは、デプロイメントの設定をアプリ全体レベルで行わなければなりませんでした。例えば、アプリを edge function としてデプロイするか、serverless function としてデプロイするか、どちらか一方は可能でしたが、両方同時に行うことはできませんでした。これでは、アプリの一部だけを edge にするというメリットを得ることができません – もし Node API を必要とするルート(route)がある場合、アプリ全体を edge にデプロイすることができないのです。リージョンの選択やメモリ割り当てなど、デプロイ設定の他の側面についても同様です: アプリ全体、すべてのルート(route)に適用される1つの値を選択しなければならなかったのです。
171-
=======
172-
For more, see [the documentation](/docs/kit/snapshots).
173-
174-
## Route-level deployment configuration
175-
176-
SvelteKit uses platform-specific [adapters](/docs/kit/adapters) to transform your app code for deployment to production. Until now, you had to configure your deployment on an app-wide level. For instance, you could either deploy your app as an edge function or a serverless function, but not both. This made it impossible to take advantage of the edge for parts of your app – if any route needed Node APIs, then you couldn’t deploy any of it to the edge. The same is true for other aspects of deployment configuration, such as regions and allocated memory: you had to choose one value that applied to every route in your entire app.
177-
>>>>>>> sveltejs/main
161+
SvelteKit はプラットフォームごとに固有の [adapter](/docs/kit/adapters) を使用してプロダクションへのデプロイ用にアプリのコードを変換しています。これまでは、デプロイメントの設定をアプリ全体レベルで行わなければなりませんでした。例えば、アプリを edge function としてデプロイするか、serverless function としてデプロイするか、どちらか一方は可能でしたが、両方同時に行うことはできませんでした。これでは、アプリの一部だけを edge にするというメリットを得ることができません – もし Node API を必要とするルート(route)がある場合、アプリ全体を edge にデプロイすることができないのです。リージョンの選択やメモリ割り当てなど、デプロイ設定の他の側面についても同様です: アプリ全体、すべてのルート(route)に適用される1つの値を選択しなければならなかったのです。
178162

179163
そしてこの度、`config` オブジェクトを `+server.js``+page(.server).js``+layout(.server).js` ファイルでエクスポートすることができるようになり、これらのルート(route)をどうやってデプロイするかコントロールできるようになりました。`+layout.js` でこれを行うと、そのすべての子ページに設定が適用されます。`config` の型は、デプロイ先の環境に依存するため、各 adapter ごとにユニークです。
180164

@@ -187,11 +171,7 @@ export const config: Config = {
187171
};
188172
```
189173

190-
<<<<<<< HEAD
191-
Config はトップレベルでマージされるため、レイアウトで設定された値をツリーのさらに下のページで上書きすることができます。詳細は[ドキュメント](https://kit.svelte.jp/docs/page-options#config)をご覧ください。
192-
=======
193-
Configs are merged at the top level, so you can override values set in a layout for pages further down the tree. For more details, see [the documentation](/docs/kit/page-options#config).
194-
>>>>>>> sveltejs/main
174+
Config はトップレベルでマージされるため、レイアウトで設定された値をツリーのさらに下のページで上書きすることができます。詳細は[ドキュメント](/docs/kit/page-options#config)をご覧ください。
195175

196176
Vercel にデプロイする場合、最新バージョンの SvelteKit と adapter をインストールすることでこの機能のメリットを享受することができます。ルートレベル(route-level)の config をサポートする adapter は SvelteKit 1.5 以降が必要であるため、adapter のバージョンを大幅にアップグレードする必要があるかもしれません。
197177

@@ -200,19 +180,11 @@ npm i @sveltejs/kit@latest
200180
npm i @sveltejs/adapter-auto@latest # or @sveltejs/adapter-vercel@latest
201181
```
202182

203-
<<<<<<< HEAD
204-
今現在は、[Vercel adapter](https://kit.svelte.jp/docs/adapter-vercel#deployment-configuration) のみがルート固有(route-specific)の config を実装していますが、他のプラットフォーム向けでもこれを実装するためのビルディングブロックがあります。もしあなたが adapter の作者なら、[この PR](https://github.com/sveltejs/kit/pull/8740) の変更点を参照し、要求事項を確認してください。
205-
206-
## Incremental static regeneration on Vercel
207-
208-
ルートレベル(Route-level)の config では、もう1つ要望の多かった機能も使えるようになりました – Vercel にデプロイされる SvelteKit アプリで、[incremental static regeneration](https://kit.svelte.jp/docs/adapter-vercel#incremental-static-regeneration) (ISR) が使用できるようになりました。ISR は、プリレンダリングされたコンテンツにおけるコストとパフォーマンスの優位性と、動的なレンダリングコンテンツの柔軟性の両方を提供します。
209-
=======
210-
For now, only the [Vercel adapter](/docs/kit/adapter-vercel#Deployment-configuration) implements route-specific config, but the building blocks are there to implement this for other platforms. If you’re an adapter author, see the changes in [the PR](https://github.com/sveltejs/kit/pull/8740) to see what is required.
183+
今現在は、[Vercel adapter](/docs/kit/adapter-vercel#Deployment-configuration) のみがルート固有(route-specific)の config を実装していますが、他のプラットフォーム向けでもこれを実装するためのビルディングブロックがあります。もしあなたが adapter の作者なら、[この PR](https://github.com/sveltejs/kit/pull/8740) の変更点を参照し、要求事項を確認してください。
211184

212185
## Incremental static regeneration on Vercel
213186

214-
Route-level config also unlocked another much-requested feature – you can now use [incremental static regeneration](/docs/kit/adapter-vercel#Incremental-Static-Regeneration) (ISR) with SvelteKit apps deployed to Vercel. ISR provides the performance and cost advantages of prerendered content with the flexibility of dynamically rendered content.
215-
>>>>>>> sveltejs/main
187+
ルートレベル(Route-level)の config では、もう1つ要望の多かった機能も使えるようになりました – Vercel にデプロイされる SvelteKit アプリで、[incremental static regeneration](/docs/kit/adapter-vercel#Incremental-Static-Regeneration) (ISR) が使用できるようになりました。ISR は、プリレンダリングされたコンテンツにおけるコストとパフォーマンスの優位性と、動的なレンダリングコンテンツの柔軟性の両方を提供します。
216188

217189
ISR をルート(route)に追加するには、`config` オブジェクトに `isr` プロパティを追加します:
218190

@@ -226,18 +198,10 @@ export const config = {
226198

227199
## And much more...
228200

229-
<<<<<<< HEAD
230-
- [OPTIONS method](https://kit.svelte.jp/docs/routing#server)`+server.js` ファイルでサポートされました。
201+
- [OPTIONS method](/docs/kit/routing#server)`+server.js` ファイルでサポートされました。
231202
- [別のファイルに属するものをエクスポート](https://github.com/sveltejs/kit/pull/9055)したときや、+layout.svelte に[slot を置くのを忘れた](https://github.com/sveltejs/kit/pull/8475)ときのエラーメッセージが改善されました。
232-
- [app.html でパブリックな環境変数にアクセス](https://kit.svelte.jp/docs/project-structure#project-files-src)できるようになりました
233-
- レスポンスを作成する新たな [text ヘルパー](https://kit.svelte.jp/docs/modules#sveltejs-kit-text)が追加されました
203+
- [app.html でパブリックな環境変数にアクセス](/docs/kit/project-structure#Project-files-src)できるようになりました
204+
- レスポンスを作成する新たな [text ヘルパー](/docs/kit/@sveltejs-kit#text)が追加されました
234205
- そしてたくさんのバグフィックス – リリースノートの全文については[changelog](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md)をご覧ください。
235-
=======
236-
- The [OPTIONS method](/docs/kit/routing#server) is now supported in `+server.js` files
237-
- Better error messages when you [export something that belongs in a different file](https://github.com/sveltejs/kit/pull/9055) or [forget to put a slot](https://github.com/sveltejs/kit/pull/8475) in your +layout.svelte.
238-
- You can now [access public environment variables in app.html](/docs/kit/project-structure#Project-files-src)
239-
- A new [text helper](/docs/kit/@sveltejs-kit#text) for creating responses
240-
- And a ton of bug fixes – see [the changelog](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md) for the full release notes.
241-
>>>>>>> sveltejs/main
242206

243207
SvelteKit にコントリビュートしてくれた皆様、SvelteKit をプロジェクトで使ってくださっている皆様、ありがとうございます。以前にもお伝えしましたが、Svelte はコミュニティプロジェクトであり、皆様のフィードバックやコントリビューションがなくては成り立たないものです。

0 commit comments

Comments
 (0)