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

推荐订阅源

G
Google Developers Blog
博客园 - 聂微东
J
Java Code Geeks
Engineering at Meta
Engineering at Meta
Jina AI
Jina AI
D
Docker
B
Blog
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Y
Y Combinator Blog
N
Netflix TechBlog - Medium
月光博客
月光博客
F
Fortinet All Blogs
爱范儿
爱范儿
H
Help Net Security
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
The Cloudflare Blog
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
U
Unit 42

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 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 Astro 5.16 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 6.1
Fred Schott · 2026-03-26 · via The Astro Blog

Astro 6.1 is here! Astro 6.1 gives you global control over image encoding with codec-specific defaults for Sharp, so you can configure JPEG, WebP, AVIF, and PNG settings once in your Astro config instead of on every image.

Explore what’s new in this release:

  • Sharp codec-specific image defaults
  • Advanced SmartyPants configuration
  • i18n fallback routes for integrations
  • Smoother view transitions on mobile
  • Vite 8 compatibility warning
  • React hydration fixes
  • CSRF protection behind reverse proxies

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

Sharp codec-specific image defaults

Sharp, Astro’s built-in image service, has always supported fine-grained encoding options — mozjpeg compression for JPEG, effort levels for WebP and AVIF, compression levels for PNG. Sharp’s defaults work great for most projects, but if you needed consistent encoding settings across a large number of images, the only option was to set them on every <Image /> individually.

Astro 6.1 adds image.service.config to set codec-specific defaults once in your Astro config, applied to every image processed during the build:

import { defineConfig } from 'astro/config';

export default defineConfig({

image: {

service: {

config: {

jpeg: { mozjpeg: true },

webp: { effort: 6, alphaQuality: 80 },

avif: { effort: 4, chromaSubsampling: '4:2:0' },

png: { compressionLevel: 9 },

},

},

},

});

Per-image quality still takes precedence when set, so global defaults and per-image overrides work together without conflict. See the image service configuration reference for the full list of supported options.

Advanced SmartyPants configuration

If your Markdown content targets a non-English audience, you’ve probably noticed that SmartyPants — the library Astro uses to automatically convert punctuation into its typographic equivalents — assumes English conventions. French guillemets («»), German quotation marks („"), or old-school em-dash handling weren’t possible without disabling SmartyPants entirely and handling it yourself.

Astro 6.1 opens up the full SmartyPants configuration, so you can customize each transformation individually:

import { defineConfig } from 'astro/config';

export default defineConfig({

markdown: {

smartypants: {

dashes: 'oldschool',

openingQuotes: { double: '«', single: '‹' },

closingQuotes: { double: '»', single: '›' },

ellipses: 'unspaced',

quotes: false,

},

},

});

See the retext-smartypants options for the full list of supported settings.

i18n fallback routes for integrations

Astro 6.1 exposes fallbackRoutes on every route in the astro:routes:resolved hook, giving integrations access to the additional routes Astro generates for locales that don’t have their own content when using fallbackType: 'rewrite'.

{

'astro:routes:resolved': ({ routes }) => {

for (const route of routes) {

const fallbacks = route.fallbackRoutes.map((f) => f.pathname);

console.log(route.pathname, '->', fallbacks);

// '/about/' -> ['/fr/about/', '/de/about/']

}

}

}

We’ve already put this to use in @astrojs/sitemap, which now automatically includes i18n fallback pages in the generated sitemap. Previously, these routes were invisible to integrations, meaning fallback pages were silently missing from your sitemap.

Learn more about i18n fallback routing in the Astro docs.

Other improvements

  • Smoother view transitions on mobile — The client router now skips view transition animations when the browser is already providing its own visual transition, such as a swipe gesture on iOS Safari. This eliminates the double-animation flicker that could occur when navigating back and forward with gestures. (#16025)
  • Vite 8 compatibility warning — Astro now warns on dev server startup when Vite 8 is detected at the top level of your project. The astro add cloudflare command also automatically adds a "overrides": { "vite": "^7" } entry to your package.json, preventing a common crash when using packages like @tailwindcss/vite. (#16062)
  • React hydration fixes — Multiple fixes for React hydration errors, including conditional slot rendering and experimentalReactChildren mismatches. (#15378, #15146)
  • CSRF protection behind reverse proxiescheckOrigin now correctly reads X-Forwarded-Proto during astro dev when behind a TLS-terminating reverse proxy, preventing false 403 errors on form submissions. (#16043)

For a complete list of bug fixes and smaller improvements, see the full changelog.

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 6.1 possible with code and docs additions and improvements, including:

0xRozier, Adam Matthiesen, Adam Page, Ahmad Yasser, AitorMT, Alex Dombroski, B Sai Thrishul, bashrocks, Ben Limmer, Bernd Strehl, Burra Karthikeya, Calvin Liang, chaegumi, Chase McCoy, Corbin Crutchley, Daniel Bodky, Daniil Sivak, Dario Piotrowicz, dataCenter430, Dawid Gaweł, Desel72, Em Poulter, Eveeifyeve, farshad, Felix Schneider, Felmon, fkatsuhiro, Giray, Gokhan Kurt, Greg L. Turnquist, hank00111, Haz, Jack Lukic, jahndan, Jason P. Cochrane, Jimmy, Junseong Park, Kedar Vartak, Kevin Z, Koji Wakamiya, Kumar Gautam, Kyle McLean, ld-web, Leif Marcus, Louis Escher, Martin Trapp, Matthew Justice, Natan Sągol, Oliver Speir, oliverlynch, Ossaid, paul valladares, Paweł Grzybek, pierreeurope, Rafael Yasuhide Sudo, Raymond Camden, Sakku 🦉, Sam Richard, Sanjaiyan Parthipan, Sebastian Beltran, Shinya Fujino, Sora, Tay, teinett, Thomas Bonnet, Tom Callahan, Tomasz Cz-Sokołow, Tristan Bessoussa, Vagno, vrabe, Will (liruifengv), xyamzw, Yevhen Amelin, マルコス, and もっちー