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

推荐订阅源

P
Proofpoint News Feed
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tailwind CSS Blog
J
Java Code Geeks
Engineering at Meta
Engineering at Meta
博客园_首页
G
Google Developers Blog
有赞技术团队
有赞技术团队
Vercel News
Vercel News
Last Week in AI
Last Week in AI
博客园 - 三生石上(FineUI控件)
Jina AI
Jina AI
IT之家
IT之家
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - Franky
A
About on SuperTechFans
The Register - Security
The Register - Security
腾讯CDC
月光博客
月光博客
GbyAI
GbyAI
博客园 - 叶小钗
Blog — PlanetScale
Blog — PlanetScale
D
Docker
D
DataBreaches.Net
博客园 - 聂微东
C
Check Point Blog
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
F
Full Disclosure
Martin Fowler
Martin Fowler
Apple Machine Learning Research
Apple Machine Learning Research
雷峰网
雷峰网
美团技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
小众软件
小众软件
量子位
L
LangChain Blog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
大猫的无限游戏
大猫的无限游戏
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
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 3.3: Picture component
Nate Moore, Erika, Bjorn Lu, Emanuele Stoppa · 2023-10-12 · via The Astro Blog

Astro 3.3 is out with a brand new, experimental <Picture /> component, improved compatibility for syntax highlighting, package provenance, and a handful of other quality of life improvements.

  • New <Picture /> component
  • Syntax Highlighting improvements
  • Package Provenance
  • Quality of Life Improvements

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

npm install astro@latest

pnpm upgrade astro --latest

yarn upgrade astro --latest

Picture Component

When we announced Better Images in Astro with our built-in image optimization feature, we were proud to share our new vision for working with images. In 3.0 we removed our old image integration, and along with it some existing features we know you were using. We decided to build back better, with a stronger image story that was only getting started.

After a comprehensive RFC and the most highly upvoted PR in Astro’s history, we are incredibly excited to introduce a built-in <Picture /> component!

The new, experimental <Picture /> component can be used to generate a <picture> element with multiple <source> elements.

The example below uses the formats property to generate a <source> in each of the specified image formats:

---

import { Picture } from 'astro:assets';

import myImage from './my-image.jpg';

---

<Picture src={myImage} formats={['avif', 'webp']} alt="My super image in multiple formats!" />

The above code will generate the following HTML, and allow the browser to determine the best image to display:

<picture>

<source srcset="..." type="image/avif" />

<source srcset="..." type="image/webp" />

<img src="..." alt="My super image in multiple formats!" />

</picture>

The Picture component takes all the same props as the Image component, including the new densities and widths properties.

srcset support

In addition to the <Picture /> element, two new properties have been added to Image and getImage(): densities and widths.

These properties can be used to generate a srcset attribute, either based on absolute widths in pixels (e.g. [300, 600, 900]) or pixel density descriptors (e.g. ["2x"] or [1.5, 2]).

---

import { Image } from 'astro';

import myImage from './my-image.jpg';

---

<Image src={myImage} width={myImage.width / 2} densities={[1.5, 2]} alt="My cool image" />

<img

src="/_astro/my_image.hash.webp"

srcset="/_astro/my_image.hash.webp 1.5x, /_astro/my_image.hash.webp 2x"

alt="My cool image"

/>

Syntax Highlighting

We migrated Astro’s internal syntax highlighter library from shiki to shikiji, an ESM-focused alternative that simplifies bundling and maintenance.

There are no new options and no changes to how you author code blocks and syntax highlighting.

While this refactor should be transparent for most projects, shikiji does come with one potentially breaking change. Since shikiji attempts to produce smaller HTML markup, color styles are added to pre or code elements rather than directly to a token’s span. For example:

Before:

<code class="astro-code" style="background-color: #24292e">

<pre>

<span class="line" style="color: #e1e4e8">my code</span>

</pre>

</code>

After:

<code class="astro-code" style="background-color: #24292e; color: #e1e4e8">

<pre>

<span class="line">my code<span>

</pre>

</code>

This does not affect the colors as the span will inherit the color from the parent, but if you’re relying on a specific HTML markup, please check your site carefully after upgrading to verify the styles.

Package Provenance

NPM, the registry which hosts Astro packages, has introduced optional provenance attestations to improve supply-chain security and transparency. These attestations allow developers to verify where and how packages are built.

With the release of Astro 3.3, the astro package and all @astrojs/ integrations are published with a provenance statement. If you maintain an Astro integration, we encourage you to enable provenance attestations when publishing your integration.

Quality of Life Improvements

Additional bug fixes and quality of life improvements are included in this release. Check out the release notes to learn more.