Skip to content

Commit 1342343

Browse files
authored
Merge branch 'v3-upgrade-guide' into i18n-ja-install-v3
2 parents c108577 + 585d2ad commit 1342343

28 files changed

Lines changed: 118 additions & 61 deletions

File tree

src/components/LeftSidebar/Sponsors.astro

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@ import UIString from '../UIString.astro';
44

55
<div dir="ltr" lang="en" class="sponsors">
66
<h2 class="sponsors-title"><UIString key="leftSidebar.sponsoredBy" /></h2>
7-
<a href="https://www.netlify.com/" aria-label="Netlify">
8-
<svg xmlns="http://www.w3.org/2000/svg" width="105" viewBox="0 0 256 105" aria-hidden="true">
9-
<path
10-
fill="#32E6E2"
11-
d="M58.5 103.8V77.4l.5-.5h6.6l.6.5v26.4l-.6.5H59l-.5-.5Zm0-76.9V.5L59 0h6.6l.6.5V27l-.6.5H59l-.5-.5ZM35.8 85.2h-1l-4.4-4.5v-.9l8.5-8.5h4.7l.7.6v4.8l-8.5 8.5Zm-5.4-60.5v-.9l4.5-4.5h.9l8.5 8.5v4.8l-.7.6H39l-8.5-8.5ZM.5 48.3H38l.5.6v6.6l-.5.5H.5l-.5-.5v-6.6l.5-.6Zm255 0 .5.6v6.6l-.6.5h-37.8l-.6-.5 2.8-6.6.5-.6h35.1Z"
12-
></path>
13-
<path
14-
d="M74.7 65.9H68l-.6-.6V50c0-2.7-1-4.9-4.4-5-1.7 0-3.6 0-5.7.2l-.3.3v20l-.6.5H50l-.6-.6V39l.6-.6h14.8c5.7 0 10.4 4.7 10.4 10.5v16.4l-.5.6Zm31.9-11.6-.6.6H89l-.6.5c0 1.1 1.1 4.4 5.5 4.4 1.7 0 3.3-.5 3.9-1.6l.5-.6h6.6l.6.6c-.6 3.3-3.3 8.2-11.6 8.2-9.3 0-13.7-6.6-13.7-14.3S84.6 38 93.4 38s13.2 6.6 13.2 14.2v2.2ZM98.3 49c0-.6-.5-4.4-5-4.4s-4.9 3.8-4.9 4.4l.6.5h8.8l.5-.5Zm23.7 8.7c0 1.1.5 1.7 1.6 1.7h5l.5.5v5.5l-.6.6h-4.9c-5 0-9.3-2.2-9.3-8.3v-12l-.6-.6H110l-.6-.5V39l.6-.6h3.8l.6-.5v-5l.5-.5h6.6l.5.5v5l.6.5h6l.6.6v5.5l-.6.5h-6l-.6.6v12Zm20.3 8.3h-6.6l-.6-.6V28l.6-.6h6.6l.5.6v37.3l-.5.6ZM157 34h-6.6l-.5-.5V28l.5-.6h6.6l.6.6v5.5l-.6.5Zm0 31.9h-6.6l-.5-.6V39l.5-.6h6.6l.6.6v26.3l-.6.6Zm25.8-38v5.6l-.5.5h-5c-1 0-1.6.6-1.6 1.7v2.2l.5.5h5.5l.6.6v5.5l-.6.5h-5.5l-.5.6v19.7l-.6.6h-6.5l-.6-.6V45.5l-.5-.5h-3.9l-.5-.5V39l.5-.6h3.9l.5-.5v-2.2c0-6 4.4-8.3 9.4-8.3h4.9l.5.6Zm20.3 38.5c-2.2 5.5-4.3 8.8-12 8.8h-2.8l-.5-.5v-5.5l.5-.6h2.8c2.7 0 3.3-.5 3.8-2.2V66l-8.8-21.4V39l.6-.6h5l.5.6 6.5 18.7h.6L206 39l.5-.6h5l.5.6v5.5l-8.8 22Z"
15-
></path>
7+
<a href="https://vercel.com/" aria-label="Vercel">
8+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 284 65" width="95" aria-hidden="true">
9+
<path d="M141.7 16.3c-11 0-19 7.1-19 18s9 18 20 18c6.7 0 12.5-2.7 16.2-7.1l-7.7-4.5c-2 2.2-5 3.5-8.5 3.5-4.8 0-8.9-2.5-10.4-6.5h28c.3-1 .4-2.2.4-3.5 0-10.8-8-18-19-18zm-9.5 14.4c1.3-4 4.7-6.4 9.5-6.4s8.2 2.5 9.4 6.4h-18.9zm117.2-14.4c-11 0-19 7.1-19 18s9 18 20 18a21 21 0 0 0 16.2-7.1l-7.7-4.5c-2 2.2-5 3.5-8.5 3.5-4.8 0-8.9-2.5-10.4-6.5h28c.2-1 .4-2.2.4-3.5 0-10.8-8-18-19-18zm-9.5 14.4c1.3-4 4.7-6.4 9.5-6.4s8.2 2.5 9.4 6.4H240zm-39 3.6c0 6 3.9 10 10 10 4.1 0 7.2-2 8.8-5l7.7 4.5a18.5 18.5 0 0 1-16.5 8.5c-11 0-19-7.2-19-18s8-18 19-18c7.3 0 13.3 3.1 16.5 8.4l-7.7 4.5c-1.6-3-4.7-5-8.8-5-6 0-10 4-10 10zm82.5-29v46h-9v-46h9zM37.6.3l37 64H.5l37-64zm92.4 5-27.7 48-27.8-48H85l17.4 30 17.3-30H130zm58.9 12v9.6c-1-.3-2-.5-3.2-.5-5.8 0-10 4-10 10v14.9h-9v-34h9v9.1c0-5 5.9-9.1 13.2-9.1z"/>
1610
</svg>
1711
</a>
1812
<a href="https://www.storyblok.com/" aria-label="Storyblok">

