Skip to content

Commit ff01d35

Browse files
authored
Merge branch 'next' into arpan-withastro#12252-mdx-islands
2 parents e63f5a2 + a2f90ce commit ff01d35

File tree

198 files changed

+4121
-1432
lines changed

Some content is hidden

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

198 files changed

+4121
-1432
lines changed

.changeset/blue-socks-doubt.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
'astro': minor
3+
---
4+
5+
Adds experimental support for built-in SVG components.
6+
7+
8+
This feature allows you to import SVG files directly into your Astro project as components. By default, Astro will inline the SVG content into your HTML output.
9+
10+
To enable this feature, set `experimental.svg` to `true` in your Astro config:
11+
12+
```js
13+
{
14+
experimental: {
15+
svg: true,
16+
},
17+
}
18+
```
19+
20+
To use this feature, import an SVG file in your Astro project, passing any common SVG attributes to the imported component. Astro also provides a `size` attribute to set equal `height` and `width` properties:
21+
22+
```astro
23+
---
24+
import Logo from './path/to/svg/file.svg';
25+
---
26+
27+
<Logo size={24} />
28+
```
29+
30+
For a complete overview, and to give feedback on this experimental API, see the [Feature RFC](https://github.com/withastro/roadmap/pull/1035).

.changeset/bright-keys-sell.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Fixes a bug where content config was ignored if it was outside of content dir and has a parent dir with an underscore

.changeset/eight-seahorses-attend.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Handle multiple root nodes on SVG files

.changeset/giant-ravens-look.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
'astro': minor
3+
---
4+
5+
Adds a new `astro:routes:resolved` hook to the Integration API. Also update the `astro:build:done` hook by deprecating `routes` and adding a new `assets` map.
6+
7+
When building an integration, you can now get access to routes inside the `astro:routes:resolved` hook:
8+
9+
```js
10+
const integration = () => {
11+
return {
12+
name: 'my-integration',
13+
hooks: {
14+
'astro:routes:resolved': ({ routes }) => {
15+
console.log(routes)
16+
}
17+
}
18+
}
19+
}
20+
```
21+
22+
This hook runs before `astro:config:done`, and whenever a route changes in development.
23+
24+
The `routes` array from `astro:build:done` is now deprecated, and exposed properties are now available on `astro:routes:resolved`, except for `distURL`. For this, you can use the newly exposed `assets` map:
25+
26+
```diff
27+
const integration = () => {
28+
+ let routes
29+
return {
30+
name: 'my-integration',
31+
hooks: {
32+
+ 'astro:routes:resolved': (params) => {
33+
+ routes = params.routes
34+
+ },
35+
'astro:build:done': ({
36+
- routes
37+
+ assets
38+
}) => {
39+
+ for (const route of routes) {
40+
+ const distURL = assets.get(route.pattern)
41+
+ if (distURL) {
42+
+ Object.assign(route, { distURL })
43+
+ }
44+
+ }
45+
console.log(routes)
46+
}
47+
}
48+
}
49+
}
50+
```

.changeset/pre.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@
3434
"afraid-apricots-buy",
3535
"blue-boats-relax",
3636
"blue-sloths-stare",
37+
"blue-socks-doubt",
3738
"brave-elephants-fly",
3839
"breezy-colts-promise",
40+
"bright-keys-sell",
41+
"brown-bulldogs-share",
3942
"chatty-teachers-sit",
4043
"chilly-terms-know",
4144
"clean-camels-drive",
4245
"clean-donuts-walk",
46+
"clean-moles-rest",
4347
"cold-bananas-hear",
4448
"cool-mangos-shop",
4549
"cuddly-shoes-press",
@@ -49,6 +53,7 @@
4953
"dry-worms-knock",
5054
"dull-moles-talk",
5155
"eight-days-sort",
56+
"eight-seahorses-attend",
5257
"eighty-bags-cross",
5358
"eighty-boxes-applaud",
5459
"eighty-donkeys-fly",
@@ -61,6 +66,7 @@
6166
"funny-wolves-dream",
6267
"fuzzy-pugs-live",
6368
"gentle-scissors-bow",
69+
"giant-ravens-look",
6470
"giant-rocks-thank",
6571
"gorgeous-foxes-divide",
6672
"healthy-ads-scream",
@@ -95,13 +101,17 @@
95101
"poor-seals-clap",
96102
"pretty-walls-camp",
97103
"proud-games-repair",
104+
"proud-terms-swim",
98105
"quick-ads-exercise",
99106
"quick-onions-leave",
107+
"red-paws-juggle",
108+
"rotten-dodos-judge",
100109
"rotten-phones-scream",
101110
"selfish-cats-crash",
102111
"selfish-impalas-grin",
103112
"sharp-worms-sniff",
104113
"sixty-coins-worry",
114+
"sixty-fishes-flow",
105115
"sixty-oranges-walk",
106116
"slimy-mice-dance",
107117
"slimy-queens-hang",
@@ -116,14 +126,17 @@
116126
"tame-rats-cross",
117127
"ten-students-repair",
118128
"ten-walls-tap",
129+
"thirty-clocks-jump",
119130
"three-days-cough",
120131
"three-olives-reflect",
121132
"tough-planets-dress",
122133
"twelve-comics-march",
123134
"twenty-cobras-push",
124135
"unlucky-bobcats-sit",
136+
"unlucky-kids-compete",
125137
"violet-goats-grab",
126138
"wet-foxes-walk",
127-
"wise-carrots-float"
139+
"wise-carrots-float",
140+
"young-terms-hammer"
128141
]
129142
}

