This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.
⚠️⚠️⚠️⚠️⚠️⚠️
next is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on next.
⚠️⚠️⚠️⚠️⚠️⚠️
Releases
astro@5.0.0-beta.9
Minor Changes
#12067c48916c Thanks @stramel! - Adds experimental support for built-in SVG components.
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.
To enable this feature, set experimental.svg to true in your Astro config:
{
experimental: {
svg: true,
},
}
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:
---
import Logo from './path/to/svg/file.svg';
---
<Logo size={24} />
For a complete overview, and to give feedback on this experimental API, see the Feature RFC.
#123298309c61 Thanks @florian-lefebvre! - 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.
When building an integration, you can now get access to routes inside the astro:routes:resolved hook:
This hook runs before astro:config:done, and whenever a route changes in development.
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:
#12377af867f3 Thanks @ascorbic! - Adds experimental support for automatic responsive images
This feature is experimental and may change in future versions. To enable it, set experimental.responsiveImages to true in your astro.config.mjs file.
{
experimental: {
responsiveImages: true,
},
}
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.
---
import { Image, Picture } from 'astro:assets';
import myImage from '../assets/my_image.png';
---
<Image
src={myImage}
alt="A description of my image."
layout="responsive"
width={800}
height={600}
/>
<Picture
src={myImage}
alt="A description of my image."
layout="full-width"
formats={['avif', 'webp', 'jpeg']}
/>
This <Image /> component will generate the following HTML output:
These are additional properties available to the <Image /> and <Picture /> components when responsive images are enabled:
layout: The layout type for the image. Can be responsive, fixed, full-width or none. Defaults to value of image.experimentalLayout.
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.
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.
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.
Default responsive image settings
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.
Example:
{
image: {
// Used for all `<Image />` and `<Picture />` components unless overridden
experimentalLayout: 'responsive',
},
experimental: {
responsiveImages: true,
},
}
---
import { Image } from 'astro:assets';
import myImage from '../assets/my_image.png';
---
<Image src={myImage} alt="This will use responsive layout" width={800} height={600} />
<Image src={myImage} alt="This will use full-width layout" layout="full-width" />
<Image src={myImage} alt="This will disable responsive images" layout="none" />
For a complete overview, and to give feedback on this experimental API, see the Responsive Images RFC.
#124753f02d5f Thanks @ascorbic! - Changes the default content config location from src/content/config.* to src/content.config.*.
The previous location is still supported, and is required if the legacy.collections flag is enabled.
Patch Changes
#124244364bff Thanks @ematipico! - Fixes an issue where an incorrect usage of Astro actions was lost when porting the fix from v4 to v5
#12438c8f877c Thanks @ascorbic! - Fixes a bug where legacy content types were generated for content layer collections if they were in the content directory
@astrojs/preact@3.5.4-beta.0
Patch Changes
#124818a46e80 Thanks @marbrex! - Resolve vite peer dependency problem for strict package managers like Yarn in PnP mode.
@astrojs/react@3.6.3-beta.0
Patch Changes
#124818a46e80 Thanks @marbrex! - Resolve vite peer dependency problem for strict package managers like Yarn in PnP mode.
@astrojs/solid-js@4.4.4-beta.0
Patch Changes
#124818a46e80 Thanks @marbrex! - Resolve vite peer dependency problem for strict package managers like Yarn in PnP mode.
@astrojs/svelte@6.0.2-beta.0
Patch Changes
#124818a46e80 Thanks @marbrex! - Resolve vite peer dependency problem for strict package managers like Yarn in PnP mode.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.
⚠️⚠️⚠️⚠️⚠️⚠️
next
is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exit
onnext
.⚠️⚠️⚠️⚠️⚠️⚠️
Releases
astro@5.0.0-beta.9
Minor Changes
#12067
c48916c
Thanks @stramel! - Adds experimental support for built-in SVG components.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.
To enable this feature, set
experimental.svg
totrue
in your Astro config: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 equalheight
andwidth
properties:For a complete overview, and to give feedback on this experimental API, see the Feature RFC.
#12329
8309c61
Thanks @florian-lefebvre! - Adds a newastro:routes:resolved
hook to the Integration API. Also update theastro:build:done
hook by deprecatingroutes
and adding a newassets
map.When building an integration, you can now get access to routes inside the
astro:routes:resolved
hook:This hook runs before
astro:config:done
, and whenever a route changes in development.The
routes
array fromastro:build:done
is now deprecated, and exposed properties are now available onastro:routes:resolved
, except fordistURL
. For this, you can use the newly exposedassets
map:#12377
af867f3
Thanks @ascorbic! - Adds experimental support for automatic responsive imagesThis feature is experimental and may change in future versions. To enable it, set
experimental.responsiveImages
totrue
in yourastro.config.mjs
file.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 generatedsrcset
andsizes
attributes based on the image's dimensions and the layout type. Images withresponsive
andfull-width
layouts will have styles applied to ensure they resize according to their container.This
<Image />
component will generate the following HTML output:Responsive image properties
These are additional properties available to the
<Image />
and<Picture />
components when responsive images are enabled:layout
: The layout type for the image. Can beresponsive
,fixed
,full-width
ornone
. Defaults to value ofimage.experimentalLayout
.fit
: Defines how the image should be cropped if the aspect ratio is changed. Values match those of CSSobject-fit
. Defaults tocover
, or the value ofimage.experimentalObjectFit
if set.position
: Defines the position of the image crop if the aspect ratio is changed. Values match those of CSSobject-position
. Defaults tocenter
, or the value ofimage.experimentalObjectPosition
if set.priority
: If set, eagerly loads the image. Otherwise images will be lazy-loaded. Use this for your largest above-the-fold image. Defaults tofalse
.Default responsive image settings
You can enable responsive images for all
<Image />
and<Picture />
components by settingimage.experimentalLayout
with a default value. This can be overridden by thelayout
prop on each component.Example:
For a complete overview, and to give feedback on this experimental API, see the Responsive Images RFC.
#12475
3f02d5f
Thanks @ascorbic! - Changes the default content config location fromsrc/content/config.*
tosrc/content.config.*
.The previous location is still supported, and is required if the
legacy.collections
flag is enabled.Patch Changes
#12424
4364bff
Thanks @ematipico! - Fixes an issue where an incorrect usage of Astro actions was lost when porting the fix from v4 to v5#12438
c8f877c
Thanks @ascorbic! - Fixes a bug where legacy content types were generated for content layer collections if they were in the content directory@astrojs/preact@3.5.4-beta.0
Patch Changes
8a46e80
Thanks @marbrex! - Resolvevite
peer dependency problem for strict package managers like Yarn in PnP mode.@astrojs/react@3.6.3-beta.0
Patch Changes
8a46e80
Thanks @marbrex! - Resolvevite
peer dependency problem for strict package managers like Yarn in PnP mode.@astrojs/solid-js@4.4.4-beta.0
Patch Changes
8a46e80
Thanks @marbrex! - Resolvevite
peer dependency problem for strict package managers like Yarn in PnP mode.@astrojs/svelte@6.0.2-beta.0
Patch Changes
#12481
8a46e80
Thanks @marbrex! - Resolvevite
peer dependency problem for strict package managers like Yarn in PnP mode.Updated dependencies [
c48916c
,4364bff
,c8f877c
,8309c61
,af867f3
,3f02d5f
]:@astrojs/vue@5.0.0-beta.2
Patch Changes
8a46e80
Thanks @marbrex! - Resolvevite
peer dependency problem for strict package managers like Yarn in PnP mode.