src/content/docs/ar/getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
8181

8282
## انضم إلى مجتمعنا
8383

84-
انضم إلى مجتمع [أسترو على ديسكورد](https://astro.build/chat/) للمشاركة والحصول على المساعدة من مجتمع نشط وودود!
84+
انضم إلى مجتمع [أسترو على ديسكورد](https://astro.build/chat) للمشاركة والحصول على المساعدة من مجتمع نشط وودود!
8585

8686
💬 رحّب وعرف بنفسك على قناة `#general`!
8787

src/content/docs/de/getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Sieh dir Beispiele zu einigen grundlegenden Konzepten und Strukturen einer Astro
9292

9393
## Werde Teil unserer Community
9494

95-
Tritt dem [Astro-Discord](https://astro.build/chat/) bei, um deine Erfahrungen und Fragen rund um Astro mit unserer aktiven, freundlichen Community zu teilen!
95+
Tritt dem [Astro-Discord](https://astro.build/chat) bei, um deine Erfahrungen und Fragen rund um Astro mit unserer aktiven, freundlichen Community zu teilen!
9696

9797
💬 Stell dich im Kanal `#general` vor!
9898

src/content/docs/en/getting-started.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import TranslatorList from '~/components/TranslatorList.astro'
88
import ContributorList from '~/components/ContributorList.astro'
99
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
1010

11+
{/* TODO: Replace with 3.0 tip on 30 August 2023. */}
12+
:::tip[Hello Astronauts!]
13+
Our new docs theme [Starlight is on Product Hunt today](https://www.producthunt.com/posts/starlight-by-astro).
14+
:::
15+
1116
<h2>What is Astro?</h2>
1217

1318
Astro is an **all-in-one** **web framework** for building **fast,** **content-focused** websites.
@@ -88,7 +93,7 @@ See examples of some of the key concepts and patterns of an Astro site!
8893

8994
## Join our Community
9095

91-
Join us in the [Astro Discord](https://astro.build/chat/) to share with and get help from an active, friendly community!
96+
Join us in the [Astro Discord](https://astro.build/chat) to share with and get help from an active, friendly community!
9297

9398
💬 Say hi in our `#general` channel!
9499

src/content/docs/en/guides/styling.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ import MyComponent from "../components/MyComponent.astro"
159159
<MyComponent class="red">This will be red!</MyComponent>
160160
```
161161

162-
This pattern lets you style child components directly. Astro will pass the parent’s scoped class name (e.g. `astro-hhnqfkh6`) through the `class` prop automatically, including the child in its parent’s scope.
163-
162+
This pattern lets you style child components directly. Astro will pass the parent’s scoped class name (e.g. `astro-hhnqfkh6`) through the `class` prop automatically, including the child in its parent’s scope. Note this pattern only works when your [`scopedStyleStrategy` option](/en/reference/configuration-reference/#scopedstylestrategy) is either `'where'` or `'class'`.
164163
:::note[Scoped classes from parent components]
165164
Because the `class` prop includes the child in its parent’s scope, it is possible for styles to cascade from parent to child. To avoid this having unintended side effects, ensure you use unique class names in the child component.
166165
:::

src/content/docs/en/guides/upgrade-to/v3.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ If you are continuing to use v1.x APIs, use the new APIs for each feature instea
182182

183183
### Removed: `image` from `astro:content` in content collections schema
184184

185-
In Astro 2.x, the content collections API deprecated an `image` export from `astro:content` for use in your content collections schemas.
185+
In Astro v2.x, the content collections API deprecated an `image` export from `astro:content` for use in your content collections schemas.
186186

187-
Astro 3.0 removes this export entirely.
187+
Astro v3.0 removes this export entirely.
188188

189189
#### What should I do?
190190

@@ -263,7 +263,7 @@ const { class: className } = Astro.props;
263263

264264
In Astro v2.x, camelCase [CSS variables](/en/guides/styling/#css-variables) passed to the `style` attribute were rendered as both camelCase (as written) and kebab-case (kept for backwards compatibility).
265265

266-
Astro 3.0 removes the kebab-case transform for these camelCase CSS variable names, and only the original camelCase CSS variable is rendered.
266+
Astro v3.0 removes the kebab-case transform for these camelCase CSS variable names, and only the original camelCase CSS variable is rendered.
267267

268268
```astro "my-value"
269269
---
@@ -380,7 +380,7 @@ export async function GET() {
380380
}
381381
```
382382

383-
If you really need to keep previous format, you can use the `ResponseWithEncoding` object, but will be depricated in the future.
383+
If you really need to keep the previous format, you can use the `ResponseWithEncoding` object but will be deprecated in the future.
384384

385385
```ts title="endpoint.json.ts" del={2} ins={3}
386386
export async function GET() {

src/content/docs/en/reference/adapter-reference.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,18 @@ export default function createIntegration() {
358358
The `entryFile` is of type `URL` and represents the physical path of the file in the file system. This means that the paths change based on the OS where the code runs.
359359
:::
360360

361+
#### Serverless environments
362+
363+
Setting `functionPerRoute: true` in a serverless environment creates a JavaScript file (handler) for each route. A handler might have different names based on your hosting platform: lambda, function, page, etc.
364+
365+
Each of these routes is subject to a [cold start](https://azure.microsoft.com/en-us/blog/understanding-serverless-cold-start/) when the handler runs, which may cause some delay. This delay is influenced by different factors.
366+
367+
With `functionPerRoute: false`, there is only one single handler in charge of rendering all your routes. When this handler is first triggered, you will be subject to a cold start. Then, all other routes should function without delay. However, you will lose the benefit of code splitting that `functionPerRoute: true` provides.
368+
369+
:::note
370+
It's important that you understand your hosting platform, and how it works, in order to choose the appropriate `functionPerRoute` configuration for your project.
371+
:::
372+
361373
### `edgeMiddleware`
362374

363375
Defines whether any SSR middleware code will be bundled when built.

src/content/docs/en/reference/configuration-reference.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Specify the strategy used for scoping styles within Astro components. Choose fro
275275

276276
Using `'class'` is helpful when you want to ensure that element selectors within an Astro component override global style defaults (e.g. from a global stylesheet).
277277
Using `'where'` gives you more control over specifity, but requires that you use higher-specifity selectors, layers, and other tools to control which selectors are applied.
278-
Using 'attribute' is useful when you are manipulating the `class` attribute of elements and need to avoid conflicts between your own styling logic and Astro's application of styles.
278+
Using `'attribute'` is useful when you are manipulating the `class` attribute of elements and need to avoid conflicts between your own styling logic and Astro's application of styles.
279279

280280

281281
### adapter

src/content/docs/en/reference/publish-to-npm.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ If you are extracting components from an existing project, you can even continue
229229

230230
## Testing your component
231231

232-
Astro does not currently ship a test runner. _(If you are interested in helping out with this, [join us on Discord!](https://astro.build/chat/))_
232+
Astro does not currently ship a test runner. _(If you are interested in helping out with this, [join us on Discord!](https://astro.build/chat))_
233233

234234
In the meantime, our current recommendation for testing is:
235235

@@ -284,4 +284,4 @@ In addition to the required `astro-component` or `withastro` keyword, special ke
284284

285285
## Share
286286

287-
We encourage you to share your work, and we really do love seeing what our talented Astronauts create. Come and share what you create with us in our [Discord](https://astro.build/chat/) or mention [@astrodotbuild](https://twitter.com/astrodotbuild) in a Tweet!
287+
We encourage you to share your work, and we really do love seeing what our talented Astronauts create. Come and share what you create with us in our [Discord](https://astro.build/chat) or mention [@astrodotbuild](https://twitter.com/astrodotbuild) in a Tweet!

src/content/docs/en/tutorial/5-astro-api/3.mdx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ You have previously displayed items in a list from an array using `map()`. What
9090
```astro title="src/pages/tags/index.astro"
9191
---
9292
import BaseLayout from '../../layouts/BaseLayout.astro';
93-
const tags = ["astro", "successes", "community", "setbacks", "learning in public"];
93+
const allPosts = await Astro.glob("../posts/*.md");
94+
const tags = [...new Set(allPosts.map((post) => post.frontmatter.tags).flat())];
9495
const pageTitle = "Tag Index";
9596
---
9697
<BaseLayout pageTitle={pageTitle}>
@@ -182,7 +183,6 @@ Instead of creating items in an unordered list this time, create one `<p>` for e
182183
.tags {
183184
display: flex;
184185
flex-wrap: wrap;
185-
margin: 0 auto;
186186
}
187187
188188
.tag {
@@ -224,7 +224,6 @@ const pageTitle = "Tag Index";
224224
.tags {
225225
display: flex;
226226
flex-wrap: wrap;
227-
margin: 0 auto;
228227
}
229228
230229
.tag {
@@ -295,7 +294,6 @@ Follow the steps below, then check your work by comparing it to the [final code
295294
.tags {
296295
display: flex;
297296
flex-wrap: wrap;
298-
margin: 0 auto;
299297
}
300298
301299
.tag {
@@ -370,7 +368,6 @@ const { frontmatter } = Astro.props;
370368
.tags {
371369
display: flex;
372370
flex-wrap: wrap;
373-
margin: 0 auto;
374371
}
375372
376373
.tag {

0 commit comments

Comments
 (0)