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

推荐订阅源

D
Docker
Apple Machine Learning Research
Apple Machine Learning Research
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
M
MIT News - Artificial intelligence
腾讯CDC
B
Blog RSS Feed
H
Help Net Security
J
Java Code Geeks
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
博客园_首页
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
博客园 - Franky
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 叶小钗
Martin Fowler
Martin Fowler

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.0 Beta Release
Matthew Phillips · 2023-11-27 · via The Astro Blog

Today we’ve released the first beta of Astro 4! Those feeling adventurous can install the new beta, review our in-progress upgrade docs, and report any bugs you find to the Astro discord.

What to expect in Astro 4

We are releasing Astro 4 to stay up to date with Vite, our internal build tool. Astro 4 includes the latest version of Vite 5, which was just released last month.

As Vite 5 is also a small major, most projects will be able to upgrade to Astro 4 with only minimal changes to your code if any at all.

Additionally, in Astro 4 we are planning to bring some of the new features we have been working on over the last few months out of experimental status and mark them as stable. Stay tuned for more!

Trying out the beta

You can try out the beta in your existing app by running our new @astrojs/upgrade package. This CLI tool will automatically install the correct version of Astro as well as any official Astro integrations you have installed.

npx @astrojs/upgrade beta

pnpm dlx @astrojs/upgrade beta

yarn dlx @astrojs/upgrade beta

Alternatively, you can manually install the astro@beta package. Be sure to also update any @astrojs/* integrations you have installed!

npm install astro@beta

pnpm install astro@beta

yarn install astro@beta

If starting a new project you can also try out the beta by running:

npm create astro@latest -- --ref next

Again, substitute with your favorite package manager. We have not completed the upgrade guide yet, but you can already find the most significant changes in the Astro 4.0 upgrade guide pull request. You can also follow its related issue which is tracking all breaking changes.

Astro 3.6

Additionally, we’ve recently released Astro 3.6 which comes with new events in the <ViewTransitions /> router as well as fallback for prefetch in reduced data scenarios.

View Transition events

Astro 3.6 adds these three new events as part of the <ViewTransitions /> router’s lifecycle:

astro:before-preparation runs immediately before the preparation step, where the content of the new page is loaded. This can be used to override the behavior of loading the new page, for example, to show a loading spinner.

astro:after-preparation runs after the content has been loaded. This can be used to stop a loading spinner if one was added as part of astro:before-preparation.

astro:before-swap runs immediately before the swap step, where the contents of the old page are swapped out in favor of the contents of the new page. This event includes the event.newDocument property, a Document that you can mutate. One use-case for this event is to set dark mode class names if using localStorage to store light/dark mode preferences.

Check out this demo which shows what is possible using the new events and see the docs for more information about all five lifecycle events.

Prefetch fallback

Previously when a user was on a slow connection or had the data saver preference enabled, prefetching was entirely disabled. In 3.6 we’ve changed the prefetch strategy to occur on tap: when the user begins clicking a link, but before they have released. This gives us just a little bit of a head start on fetching the next page, but only when we’re pretty sure the user intends to click.

Bug Fixes

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