astro — releases
Latest 20 GitHub releases for withastro/astro. Auto-mirrored by playbooks/local/autodocgen.yml.
[!info] Pinned in BreeZ-CF:
5.x· upstream latest:[email protected].
[email protected] · [email protected]
2026-04-30 · by @astrobot-houston
Minor Changes
-
#16187
fe58071Thanks @gllmt! - Adds awaitUntiloption to theRenderOptionsso that adapters can forward runtime background-task hooks to Astro.When provided by an adapter, runtime cache providers receive
context.waitUntilinCacheProvider.onRequest(), which allows background cache work such as stale-while-revalidate without blocking the response. The Cloudflare adapter now forwardsExecutionContext.waitUntilto this API. -
#16290
a49637aThanks @ViVaLaDaniel! - Ensures thatserver.allowedHosts(andvite.preview.allowedHosts) configuration is respected when usingastro previewwith the@astrojs/cloudflareadapter. This improves security by preventing DNS rebinding attacks when previewing Cloudflare builds locally. -
#15725
4108ec1Thanks @meyer! - Adds support for a new'jsx'value for thecompressHTMLoption. When set, whitespace is stripped using JSX whitespace rules instead of the default HTML compression strategy.// astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ compressHTML: 'jsx', });In JSX, whitespaces never matter, as such, no amount of indentation, or newlines will not affect the rendered output. For instance, the following code:
<div> <span>foo</span> <span>bar</span> </div>will be rendered as
foobar, whereas with HTML whitespace rules, a space would be present between the words due to the newline and indentation between the tags. -
#16477
28fb3e1Thanks @ematipico! - Adds experimental support for configurable log handlers.This experimental feature provides better control over Astro's logging infrastructure by allowing users to replace the default console output with custom logging implementations (e.g., structured JSON). This is particularly useful for users using on-demand rendering and wishing to connect their log aggregation services, such as Kibana, Logstash, CloudWatch, Grafana, or Loki.
By default, Astro provides three built-in log handlers (
json,node, andconsole), but you can also create your own.JSON logging
JSON logging can be enabled via the CLI for the
build,dev, andsynccommands using theexperimentalJsonflag:// astro.config.mjs import { defineConfig, logHandlers } from 'astro/config'; export default defineConfig({ experimental: { logger: logHandlers.json({ pretty: true, level: 'warn', }), }, });Custom logger
You can also create your own custom logger by implementing the correct interface:
// astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { logger: { entrypoint: '@org/custom-logger', }, }, });// @org/custom-logger.js import type { AstroLoggerDestination, AstroLoggerMessage } from 'astro'; import { matchesLevel } from 'astor/logger'; function customLogger(level = 'info'): AstroLoggerDestination { return { write(message: AstroLoggerMessage) { if (matchesLevel(message.level, level)) { // write message somewhere } }, }; } export default customLogger;For more information on enabling and using this feature in your project, see the Experimental Logger docs.
For a complete overview and to give feedback on this experimental API, see the Custom logger RFC.
-
#16333
0f7c3c8Thanks @florian-lefebvre! - Adds an experimental flagsvgOptimizerthat enables automatic optimization of your SVG components using the provided optimizer. This supersedes thesvgoexperimental flag, which is now removed.When enabled, your imported SVG files used as components will be optimized for smaller file sizes and better performance while maintaining visual quality. This can significantly reduce the size of your SVG assets by removing unnecessary metadata, comments, and redundant code.
Astro ships with a SVGO based optimizer, but any can be used.
To enable this feature, add the experimental flag in your Astro config and remove
svgoif it was enabled:// astro.config.mjs -import { defineConfig } from "astro/config"; +import { defineConfig, svgoOptimizer } from "astro/config"; export default defineConfig({ + experimental: { + svgOptimizer: svgoOptimizer() - svgo: true + } });For more information on enabling and using this feature in your project, see the experimental SVG optimization docs.
-
#16302
f6f8e80Thanks @florian-lefebvre! - Adds a newexperimental_getFontFileURL()method to resolve font file URLs when using the Fonts APIThe
fontDataobject exported fromastro:assetswas introduced to provide low-level access to font family data for advanced usage. One of the goals of this API was to be able to resolve buffers using URLs. However, it turned out to be impractical, especially during prerendering.Astro now exports a new
experimental_getFontFileURL()helper function fromastro:assetsto resolve font file URLs fromfontData. For example, when using satori to generate Open Graph images:// src/pages/og.png.ts import type { APIRoute } from "astro"; -import { fontData } from "astro:assets"; +import { fontData, experimental_getFontFileURL } from "astro:assets"; -import { outDir } from "astro:config/server"; -import { readFile } from "node:fs/promises"; import satori from "satori"; import { html } from "satori-html"; import sharp from "sharp"; export const GET: APIRoute = async (context) => { const fontPath = fontData["--font-roboto"][0]?.src[0]?.url; if (fontPath === undefined) { throw new Error("Cannot find the font path."); } - const data = import.meta.env.DEV - ? await fetch(new URL(fontPath, context.url.origin)).then(async (res) => res.arrayBuffer()) - : await readFile(new URL(`.${fontPath}`, outDir)); + const url = experimental_getFontFileURL(fontPath, context.url); + const data = await fetch(url).then((res) => res.arrayBuffer()); const svg = await satori( html`<div style="color: black;">hello, world</div>`, { width: 600, height: 400, fonts: [ { name: "Roboto", data, weight: 400, style: "normal", }, ], }, ); const pngBuffer = await sharp(Buffer.from(svg)) .resize(600, 400) .png() .toBuffer(); return new Response(new Uint8Array(pngBuffer), { headers: { "Content-Type": "image/png", }, }); };See the Fonts API documentation for more information.
Patch Changes
- #15980
8812382Thanks @seroperson! - Prevents script deduplication inside<template>elements
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-30 · by @astrobot-houston
Minor Changes
-
#16187
fe58071Thanks @gllmt! - Adds awaitUntiloption to theRenderOptionsso that adapters can forward runtime background-task hooks to Astro.When provided by an adapter, runtime cache providers receive
context.waitUntilinCacheProvider.onRequest(), which allows background cache work such as stale-while-revalidate without blocking the response. The Cloudflare adapter now forwardsExecutionContext.waitUntilto this API. -
#16290
a49637aThanks @ViVaLaDaniel! - Ensures thatserver.allowedHosts(andvite.preview.allowedHosts) configuration is respected when usingastro previewwith the@astrojs/cloudflareadapter. This improves security by preventing DNS rebinding attacks when previewing Cloudflare builds locally.
Patch Changes
- Updated dependencies []:
- @astrojs/[email protected]
[email protected] · [email protected]
2026-04-28 · by @astrobot-houston
Patch Changes
-
#16479
1058428Thanks @matthewp! - Fixes a spurious[WARN] [content] Content config not loadedwarning duringastro devfor projects that don't use content collections -
#16457
3d82220Thanks @matthewp! - Hardens server island encryption to prevent encrypted data from one island component being replayed against a different one -
#16481
152700eThanks @matthewp! - Fixes a spurious 404 request for a dev toolbar sourcemap duringastro devcaused by the browser mis-resolving a relativesourceMappingURLfrom the/@id/URL prefix -
#16480
1bcb43bThanks @matthewp! - Fixes an unnecessary full page reload on first navigation during dev
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-28 · by @astrobot-houston
Patch Changes
- #16486
0bae1a5Thanks @cyphercodes! - Fix forwarded serverless requests with streamed bodies by preserving the requiredduplex: 'half'option when rewriting middleware paths.
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-28 · by @astrobot-houston
Minor Changes
- #16466
31b6198Thanks @fkatsuhiro! - This change updates the Svelte integration's type shims to treat non-children snippet props andany-typed props as optional. Previously, these were incorrectly marked as required in Astro files, causing false-positive type errors when using Svelte 5 components.- Adds
HandleSnippetPropsto make Snippets optional in Astro. - Distinguishes between generic and non-generic components to preserve inference.
- Updates TSX generation to apply the appropriate directive wrapper.
- Adds
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-28 · by @astrobot-houston
Patch Changes
- #15908
8c62159Thanks @felmonon! - Keep generatedAstroComponentsuffixes in language-server output while rewriting.astroauto-import suggestions and edits back to the expected component name.
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-28 · by @astrobot-houston
Minor Changes
-
#16289
5d580c0Thanks @maxmalkin! - Adds a newgetDbError()helper exported fromastro:db. It walks the error.causechain and returns the underlyingLibsqlError, orundefinedif the error did not originate from libSQL. This is needed becausedrizzle-orm0.44+ wraps query errors in aDrizzleQueryErrorwhose.causeis the realLibsqlError.Upgrading
Code that reads
.codeor.messageafter catching a database error should migrate fromisDbError()togetDbError():// Before import { isDbError } from 'astro:db'; try { await db.insert(MyTable).values({ ... }); } catch (e) { if (isDbError(e)) { console.error(e.code, e.message); } } // After import { getDbError } from 'astro:db'; try { await db.insert(MyTable).values({ ... }); } catch (e) { const dbError = getDbError(e); if (dbError) { console.error(dbError.code, dbError.message); } }isDbError()is still exported and still returnstruefor wrapped errors, but its return type is nowbooleaninstead of theerr is LibsqlErrortype predicate. Code that relied on the narrowing to access.codeor.messagedirectly will now produce a TypeScript error pointing you togetDbError().
Patch Changes
- #16289
5d580c0Thanks @maxmalkin! - Fixes a SQL injection vulnerability by updatingdrizzle-ormto^0.45.2, patching GHSA-gpj5-g38j-94v9 (CVE-2026-39356).
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-28 · by @astrobot-houston
Patch Changes
-
#16498
4efe020Thanks @matthewp! - Fixes the dependency scan failing with "No matching export for import 'default'" when a.tsfile default-imports an.astrocomponentThe esbuild scan plugin now includes
export default {}in its output for.astrofiles, preventing the scan from failing and ensuring all dependencies are discovered ahead of time. -
Updated dependencies []:
- @astrojs/[email protected]
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-28 · by @astrobot-houston
Patch Changes
-
#16471
f56bb3fThanks @delucis! - Adds support for TypeScript v6 to peer dependencies range -
Updated dependencies [
8c62159]:- @astrojs/[email protected]
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-23 · by @astrobot-houston
Patch Changes
- #16458
8cb1f42Thanks @matthewp! - Fixes Cloudflare dev and build failures caused by@cloudflare/vite-plugindefaultingcompatibility_dateto today's date, which can exceed the maximum date supported by the bundledworkerdbinary
[email protected] · [email protected]
2026-04-22 · by @astrobot-houston
Patch Changes
- #16419
f3485c3Thanks @matthewp! - Hardens nested object and package metadata lookups to ignore prototype keys in content handling and project scaffolding
[email protected] · [email protected]
2026-04-22 · by @astrobot-houston
Patch Changes
-
#16448
99464edThanks @matthewp! - Updates vite, picomatch, and unstorage to latest patch versions -
#16422
a3951d7Thanks @matthewp! - Hardensastro-islandexport resolution and hydration error handling for malformed component metadata -
#16420
e21de1dThanks @matthewp! - Hardens Astro's error overlay and server logging paths to avoid unsafe HTML insertion and format-string interpolation -
#16419
f3485c3Thanks @matthewp! - Hardens nested object and package metadata lookups to ignore prototype keys in content handling and project scaffolding -
#16022
a002540Thanks @mathieumaf! - Fixes an issue where i18n domains would return 404 whentrailingSlashis set tonever. -
Updated dependencies [
99464ed,f3485c3]:- @astrojs/[email protected]
- @astrojs/[email protected]
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-22 · by @astrobot-houston
Patch Changes
- Updated dependencies [
99464ed,f3485c3]:- @astrojs/[email protected]
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-22 · by @astrobot-houston
Patch Changes
- #16424
3fcdaf1Thanks @matthewp! - Improves how@astrojs/upgradespawns package manager commands so it uses the same Windows command resolution ascreate-astro
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-22 · by @astrobot-houston
Patch Changes
- Updated dependencies [
99464ed,f3485c3]:- @astrojs/[email protected]
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-22 · by @astrobot-houston
Patch Changes
- Updated dependencies [
99464ed,f3485c3]:- @astrojs/[email protected]
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-22 · by @astrobot-houston
Patch Changes
- Updated dependencies [
99464ed,f3485c3]:- @astrojs/[email protected]
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-22 · by @astrobot-houston
Patch Changes
- Updated dependencies [
99464ed,f3485c3]:- @astrojs/[email protected]
- @astrojs/[email protected]
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-22 · by @astrobot-houston
Patch Changes
- Updated dependencies [
f3485c3]:- @astrojs/[email protected]
@astrojs/[email protected] · @astrojs/[email protected]
2026-04-22 · by @astrobot-houston
Patch Changes
-
#16419
f3485c3Thanks @matthewp! - Hardens nested object and package metadata lookups to ignore prototype keys in content handling and project scaffolding -
Updated dependencies [
99464ed,f3485c3]:- @astrojs/[email protected]