From 0d9ebcafde5ccc110bb61077bc222679b7cb7fbc Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 9 Jun 2026 17:28:38 +0200 Subject: [PATCH 1/5] logger API fixes --- .../docs/en/reference/logger-reference.mdx | 49 ++++++------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/src/content/docs/en/reference/logger-reference.mdx b/src/content/docs/en/reference/logger-reference.mdx index f90407bf32c51..4454ada1a37e8 100644 --- a/src/content/docs/en/reference/logger-reference.mdx +++ b/src/content/docs/en/reference/logger-reference.mdx @@ -29,12 +29,10 @@ The following example defines a custom logger exported by the `@org/custom-logge import { defineConfig } from 'astro/config'; export default defineConfig({ - experimental: { - logger: { - entrypoint: "@org/custom-logger", - config: { - level: "warn" - } + logger: { + entrypoint: "@org/custom-logger", + config: { + level: "warn" } } }); @@ -86,9 +84,7 @@ The following example configures the JSON logger to print only messages that hav import { defineConfig, logHandlers } from 'astro/config'; export default defineConfig({ - experimental: { - logger: logHandlers.json({ level: "warn" }) - } + logger: logHandlers.json({ level: "warn" }) }); ``` @@ -128,9 +124,7 @@ The `json` logger accepts the following options: import { defineConfig, logHandlers } from 'astro/config'; export default defineConfig({ - experimental: { - logger: logHandlers.json({ pretty: true }) - } + logger: logHandlers.json({ pretty: true }) }); ``` @@ -158,9 +152,7 @@ The `console` logger accepts the following options: import { defineConfig, logHandlers } from 'astro/config'; export default defineConfig({ - experimental: { - logger: logHandlers.console({ level: 'warn' }) - } + logger: logHandlers.console({ level: 'warn' }) }); ``` @@ -186,13 +178,11 @@ The `node` logger accepts the following options: import { defineConfig, logHandlers } from 'astro/config'; export default defineConfig({ - experimental: { - logger: logHandlers.node({ level: 'warn' }) - } + logger: logHandlers.node({ level: 'warn' }) }); ``` -### `logHandlers.compose` +### `logHandlers.compose()` A particular function that allows configuring multiple loggers in an arbitrary order. The same message is broadcast to all loggers. @@ -202,18 +192,13 @@ The following example composes the console logger and JSON logger using the defa import { defineConfig, logHandlers } from 'astro/config'; export default defineConfig({ - experimental: { - logger: logHandlers.compose( - logHandlers.console(), - logHandlers.json() - ) - } + logger: logHandlers.compose( + logHandlers.console(), + logHandlers.json() + ) }); ``` - - - ## Types reference The following types can be imported from the `astro` specifier. @@ -251,13 +236,6 @@ An optional function called before a server is shut down. This function is usual ### `AstroLoggerLevel` -The level of the message. Available variants: -- `'debug'` -- `'info'` -- `'warn'` -- `'error'` -### `AstroLoggerLevel` -

**Type:** `'debug' |'info' |'warn' | 'error' | 'silent'` @@ -274,6 +252,7 @@ Specifies the verbosity level of logs: **Type:** `{ label: string | null; level: AstroLoggerLevel; message: string; newLine: boolean; }`

