Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/bright-bulldogs-heal.md

This file was deleted.

34 changes: 34 additions & 0 deletions .changeset/cozy-masks-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
'astro': minor
---

Adds support for returning a Promise from the `parser()` option of the `file()` loader

This enables you to run asynchronous code such as fetching remote data or using async parsers when loading files with the Content Layer API.

For example:

```js
import { defineCollection } from 'astro:content';
import { file } from 'astro/loaders';

const blog = defineCollection({
loader: file('src/data/blog.json', {
parser: async (text) => {
const data = JSON.parse(text);

// Perform async operations like fetching additional data
const enrichedData = await fetch(`https://api.example.com/enrich`, {
method: 'POST',
body: JSON.stringify(data),
}).then(res => res.json());

return enrichedData;
},
}),
});

export const collections = { blog };
```

See [the `parser()` reference documentation](https://docs.astro.build/en/reference/content-loader-reference/#parser) for more information.
23 changes: 23 additions & 0 deletions .changeset/four-pots-see.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'astro': minor
---

Adds a new, optional `kernel` configuration option to select a resize algorithm in the Sharp image service

By default, Sharp resizes images with the `lanczos3` kernel. This new config option allows you to set the default resizing algorithm to any resizing option supported by [Sharp](https://sharp.pixelplumbing.com/api-resize/#resize) (e.g. `linear`, `mks2021`).

Kernel selection can produce quite noticeable differences depending on various characteristics of the source image - especially drawn art - so changing the kernel gives you more control over the appearance of images on your site:

```js
export default defineConfig({
image: {
service: {
entrypoint: 'astro/assets/services/sharp',
config: {
kernel: "mks2021"
}
}
})
```

This selection will apply to all images on your site, and is not yet configurable on a per-image basis. For more information, see [Sharps documentation on resizing images](https://sharp.pixelplumbing.com/api-resize/#resize).
5 changes: 0 additions & 5 deletions .changeset/lazy-bees-repair.md

This file was deleted.

18 changes: 18 additions & 0 deletions .changeset/nine-olives-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'astro': minor
---

Adds a new `partitioned` option when setting a cookie to allow creating partitioned cookies.

[Partitioned cookies](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies) can only be read within the context of the top-level site on which they were set. This allows cross-site tracking to be blocked, while still enabling legitimate uses of third-party cookies.

You can create a partitioned cookie by passing `partitioned: true` when setting a cookie. Note that partitioned cookies must also be set with `secure: true`:

```js
Astro.cookies.set('my-cookie', 'value', {
partitioned: true,
secure: true,
});
```

For more information, see the [`AstroCookieSetOptions` API reference](https://docs.astro.build/en/reference/api-reference/#astrocookiesetoptions).
26 changes: 26 additions & 0 deletions .changeset/olive-crabs-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
'astro': minor
---

Adds a new `retainBody` option to the `glob()` loader to allow reducing the size of the data store.

Currently, the `glob()` loader stores the raw body of each content file in the entry, in addition to the rendered HTML.

The `retainBody` option defaults to `true`, but you can set it to `false` to prevent the raw body of content files from being stored in the data store. This significantly reduces the deployed size of the data store and helps avoid hitting size limits for sites with very large collections.

The rendered body will still be available in the `entry.rendered.html` property for markdown files, and the `entry.filePath` property will still point to the original file.

```js
import { defineCollection } from 'astro:content';
import { glob } from 'astro/loaders';

const blog = defineCollection({
loader: glob({
pattern: '**/*.md',
base: './src/content/blog',
retainBody: false
}),
});
```

When `retainBody` is `false`, `entry.body` will be `undefined` instead of containing the raw file contents.
23 changes: 23 additions & 0 deletions .changeset/shaky-bananas-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'astro': minor
---

Adds a new `background` property to the `<Image />` component.

This optional property lets you pass a background color to flatten the image with. By default, Sharp uses a black background when flattening an image that is being converted to a format that does not support transparency (e.g. `jpeg`). Providing a value for `background` on an `<Image />` component, or passing it to the `getImage()` helper, will flatten images using that color instead.

This is especially useful when the requested output format doesn't support an alpha channel (e.g. `jpeg`) and can't support transparent backgrounds.

```astro
---
import { Image } from 'astro:assets';
---
<Image
src="/transparent.png"
alt="A JPEG with a white background!"
format="jpeg"
background="#ffffff"
/>
```

See more about this new property in [the image reference docs](https://docs.astro.build/en/reference/modules/astro-assets/#background)
20 changes: 20 additions & 0 deletions .changeset/tidy-moles-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'astro': minor
---

Adds optional `placement` config option for the dev toolbar.

You can now configure the default toolbar position (`'bottom-left'`, `'bottom-center'`, or `'bottom-right'`) via `devToolbar.placement` in your Astro config. This option is helpful for sites with UI elements (chat widgets, cookie banners) that are consistently obscured by the toolbar in the dev environment.

You can set a project default that is consistent across environments (e.g. dev machines, browser instances, team members):

```js
// astro.config.mjs
export default defineConfig({
devToolbar: {
placement: 'bottom-left',
},
});
```

User preferences from the toolbar UI (stored in `localStorage`) still take priority, so this setting can be overridden in individual situations as necessary.
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.16.15"
"astro": "^5.16.16"
}
}
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@astrojs/mdx": "^4.3.13",
"@astrojs/rss": "^4.0.15",
"@astrojs/sitemap": "^3.7.0",
"astro": "^5.16.15",
"astro": "^5.16.16",
"sharp": "^0.34.3"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^5.16.15"
"astro": "^5.16.16"
},
"peerDependencies": {
"astro": "^4.0.0 || ^5.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/container-with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/react": "^4.4.2",
"astro": "^5.16.15",
"astro": "^5.16.16",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vitest": "^3.2.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"@astrojs/alpinejs": "^0.4.9",
"@types/alpinejs": "^3.13.11",
"alpinejs": "^3.15.4",
"astro": "^5.16.15"
"astro": "^5.16.16"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@astrojs/vue": "^5.1.4",
"@types/react": "^18.3.27",
"@types/react-dom": "^18.3.7",
"astro": "^5.16.15",
"astro": "^5.16.16",
"preact": "^10.28.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@astrojs/preact": "^4.1.3",
"@preact/signals": "^2.5.1",
"astro": "^5.16.15",
"astro": "^5.16.16",
"preact": "^10.28.2"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@astrojs/react": "^4.4.2",
"@types/react": "^18.3.27",
"@types/react-dom": "^18.3.7",
"astro": "^5.16.15",
"astro": "^5.16.16",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^5.1.3",
"astro": "^5.16.15",
"astro": "^5.16.16",
"solid-js": "^1.9.10"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@astrojs/svelte": "^7.2.5",
"astro": "^5.16.15",
"astro": "^5.16.16",
"svelte": "^5.46.1"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@astrojs/vue": "^5.1.4",
"astro": "^5.16.15",
"astro": "^5.16.16",
"vue": "^3.5.26"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
},
"dependencies": {
"@astrojs/node": "^9.5.2",
"astro": "^5.16.15"
"astro": "^5.16.16"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^5.16.15"
"astro": "^5.16.16"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.16.15"
"astro": "^5.16.16"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.16.15"
"astro": "^5.16.16"
}
}
2 changes: 1 addition & 1 deletion examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/node": "^9.5.2",
"@astrojs/svelte": "^7.2.5",
"astro": "^5.16.15",
"astro": "^5.16.16",
"svelte": "^5.46.1"
}
}
2 changes: 1 addition & 1 deletion examples/starlog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.16.15",
"astro": "^5.16.16",
"sass": "^1.97.2",
"sharp": "^0.34.3"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/toolbar-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
},
"devDependencies": {
"@types/node": "^18.17.8",
"astro": "^5.16.15"
"astro": "^5.16.16"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.15.10",
"astro": "^5.16.15"
"astro": "^5.16.16"
}
}
2 changes: 1 addition & 1 deletion examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@astrojs/mdx": "^4.3.13",
"@astrojs/preact": "^4.1.3",
"astro": "^5.16.15",
"astro": "^5.16.16",
"preact": "^10.28.2"
}
}
2 changes: 1 addition & 1 deletion examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@astrojs/preact": "^4.1.3",
"@nanostores/preact": "^0.5.2",
"astro": "^5.16.15",
"astro": "^5.16.16",
"nanostores": "^0.11.4",
"preact": "^10.28.2"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@astrojs/mdx": "^4.3.13",
"@tailwindcss/vite": "^4.1.18",
"@types/canvas-confetti": "^1.9.0",
"astro": "^5.16.15",
"astro": "^5.16.16",
"canvas-confetti": "^1.9.4",
"tailwindcss": "^4.1.18"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^5.16.15",
"astro": "^5.16.16",
"vitest": "^3.2.4"
}
}
10 changes: 10 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# astro

## 5.16.16

### Patch Changes

- [#15281](https://github.com/withastro/astro/pull/15281) [`a1b80c6`](https://github.com/withastro/astro/commit/a1b80c65e5dddefba7ada20c7ccfdab26fb4e16b) Thanks [@matthewp](https://github.com/matthewp)! - Ensures server island requests carry an encrypted component export identifier so they do not accidentally resolve to the wrong component.

- [#15304](https://github.com/withastro/astro/pull/15304) [`02ee3c7`](https://github.com/withastro/astro/commit/02ee3c745297203c38ee013b500126b15f7e5fc9) Thanks [@cameronapak](https://github.com/cameronapak)! - Fix: Remove await from getActionResult example

- [#15324](https://github.com/withastro/astro/pull/15324) [`ab41c3e`](https://github.com/withastro/astro/commit/ab41c3e789b821e9179d11d67f453ba955448be6) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes an issue where certain unauthorized links could be rendered as clickable in the error overlay

## 5.16.15

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro",
"version": "5.16.15",
"version": "5.16.16",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/assets/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ export const DEFAULT_HASH_PROPS = [
'quality',
'fit',
'position',
'background',
];
Loading
Loading