.changeset/proud-terms-swim.md

+87-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,90 @@
11
---
2-
'astro': patch
2+
'astro': minor
33
---
44

5-
Adds experimental reponsive image support
5+
Adds experimental support for automatic responsive images
6+
7+
This feature is experimental and may change in future versions. To enable it, set `experimental.responsiveImages` to `true` in your `astro.config.mjs` file.
8+
9+
```js title=astro.config.mjs
10+
{
11+
experimental: {
12+
responsiveImages: true,
13+
},
14+
}
15+
```
16+
17+
When this flag is enabled, you can pass a `layout` prop to any `<Image />` or `<Picture />` component to create a responsive image. When a layout is set, images have automatically generated `srcset` and `sizes` attributes based on the image's dimensions and the layout type. Images with `responsive` and `full-width` layouts will have styles applied to ensure they resize according to their container.
18+
19+
```astro
20+
---
21+
import { Image, Picture } from 'astro:assets';
22+
import myImage from '../assets/my_image.png';
23+
---
24+
<Image src={myImage} alt="A description of my image." layout='responsive' width={800} height={600} />
25+
<Picture src={myImage} alt="A description of my image." layout='full-width' formats={['avif', 'webp', 'jpeg']} />
26+
```
27+
This `<Image />` component will generate the following HTML output:
28+
```html title=Output
29+
30+
<img
31+
src="/_astro/my_image.hash3.webp"
32+
srcset="/_astro/my_image.hash1.webp 640w,
33+
/_astro/my_image.hash2.webp 750w,
34+
/_astro/my_image.hash3.webp 800w,
35+
/_astro/my_image.hash4.webp 828w,
36+
/_astro/my_image.hash5.webp 1080w,
37+
/_astro/my_image.hash6.webp 1280w,
38+
/_astro/my_image.hash7.webp 1600w"
39+
alt="A description of my image"
40+
sizes="(min-width: 800px) 800px, 100vw"
41+
loading="lazy"
42+
decoding="async"
43+
fetchpriority="auto"
44+
width="800"
45+
height="600"
46+
style="--w: 800; --h: 600; --fit: cover; --pos: center;"
47+
data-astro-image="responsive"
48+
>
49+
```
50+
51+
#### Responsive image properties
52+
53+
These are additional properties available to the `<Image />` and `<Picture />` components when responsive images are enabled:
54+
55+
- `layout`: The layout type for the image. Can be `responsive`, `fixed`, `full-width` or `none`. Defaults to value of `image.experimentalLayout`.
56+
- `fit`: Defines how the image should be cropped if the aspect ratio is changed. Values match those of CSS `object-fit`. Defaults to `cover`, or the value of `image.experimentalObjectFit` if set.
57+
- `position`: Defines the position of the image crop if the aspect ratio is changed. Values match those of CSS `object-position`. Defaults to `center`, or the value of `image.experimentalObjectPosition` if set.
58+
- `priority`: If set, eagerly loads the image. Otherwise images will be lazy-loaded. Use this for your largest above-the-fold image. Defaults to `false`.
59+
60+
#### Default responsive image settings
61+
62+
You can enable responsive images for all `<Image />` and `<Picture />` components by setting `image.experimentalLayout` with a default value. This can be overridden by the `layout` prop on each component.
63+
64+
**Example:**
65+
```js title=astro.config.mjs
66+
{
67+
image: {
68+
// Used for all `<Image />` and `<Picture />` components unless overridden
69+
experimentalLayout: 'responsive',
70+
},
71+
experimental: {
72+
responsiveImages: true,
73+
},
74+
}
75+
```
76+
77+
```astro
78+
---
79+
import { Image } from 'astro:assets';
80+
import myImage from '../assets/my_image.png';
81+
---
82+
83+
<Image src={myImage} alt="This will use responsive layout" width={800} height={600} />
84+
85+
<Image src={myImage} alt="This will use full-width layout" layout="full-width" />
86+
87+
<Image src={myImage} alt="This will disable responsive images" layout="none" />
88+
```
89+
90+
For a complete overview, and to give feedback on this experimental API, see the [Responsive Images RFC](https://github.com/withastro/roadmap/blob/responsive-images/proposals/0053-responsive-images.md).

.changeset/red-paws-juggle.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Fix SVG Component sprite references

.changeset/rotten-dodos-judge.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Call server island early so it can set headers

.changeset/sixty-fishes-flow.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@astrojs/react': minor
3+
'astro': minor
4+
---
5+
6+
Changes the generated URL query param from `_astroAction` to `_action` when submitting a form using Actions. This avoids leaking the framework name into the URL bar, which may be considered a security issue.

.changeset/thirty-clocks-jump.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'astro': minor
3+
---
4+
5+
Changes the default content config location from `src/content/config.*` to `src/content.config.*`.
6+
7+
The previous location is still supported, and is required if the `legacy.collections` flag is enabled.

.changeset/young-terms-hammer.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/mdx': patch
3+
---
4+
5+
Fixes a case where the MDX renderer couldn't be loaded when used as a direct dependency of an Astro integration.

.github/scripts/announce.mjs

+34-34
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { globby as glob } from 'globby';
2-
import { fileURLToPath } from 'node:url';
31
import { readFile } from 'node:fs/promises';
2+
import { fileURLToPath } from 'node:url';
3+
import { globby as glob } from 'globby';
44
import { setOutput } from './utils.mjs';
55

66
const { GITHUB_REF = 'main' } = process.env;
@@ -18,34 +18,34 @@ const descriptors = [
1818
'updates',
1919
];
2020
const verbs = [
21-
"just went out!",
22-
"just launched!",
23-
"now available!",
24-
"in the wild!",
25-
"now live!",
26-
"hit the registry!",
27-
"to share!",
28-
"for you!",
29-
"for y’all! 🤠",
30-
"comin’ your way!",
31-
"comin’ atcha!",
32-
"comin’ in hot!",
33-
"freshly minted on the blockchain! (jk)",
34-
"[is] out (now with 100% more reticulated splines!)",
35-
"(as seen on TV!)",
36-
"just dropped!",
37-
"– artisanally hand-crafted just for you.",
38-
"– oh happy day!",
39-
"– enjoy!",
40-
"now out. Be the first on your block to download!",
41-
"made with love 💕",
42-
"[is] out! Our best [version] yet!",
43-
"[is] here. DOWNLOAD! DOWNLOAD! DOWNLOAD!",
44-
"... HUZZAH!",
45-
"[has] landed!",
46-
"landed! The internet just got a little more fun.",
47-
"– from our family to yours.",
48-
"– go forth and build!"
21+
'just went out!',
22+
'just launched!',
23+
'now available!',
24+
'in the wild!',
25+
'now live!',
26+
'hit the registry!',
27+
'to share!',
28+
'for you!',
29+
'for y’all! 🤠',
30+
'comin’ your way!',
31+
'comin’ atcha!',
32+
'comin’ in hot!',
33+
'freshly minted on the blockchain! (jk)',
34+
'[is] out (now with 100% more reticulated splines!)',
35+
'(as seen on TV!)',
36+
'just dropped!',
37+
'– artisanally hand-crafted just for you.',
38+
'– oh happy day!',
39+
'– enjoy!',
40+
'now out. Be the first on your block to download!',
41+
'made with love 💕',
42+
'[is] out! Our best [version] yet!',
43+
'[is] here. DOWNLOAD! DOWNLOAD! DOWNLOAD!',
44+
'... HUZZAH!',
45+
'[has] landed!',
46+
'landed! The internet just got a little more fun.',
47+
'– from our family to yours.',
48+
'– go forth and build!',
4949
];
5050
const extraVerbs = [
5151
'new',
@@ -72,7 +72,7 @@ const plurals = new Map([
7272

7373
function pluralize(text) {
7474
return text.replace(/(\[([^\]]+)\])/gm, (_, _full, match) =>
75-
plurals.has(match) ? plurals.get(match) : `${match}s`
75+
plurals.has(match) ? plurals.get(match) : `${match}s`,
7676
);
7777
}
7878

@@ -91,7 +91,7 @@ async function generatePackageMap() {
9191
const pkgFile = fileURLToPath(new URL(pkg, packageRoot));
9292
const content = await readFile(pkgFile).then((res) => JSON.parse(res.toString()));
9393
packageMap.set(content.name, `./packages/${pkg.replace('/package.json', '')}`);
94-
})
94+
}),
9595
);
9696
}
9797

@@ -110,7 +110,7 @@ async function generateMessage() {
110110
version,
111111
url: new URL(`${p}/CHANGELOG.md#${version.replace(/\./g, '')}`, baseUrl).toString(),
112112
};
113-
})
113+
}),
114114
);
115115

116116
const emoji = item(emojis);
@@ -122,7 +122,7 @@ async function generateMessage() {
122122
if (packages.length === 1) {
123123
const { name, version, url } = packages[0];
124124
message += `${emoji} \`${name}@${version}\` ${singularlize(
125-
verb
125+
verb,
126126
)}\nRead the [release notes →](<${url}>)\n`;
127127
} else {
128128
message += `${emoji} Some ${descriptor} ${pluralize(verb)}\n\n`;

0 commit comments

Comments
 (0)