+ The incoming object from the [`AstroLoggerDestination.write()`](#astrologgerdestinationwrite) function: - `message`: the message being logged. - `level`: the level of the message. From 9dc74465d27794b4217010ef8ef4be713b2d0a88 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 9 Jun 2026 17:28:48 +0200 Subject: [PATCH 2/5] link to log handlers in the astro config module --- .../docs/en/reference/modules/astro-config.mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/content/docs/en/reference/modules/astro-config.mdx b/src/content/docs/en/reference/modules/astro-config.mdx index 59d987b3f4735..5f06d2d108025 100644 --- a/src/content/docs/en/reference/modules/astro-config.mdx +++ b/src/content/docs/en/reference/modules/astro-config.mdx @@ -138,6 +138,7 @@ import { envField, fontProviders, getViteConfig, + logHandlers, mergeConfig, passthroughImageService, sessionDrivers, @@ -307,6 +308,16 @@ Describes the [built-in provider](/en/reference/font-provider-reference/#built-i Retrieves the Vite configuration to use by merging a custom Vite configuration object and an optional Astro configuration object. This is useful [to set up Vitest for testing](/en/guides/testing/#vitest). +### `logHandlers` + +

+ +**Type:** `object`
+ +

+ +Describes the [available built-in log handlers](/en/reference/logger-reference/#built-in-loggers) that can be used to [configure a logger](/en/reference/configuration-reference/#logger) in your Astro configuration. + ### `mergeConfig()` See [`mergeConfig()` in the Programmatic API reference](/en/reference/programmatic-reference/#mergeconfig). From 1fd8934a65d1043e205b0f9facff709c80880a39 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Wed, 27 May 2026 12:13:38 -0400 Subject: [PATCH 3/5] Update v7 upgrade guide: experimental flags, src/app.ts, @astrojs/db removal --- src/content/docs/en/guides/upgrade-to/v7.mdx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/content/docs/en/guides/upgrade-to/v7.mdx b/src/content/docs/en/guides/upgrade-to/v7.mdx index d811559ac023c..9266221d8c08f 100644 --- a/src/content/docs/en/guides/upgrade-to/v7.mdx +++ b/src/content/docs/en/guides/upgrade-to/v7.mdx @@ -78,27 +78,25 @@ If you are using Vite-specific plugins, configuration, or APIs, check the [Vite Most Astro users should be able to upgrade without any changes to their project code. This is primarily a breaking change for Astro integrations and plugins that depend on Vite internals. -### Rust Compiler +### Experimental Flags -The Rust-based Astro compiler, previously available as an experimental flag (`experimental.rustCompiler`), is now the default and only compiler in Astro 7. The Rust compiler delivers significantly faster build times compared to the previous Go-based compiler. +Experimental flags allow you to opt in to features while they are in early development. The following experimental flags have been removed in Astro 7.0 and are now stable, or the new default behavior. -##### What should I do? - -No action is required for most projects. The Rust compiler is a drop-in replacement for the Go-based compiler. +Remove these experimental flags from your Astro config if you were previously using them: -If you had previously opted in to the Rust compiler via the experimental flag, you can now remove it from your configuration: - -```js title="astro.config.mjs" del={4-6} +```js del={5-6} title="astro.config.mjs" import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { rustCompiler: true, }, -}); +}) ``` -If you encounter any issues with the Rust compiler, please report them on [GitHub](https://github.com/withastro/astro/issues). +#### Experimental features now stable: + +- `rustCompiler`: The Rust-based Astro compiler is now the default and only compiler, replacing the previous Go-based compiler. No action is required for most projects. If you encounter any issues, please report them on [GitHub](https://github.com/withastro/astro/issues). ## Removed From 92224c09f2d0886c0caa68b55b779d598bbd4e22 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 9 Jun 2026 17:32:23 +0200 Subject: [PATCH 4/5] add logger to the upgrade guide --- src/content/docs/en/guides/upgrade-to/v7.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/content/docs/en/guides/upgrade-to/v7.mdx b/src/content/docs/en/guides/upgrade-to/v7.mdx index 9266221d8c08f..d545c67b6ebeb 100644 --- a/src/content/docs/en/guides/upgrade-to/v7.mdx +++ b/src/content/docs/en/guides/upgrade-to/v7.mdx @@ -89,6 +89,7 @@ import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { + logger: logHandlers.json({ pretty: true }), rustCompiler: true, }, }) @@ -96,6 +97,8 @@ export default defineConfig({ #### Experimental features now stable: +- `logger`: The new logging system is now stable and the experimental flag is no longer needed to use it. If you were using this flag, you can now set your logger directly in the top-level `logger` field of your Astro config. + - `rustCompiler`: The Rust-based Astro compiler is now the default and only compiler, replacing the previous Go-based compiler. No action is required for most projects. If you encounter any issues, please report them on [GitHub](https://github.com/withastro/astro/issues). ## Removed From 4815d51f478d12a221a2b0c7e910e218afc7816f Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 9 Jun 2026 18:30:46 +0200 Subject: [PATCH 5/5] fix link --- src/content/docs/en/reference/modules/astro-config.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/reference/modules/astro-config.mdx b/src/content/docs/en/reference/modules/astro-config.mdx index 5f06d2d108025..0accf396c1f98 100644 --- a/src/content/docs/en/reference/modules/astro-config.mdx +++ b/src/content/docs/en/reference/modules/astro-config.mdx @@ -316,7 +316,7 @@ Retrieves the Vite configuration to use by merging a custom Vite configuration o

-Describes the [available built-in log handlers](/en/reference/logger-reference/#built-in-loggers) that can be used to [configure a logger](/en/reference/configuration-reference/#logger) in your Astro configuration. +Describes the [available built-in log handlers](/en/reference/logger-reference/#built-in-loggers) that can be used to [configure a logger](/en/reference/configuration-reference/#logger-options) in your Astro configuration. ### `mergeConfig()`