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

推荐订阅源

K
Kaspersky official blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AI
AI
SecWiki News
SecWiki News
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Engineering at Meta
Engineering at Meta
博客园 - 叶小钗
The GitHub Blog
The GitHub Blog
Microsoft Azure Blog
Microsoft Azure Blog
N
News and Events Feed by Topic
Cloudbric
Cloudbric
B
Blog
Cisco Talos Blog
Cisco Talos Blog
V
Vulnerabilities – Threatpost
N
News and Events Feed by Topic
V
Visual Studio Blog
A
Arctic Wolf
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42
S
Security @ Cisco Blogs
博客园 - 聂微东
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
G
GRAHAM CLULEY
L
LINUX DO - 热门话题
量子位
NISL@THU
NISL@THU
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Troy Hunt's Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Tenable Blog
月光博客
月光博客
S
Security Affairs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
The Hacker News
The Hacker News
Spread Privacy
Spread Privacy
D
Docker
www.infosecurity-magazine.com
www.infosecurity-magazine.com
雷峰网
雷峰网
博客园 - 司徒正美
T
The Exploit Database - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Help Net Security
Help Net Security
D
DataBreaches.Net

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.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 4.5
Astro 4.15
Matthew Phillips, Erika, Ben Holmes · 2024-08-29 · via The Astro Blog

Astro 4.15 is out now! This release stabilizes Astro Actions — our solution for fully type-safe backend functions. Also included: support for libSQL remotes in Astro DB, a new timeout option for client:idle, and more.

This release includes the following highlights:

  • Stable: Astro Actions
  • Use rewrites for i18n fallbacks
  • libSQL remotes in @astrojs/db
  • Timeout option in client:idle
  • Swap helpers available for ViewTransitions customizations

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

Stable: Astro Actions

Astro Actions are out of experimental and ready to help build your next backend.

Actions handle type-safe data fetching, JSON parsing, and input validation for you. This dramatically reduces the amount of boilerplate needed compared to using an API endpoint.

// Before

export const POST = ({ request }) => {

const contentType = request.headers.get('Content-Type');

if (contentType !== 'application/json') return new Response('Unsupported body', { status: 415 });

const json = await request.json();

const input = z.object({ email: z.string().email() }).safeParse(json);

if (!input.success) return new Response(JSON.stringify(input.error), { status: 400 });

// ...50 more lines

}

// After

defineAction({

input: z.object({ email: z.string().email() }),

handler: ({ name }) => { /* ... */ },

})

Actions can be called from client-side components and HTML forms. This gives you the flexibility to build apps using any technology, like React, Svelte, script tags, or just plain Astro components. This example calls a newsletter action and renders the result using an Astro component:

---

import { actions } from 'astro:actions';

const result = Astro.getActionResult(actions.newsletter);

---

{result && !result.error && <p>Thanks for signing up!</p>}

<form method="POST" action={actions.newsletter}>

<input type="email" name="email" />

<button>Sign up</button>

</form>

For more information and usage examples, see our new Actions guide.

Rewrites in i18n fallbacks

A new option was added to internationalization (i18n) routing which allows more control over how fallbacks are handled. You can now specify whether a fallback results in a rewrite (a 200 response from the server) or a redirect, the current default.

The fallback system in i18n allows you to define which content is used for a locale when that content is not available in the user’s locale. For example, your config might look like this:

import { defineConfig } from "astro/config"

export default defineConfig({

i18n: {

defaultLocale: "en",

locales: ["es", "en", "fr"],

fallback: {

fr: "es"

},

routing: {

fallbackType: "rewrite"

}

}

})

For more information on this new feature, see our revamped documentation on handling fallbacks in i18n.

libSQL remotes in Astro DB

You can now specify a libSQL server instance as the remote for @astrojs/db. This allows you to self-host your own libSQL server as an alternative to using Astro DB with Astro Studio. This option works with any supported libSQL protocol.

To use this feature, set the following environment variables:

  • ASTRO_DB_REMOTE_URL: the connection URL to your libSQL server.
  • ASTRO_DB_APP_TOKEN: the auth token to your libSQL server.

Enabling this feature allows you to connect to the libSQL server in your production environment and also allows you to use the Astro DB deployment and push (migration) commands with the libSQL instance. Thanks to Fryuni for this amazing contribution!

For more information on using libSQL servers in Astro DB, visit our Astro DB guide.

Timeout option in client:idle

The client:idle directive is used to load an Astro Island when the user’s CPU is idle (which no other JavaScript is executing). Under the hood, this feature relies on the requestIdleCallback feature of browsers.

In Astro 4.15, you can now specify a timeout property that will trigger hydration to ensure your element is interactive within a specified time frame. This is useful to add priority to a component that might be competing with other idle components.

{/* Component loads after a maximum wait of 500ms */}

<Counter id="client-idle-timeout" {...someProps} client:idle={{ timeout: 500 }}>

<h1>Hello, client:idle={'{{timeout: 500}}'}!</h1>

</Counter>

Thanks to ph1p for this contribution.

Swap helpers for ViewTransitions

Astro’s <ViewTransitions /> router gives you the UX of a single-page app (SPA) while preserving the DX of an Astro multi-page app (MPA). It does this by fetching pages on navigation and swapping the content for client-side routing. In some cases, you might want more control over how the swap works, which can be done by overriding the swap in the astro:before-swap event.

In Astro 4.15, the built-in swap functions are now exported from astro:transitions/client. These helpers allow you to use parts of what Astro does by default, and add your own custom logic in between.

<script>

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

document.addEventListener('astro:before-swap', (e) => {

e.swap = () => swapMainOnly(e.newDocument);

});

function swapMainOnly(doc: Document) {

swapFunctions.deselectScripts(doc);

swapFunctions.swapRootAttributes(doc);

swapFunctions.swapHeadElements(doc);

const restoreFocusFunction = swapFunctions.saveFocus();

const newMain = doc.querySelector('main');

const oldMain = document.querySelector('main');

if (newMain && oldMain) {

swapFunctions.swapBodyElement(newMain, oldMain);

} else {

swapFunctions.swapBodyElement(doc.body, document.body);

}

restoreFocusFunction();

}

<script>

Check out the docs for more information about building your own custom swap function and be sure to share with us what you create!

Thanks to martrapp for this contribution.

Bug Fixes and Special Thanks

As we do, Astro 4.15 includes more bug fixes and smaller improvements that couldn’t make it into this post! Check out the full release notes to learn more.

Thanks to Sarah Rainsberger (@sarah11918), Yan (@yanthomasdev), Bjorn Lu (@bluwy), Emanuele Stoppa (@ematipico), Chris Swithinbank (@delucis), and everyone else who contributed to this release.