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

推荐订阅源

云风的 BLOG
云风的 BLOG
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
Recent Announcements
Recent Announcements
B
Blog
D
Docker
V
V2EX
GbyAI
GbyAI
L
LangChain Blog
博客园 - Franky
U
Unit 42
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
博客园_首页
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
量子位
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客

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 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
Astro 4.1
Erika, Emanuele Stoppa, Matthew Phillips, Nate Moore, Bjorn Lu · 2024-01-04 · via The Astro Blog

After a small break for the holidays, we’re back with a new release of Astro! Astro 4.1 includes a number of bug fixes and improvements. As we’re all getting back into the swing of things, this release is a bit smaller than usual, but we’re all excited to get back to work on Astro and have some exciting things planned for 2024!

Highlights include:

  • New accessibility audit rules
  • New configuration option for client:visible
  • Custom cookie encoding and decoding

To take advantage of the latest features, make sure you’re running the latest version of Astro. You can upgrade to Astro 4.1 by running the @astrojs/upgrade command:

or by running the upgrade command for your package manager:

npm install astro@latest

pnpm upgrade astro --latest

yarn upgrade astro --latest

New accessibility audit rules

We’ve added two new audit rules for the dev toolbar. You will now be warned about:

  • Unsupported ARIA attributes
  • Missing attributes required for ARIA role

Both these rules help ensure that the elements on your page have correct and valid ARIA roles.

Extended client:visible directive

The client:visible directive now accepts a rootMargin option, which allows you to specify a margin around the viewport to calculate visibility. This allows a component to be hydrated when it is close to the viewport instead of waiting for it to become visible.

<!-- Load component when it's within 200px away from entering the viewport -->

<Component client:visible={{rootMargin: "200px"}} />

Cookie encoding/decoding can now be customized through new encode and decode functions when setting and getting cookies.

For example, you can bypass the default encoding via encodeURIComponent when adding a URL as part of a cookie:

---

import { encodeCookieValue } from './cookies';

Astro.cookies.set('url', Astro.url.toString(), {

// Override the default encoding so that URI components are not encoded

encode: (value) => encodeCookieValue(value),

});

---

Later, you can decode the URL in the same way:

---

import { decodeCookieValue } from './cookies';

const url = Astro.cookies.get('url', {

decode: (value) => decodeCookieValue(value),

});

---

Bug Fixes

Additional bug fixes are included in this release. Check out the release notes to learn more.