astro@7.0.0-beta.3
Pre-releaseMajor Changes
-
#17010
0606073Thanks @ocavue! - Removes theastro db,astro login,astro logout,astro link, andastro initCLI commands.The
@astrojs/dbpackage is now deprecated. We recommend using a database client (Drizzle, Kysely, etc.) directly instead. -
#16877
3b7d76eThanks @matthewp! - Enables advanced routing by default.The advanced routing feature introduced behind a flag in v6.3.0 is no longer experimental and is now enabled by default.
This gives full control over how requests flow through your application, with first-class support for frameworks like Hono.
Advanced routing now uses
src/fetch.tsas default entrypoint instead ofsrc/app.ts.If you were previously using this feature without a custom entrypoint, please configure
fetchFileor rename your entrypoint tosrc/fetch.ts, and then remove the experimental flag from your Astro config:import { defineConfig } from 'astro/config'; export default defineConfig({ experimental { - advancedRouting: true, }, + fetchFile: 'app.ts' // optional, you only need this if you cannot rename your entrypoint. });fetchFileis now a top-level config option instead of being nested underexperimental.advancedRouting. If you were using a custom entrypoint, please update your Astro config to move its configuration:// astro.config.mjs export default defineConfig({ - experimental: { - advancedRouting: { - fetchFile: 'my-custom-entrypoint.ts', - }, - }, + fetchFile: 'my-custom-entrypoint.ts', })You can also set
fetchFile: nullto disable the entrypoint if you are usingsrc/fetch.tsfor another purpose, or don’t need advanced routing features.If you have been waiting for stabilization before using advanced routing, you can now do so.
Please see the advanced routing guide in docs for more about this feature.
Minor Changes
-
#16998
57dcc31Thanks @matthewp! - ExposesgetFetchState()fromastro/honoas a public APIThe
getFetchState()function retrieves or lazily creates aFetchStatefrom a Hono context object. This allows third-party packages to build Hono middleware that interacts with Astro's per-request state, giving theastro/honoAPI the same extensibility asastro/fetch.import { Hono } from 'hono'; import { getFetchState, pages } from 'astro/hono'; const app = new Hono(); app.use(async (context, next) => { const state = getFetchState(context); state.locals.message = 'Hello from custom middleware'; await next(); }); app.use(pages()); export default app;
-
#16996
300641eThanks @florian-lefebvre! - Adds asubsetfield to theFontDatatype exposed viafontDatafromastro:assets. When using multiple font subsets (e.g.,subsets: ["latin", "korean"]), each font data entry now includes the subset name, making it possible to distinguish between font entries for different subsets that share the same weight and style. -
#16745
f864a80Thanks @ematipico! - The custom logger feature introduced behind a flag in v6.2.0 is no longer experimental and is available for general use.This feature provides better control over Astro's logging infrastructure by allowing you to replace the default console output with custom logging implementations (e.g., structured JSON). This is particularly useful for on-demand rendering when connecting to log aggregation services such as Kibana, Logstash, CloudWatch, Grafana, or Loki.
Astro provides three built-in log handlers (
json,node, andconsole), and you can also create your own.JSON logging
import { defineConfig, logHandlers } from 'astro/config'; export default defineConfig({ logger: logHandlers.json({ pretty: true, level: 'warn', }), });
Custom logger
import { defineConfig } from 'astro/config'; export default defineConfig({ logger: { entrypoint: '@org/custom-logger', }, });
Additionally,
context.loggeris now always available in API routes and middleware, even without a custom logger configured.If you were previously using this feature, please remove the experimental flag from your Astro config:
import { defineConfig } from 'astro/config'; export default defineConfig({ - experimental: { - logger: { - entrypoint: '@org/custom-logger', - }, - }, + logger: { + entrypoint: '@org/custom-logger', + }, });If you have been waiting for stabilization before using custom loggers, you can now do so.
Please see the Logger docs for more about this feature.
-
#16981
0d6d644Thanks @ematipico! - Removes the settingexperimental.queuedRendering. The new rendering engine is now stable and replaces the old one.As part of the stabilization, the queued rendering has been improved, and some features have been removed:
- The construction of the queue has been removed, instead now Astro uses a streaming approach where components are rendered and flushed as they are encountered.
- The node polling feature has been removed because it doesn't yield concrete savings.
- The content cache has been descoped, and how only tag names are cached.
If you were previously using this experimental feature, you must remove this experimental flag from your configuration as it no longer exists:
// astro.config.mjs import { defineConfig } from "astro/config"; export default defineConfig({ experimental: { - queuedRendering: {} } });