Article

Astro 6.2 — and the First Look at the Astro 7 Alpha

Astro 6.2 adds a pluggable SVG optimizer and JSON-output logging, and the first Astro 7 alpha arrives with Vite 8 and the Rust compiler as defaults.

Editorial Team EN

Astro 6.2 is a tooling point release. It swaps the SVG compression flag for a pluggable optimizer, ships two experimental APIs for structured logging and font handling, and publishes an early v7 alpha. Where each piece sits across the release line is tracked in Astro 6, Feature by Feature.

A pluggable SVG optimizer

Astro 6.2 introduces a svgOptimizer option that replaces the previous svgo flag. Instead of a single hardwired tool, the optimizer is pluggable, so you can supply an alternative such as OxVG.

A boolean flag locks you into one library's tradeoffs. A pluggable slot lets the SVG processing layer move forward without an Astro release in the loop, and lets teams pick whatever optimizer fits their assets.

Two experimental APIs worth watching

Both new APIs in 6.2 are flagged experimental, so treat them as previews rather than load-bearing parts of a production build.

A custom logger with JSON output

The experimental Logger lets you register custom loggers, with built-in JSON output as the main feature. Structured logs are easier for machines to parse than free-form console text, and the release calls out coding agents as a target consumer.

An agent watching a build wants fields it can key on, not prose it has to scrape. JSON output gives it that, and makes piping build logs into log aggregation or CI tooling cleaner.

Font data during prerender

The second experimental addition is getFontFileURL(), which loads font file data during prerendering from astro:assets. The release points at Satori as the kind of tool this unlocks.

Satori turns HTML and CSS into SVG, and needs the actual font bytes to lay out glyphs. Getting that data at prerender time means dynamic Open Graph images and similar generated assets can use real fonts without a separate fetch step.

The v7 alpha lands early

Astro published an early v7 alpha alongside the 6.2 features. Two things stand out: support for Vite 8, and the Rust compiler shipping as the default — the compiler that landed behind a flag in Astro 6.0. A Rust default is the number to watch for build speed, but an alpha is for testing, not production.

Smaller config knobs

Preview servers now accept allowedHosts, passed down to adapter preview servers — useful when you preview behind a proxy or a non-localhost host the server would otherwise reject.

A new "jsx" option for compressHTML strips whitespace by JSX rules, giving .astro and .tsx files consistent compression instead of two slightly different outputs.

Nothing in 6.2 forces a migration. The svgo-to-svgOptimizer swap is the one to read closely; the experimental APIs are opt-in. More Astro coverage sits on the Astro topic hub.