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

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
L
LangChain Blog
人人都是产品经理
人人都是产品经理
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
博客园 - 【当耐特】
量子位
有赞技术团队
有赞技术团队
Jina AI
Jina AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园_首页
C
Check Point Blog
B
Blog RSS Feed
M
MIT News - Artificial intelligence
H
Help Net Security
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans
腾讯CDC

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 3.2: View Transitions improvements
Matthew Phillips, Martin Trapp, Chris Swithinbank · 2023-09-28 · via The Astro Blog

Astro 3.2 is out with several new improvements that make view transitions and integrations even easier to use:

  • Control the browser history stack
  • Trigger page navigation via JavaScript
  • Route announcer for screen readers
  • Dynamically add integrations

To take advantage of the latest view transitions features, make sure you’re running the latest version of Astro. You can upgrade to Astro 3.2 by running the upgrade command for your package manager of choice:

npm install astro@latest

pnpm upgrade astro --latest

yarn upgrade astro --latest

You can now configure individual links to prevent a new history entry from being added to the browser stack on navigation. Add the data-astro-history="replace" attribute to any <a> tag and Astro will instead use the underlying history.replaceState API. Use this for fewer back button clicks, or to avoid sending readers back to pages like form submission confirmations.

<a href="/toggle" data-astro-history="replace">Toggle me</a>

JavaScript Navigation API

You can now trigger navigations from your client-side JavaScript via the new navigate() API. Previously transitions only occurred when the user clicked anchor links. With the new navigation API you have complete control over when navigation occurs.

import { navigate } from 'astro:transitions/client';

// Navigate to the selected option automatically.

document.querySelector('select').onchange = (ev) => {

let href = ev.target.value;

navigate(href);

};

Additionally, you have control over the history stack with this method via the history option, which works just like the data-astro-history attribute:

import { navigate } from 'astro:transitions/client';

navigate(href, {

history: 'replace'

});

Route Announcer

The View Transitions router now does route announcements. When transitioning between pages with a traditional MPA approach, assistive technologies will announce the page title when the page finishes loading. This does not automatically happen during client-side routing, so visitors relying on these technologies to announce routes are not aware when a page has changed.

The view transitions route announcer runs after the astro:page-load event, looking for the page <title> to announce. If one cannot be found, the announcer falls back to the first <h1> it finds or otherwise announces the pathname. We recommend you always include a <title> on each page for accessibility.

See the View Transitions docs for more on how accessibility is handled.

Dynamically Added Integrations

Integrations themselves can now dynamically add and configure additional integrations during set-up. This makes it possible for integration authors to bundle integrations more intelligently for their users.

In the following example, a custom integration checks whether @astrojs/sitemap is already configured. If not, the integration adds Astro’s sitemap integration, passing any desired configuration options:

import sitemap from '@astrojs/sitemap';

import type { AstroIntegration } from 'astro';

const MyIntegration = (): AstroIntegration => {

return {

name: 'my-integration',

'astro:config:setup': ({ config, updateConfig }) => {

// Look for sitemap in user-configured integrations.

const userSitemap = config.integrations.find(

({ name }) => name === '@astrojs/sitemap'

);

if (!userSitemap) {

// If sitemap wasn’t found, add it.

updateConfig({

integrations: [sitemap({ /* opts */ }],

});

}

},

};

};

More

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