惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
H
Help Net Security
Jina AI
Jina AI
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
博客园 - 叶小钗
Y
Y Combinator Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
C
Check Point Blog
Recent Announcements
Recent Announcements
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
B
Blog

The Astro Blog

Astro 6.4 Astro 6.3 Starlight 0.39 Astro 6.2 What's new in Astro - April 2026 What's new in Astro - March 2026 Astro 6.1 CloudCannon Joins Astro as an Official CMS Partner Astro 6.0 What's new in Astro - February 2026 What's new in Astro - January 2026 Astro 5.17 Supporting the future of Astro The Astro Technology Company joins Cloudflare Astro 6 Beta What's new in Astro - December 2025 What's new in Astro - November 2025 Stainless Sponsors Astro, Launches Astro-Powered Docs Platform What's new in Astro - October 2025 Astro 5.15 Spirit of Astro: meet the winning designs What's new in Astro - September 2025 Astro 5.14 Cloudflare Donates $150,000 to Support Astro's Open Source Mission Webflow Donates $150,000 to Support Astro's Open Source Mission Mux: Our Official Video Partner Unleashing creativity: How CodeTV built a video streaming platform with Astro and Mux | Astro What's new in Astro - August 2025 Astro 5.13 What's new in Astro - July 2025
Astro 5.16
Matthew Phillips · 2025-11-20 · via The Astro Blog

Astro 5.16 brings experimental SVG optimization, interactive CLI improvements, and a collection of DX enhancements.

Explore what’s new in this release:

  • SVG optimization with SVGO
  • Interactive shortcuts for astro preview
  • Better agent support with astro add --yes
  • ActionInputSchema utility type for type-safe actions

To upgrade an existing project, use the automated @astrojs/upgrade CLI tool. Alternatively, upgrade manually by running the upgrade command for your package manager:

# Recommended:

npx @astrojs/upgrade

# Manual:

npm install astro@latest

pnpm upgrade astro --latest

yarn upgrade astro --latest

SVG optimization with SVGO

Astro 5.16 adds experimental support for automatic SVG optimization using SVGO, a powerful tool that reduces SVG file size without compromising quality.

SVG files can often be optimized significantly—removing unnecessary metadata, simplifying paths, and eliminating redundant attributes. By integrating SVGO into Astro’s asset pipeline, your SVGs are now automatically optimized during the build process, reducing bandwidth and improving page load times.

Enable the experimental SVG optimization flag in your Astro config:

import { defineConfig } from 'astro/config';

export default defineConfig({

experimental: {

svgo: true,

},

});

By default, SVGO runs with its recommended settings. You can customize the optimization behavior by passing SVGO configuration options:

export default defineConfig({

experimental: {

svgo: {

plugins: [

'preset-default',

{

name: 'removeViewBox',

active: false

}

]

}

}

})

See the SVG optimization documentation for more details on configuration options and SVGO plugins.

Interactive shortcuts for astro preview

The astro preview command now supports keyboard shortcuts, making it easier to control the preview server. Similar to astro dev, you can now use the following hotkeys in the terminal where the server is running:

> Local: http://localhost:4321/

- press o + enter to open in browser

- press q + enter to quit

These DX improvements eliminate the need to manually navigate to your site in a browser or terminate the process with Ctrl+C, making the preview experience more intuitive and consistent with the development server workflow.

Better agent support with astro add --yes

As coding agents and AI tools become more prevalent in development workflows, Astro is making it easier to work with them. The astro add command now displays a helpful hint about skipping human-friendly prompts with the --yes flag, making it clear how agents can automate Astro integrations without getting stuck on interactive prompts.

With this update, AI agents and automation tools can seamlessly run:

When you run astro add interactively, you’ll see a helpful hint on the first interactive prompt:

astro add react

# Output:

# To run this command without prompts, pass the --yes flag

This empowers agents to configure Astro projects autonomously, whether you’re using Claude Code, Cursor, Copilot, or any other AI-assisted development tool. No more getting stuck waiting for interactive confirmations—agents can now fully automate your Astro setup.

ActionInputSchema utility type for type-safe actions

Astro Actions now include the ActionInputSchema utility type, making it easier to extract and work with the input schema from your action definitions. This is particularly useful when building abstractions or creating reusable action handlers.

With ActionInputSchema, you can get the exact type of your action’s input schema:

import { type ActionInputSchema, defineAction } from 'astro:actions';

import { z } from 'astro/zod';

const contactAction = defineAction({

accept: 'form',

input: z.object({

email: z.string().email(),

message: z.string(),

}),

handler: ({ email, message }) => {

// Handle the contact form

return { success: true };

},

});

// Extract the schema type

type ContactSchema = ActionInputSchema<typeof contactAction>;

// Get the actual input type

type ContactInput = z.input<ContactSchema>;

// Result: { email: string; message: string }

This is especially valuable when you’re:

  • Creating wrapper functions around actions.
  • Building form submission abstractions.
  • Sharing action types across your codebase.

ActionInputSchema makes it possible for developers less fluent in advanced TypeScript patterns to still get proper type inference without manually duplicating your schema definitions.

Other improvements

  • 82 MB dependency reduction for Netlify adapter – Updated @netlify/functions to v5, removing 310 transitive dependencies and shaving 82 MB from the Netlify adapter’s dependency tree. This significantly reduces bundle size for users deploying with Netlify. (#14716)

Bug fixes

As always, we’ve been working hard on fixing issues since the 5.15 release. See the changelog for all the details.

The Astro core team is:

Alexander Niebuhr , Armand Philippot , Chris Swithinbank , Emanuele Stoppa , Erika , Florian Lefebvre , Fred Schott , HiDeoo , Luiz Ferraz , Matt Kane , Matthew Phillips , Reuben Tier , Sarah Rainsberger , and Yan Thomas .

Thanks to all the other contributors who helped make Astro 5.16 possible with code and docs additions and improvements, including:

Alejandro Romano, Andreas Deininger, Arman, Azat S., BuckyBuck135, David Dal Busco, DevVali, Elvis Mao, Eryk Baran, Felix Schneider, Franco Victorio, Fredrik Norlin, Gökhan Kurt, Jacob Lamb, John L. Armstrong IV, Junseong Park, knj, ktym4a, ld-web, Louis Escher, Lumynous, MareStare, Marta Karaś, Mateusz Malinkiewicz, Maurici Abad Gutierrez, Mehdi El Fadil, Michael Stramel, Michał Paśko, Ming-jun Lu, nemu, Néstor, Olusegun Durojaye, paul valladares, Philippe Serhal, pioupia, randomguy-2650, Roman, Roman Hauksson, Sarah Krasnik Bedell, Sebastian Beltran, Sergio, Thomas Bonnet, and vrabe