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

推荐订阅源

博客园_首页
The GitHub Blog
The GitHub Blog
美团技术团队
Know Your Adversary
Know Your Adversary
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
Attack and Defense Labs
Attack and Defense Labs
G
Google Developers Blog
I
InfoQ
博客园 - 司徒正美
T
Troy Hunt's Blog
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
S
Security Affairs
M
MIT News - Artificial intelligence
Simon Willison's Weblog
Simon Willison's Weblog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Tailwind CSS Blog
量子位
Vercel News
Vercel News
月光博客
月光博客
V
Vulnerabilities – Threatpost
N
News and Events Feed by Topic
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 最新话题
F
Full Disclosure
The Hacker News
The Hacker News
Hacker News: Ask HN
Hacker News: Ask HN
T
Tor Project blog
A
Arctic Wolf
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Forbes - Security
Forbes - Security
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
GbyAI
GbyAI
B
Blog RSS Feed
V
Visual Studio Blog
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs

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 What's new in Astro - July 2025 Astro 5.12 Starlight 0.35 Astro 5.11 What's new in Astro - June 2025 Live Content Collections: A Deep Dive Introducing… Astro Mart Astro Solstice Festival Astro 5.10 Astro 5.9 What's new in Astro - May 2025 Astro 5.8 What's new in Astro - April 2025 2025 Technical Steering Committee Starlight April Update Astro 5.7 Astro Agency Partner Program Astro 5.6 What's new in Astro - March 2025 Astro 5.5 What's new in Astro - February 2025 Astro 5.4 Starlight 0.32 Astro 5.3 What's new in Astro - January 2025 Astro 5.2 2024 year in review What's new in Astro - December 2024 Astro 5.1 Astro 5.0 Google IDX: Our Official Online Editor Partner What's new in Astro - November 2024 What's new in Astro - October 2024 Astro x Cloudinary SDK What's new in Astro - September 2024 Community Loaders for Astro Content Layer Astro x Hygraph: Content Loader Astro x Cloudinary: Content Loader Astro x Storyblok: Content Loader Content Layer: A Deep Dive Starlight 0.28 Astro 5.0 Beta Release The $100,000 Astro Ecosystem Fund Fall Update Goodbye Studio, Hello DB What's new in Astro - August 2024 Astro 4.15 Astro 4.14 Astro 4.13 What's new in Astro - July 2024 Astro 4.12: Server Islands Netlify: Our Official Deployment Partner What's new in Astro - June 2024 Astro 4.11 Astro Together 2024 Server Islands The Astro Content Layer Zero-JavaScript View Transitions Astro 4.10 Starlight turns one year old! What's new in Astro - May 2024 Astro 4.9 Astro 4.8 What's new in Astro - April 2024 Astro 4.7 Astro 4.6 What's new in Astro - March 2024 Migrating 500+ tests from Mocha to Node.js Astro DB: A Deep Dive The Astro Developer Portal Astro DB
Astro 2.9: View Transitions (experimental)
Matthew Phillips · 2023-07-20 · via The Astro Blog

Astro 2.9 is out and features experimental support for view transitions, as well as redirects configuration and improved script bundling.

  • View Transitions (experimental)
  • Redirects
  • Hoisted script optimization

If you already have Astro installed, you can upgrade it to 2.9 by running the upgrade command in your project (using your package manager of choice):

npm install astro@latest

pnpm upgrade astro --latest

yarn upgrade astro --latest

While you’re at it, upgrade any @astrojs/* integrations and adapters you have installed, too!

View Transitions (experimental)

Watch Ben Holmes explain the new View Transitions feature.

Astro now supports view transitions through the new <ViewTransitions /> component and the transition:animate directive. Enjoy the smoother transitions that previously required client-side routing, without sacrificing the simplicity of an MPA.

Enable support for view transitions in Astro 2.9 by adding the experimental flag to your config:

import { defineConfig } from 'astro/config';

export default defineConfig({

experimental: {

viewTransitions: true,

},

});

<ViewTransitions />

This is a component which acts as the router for transitions between pages. Add it to the <head> section of each individual page where transitions should occur in the client as you navigate away to another page, instead of causing a full page browser refresh.

To enable support throughout your entire app (SPA mode), add the component in some common layout or component that targets the <head> of every page.

CommonHead.astro

---

import { ViewTransitions } from 'astro:transitions';

---

<meta charset="utf-8" />

<title>{Astro.props.title}</title>

<ViewTransitions />

With only this change, your app will now route completely in-client. You can then add transitions to individual elements using the transition:animate directive.

Animations

Add transition:animate to any element to use Astro’s built-in animations.

<header transition:animate="slide"></header>

In the above, Astro’s slide animation will cause the <header> element to slide in from the left, and then slide out to the right when you navigate away from the page.

You can also customize these animations using any CSS animation properties, for example, by specifying a duration:

---

import { slide } from 'astro:transition';

---

<header transition:animate={slide({ duration: 200 })}></header>

Continue learning

Check out the client-side routing docs to learn more.

Redirects

The redirects configuration option is no longer experimental! If you were previously using experimental redirects, remove the following experimental flag:

import { defineConfig } from 'astro/config';

export default defineConfig({

experimental: {

redirects: true,

}

});

If you have been waiting for stabilization before using redirects, wait no longer! You can now safely use redirects in your project. Check out the docs on redirects to learn how to use this built-in feature.

In your configuration, add a map of old and new paths to redirect from and to:

import { defineConfig } from 'astro/config';

export default defineConfig({

redirects: {

'/old-page': '/new-page'

}

});

Hoisted script optimization

Astro’s static analysis to determine which <script> tags to bundle together just got a little smarter!

Astro creates bundles that optimize script usage between pages and place them in the head of the document so that they are downloaded as early as possible. One limitation to Astro’s existing approach has been that you could not dynamically use hoisted scripts. When using libraries that re-exported components, each page received the same, all-inclusive bundle whether or not every script was needed on that page.

Now, Astro has improved the static analysis to take into account the actual imports used.

For example, Astro would previously bundle the <script>s from both the <Tab> and <Accordion> components for the following library that re-exports multiple components:

@matthewp/my-astro-lib

export { default as Tabs } from './Tabs.astro';

export { default as Accordion } from './Accordion.astro';

Now, when an Astro page only uses a single component, Astro will send only the necessary script to the page. A page that only imports the <Accordion> component will not receive any <Tab> component’s scripts:

---

import { Accordion } from '@matthewp/my-astro-lib';

---

You should now see more efficient performance with Astro supporting this common library re-export pattern.

Thanks to Ottomated, a community contributor for working on this new feature.

More

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