astro@4.4.0
版本发布时间: 2024-02-15 19:01:43
withastro/astro最新发布版本:astro@5.0.0-beta.2(2024-09-24 17:12:05)
Minor Changes
-
#9614
d469bebd7b45b060dc41d82ab1cf18ee6de7e051
Thanks @matthewp! - Improves Node.js streaming performance.This uses an
AsyncIterable
instead of aReadableStream
to do streaming in Node.js. This is a non-standard enhancement by Node, which is done only in that environment. -
#10001
748b2e87cd44d8bcc1ab9d7e504703057e2000cd
Thanks @bholmesdev! - Removes content collection warning when a configured collection does not have a matching directory name. This should resolvei18n
collection warnings for Starlight users.This also ensures configured collection names are always included in
getCollection()
andgetEntry()
types even when a matching directory is absent. We hope this allows users to discover typos during development by surfacing type information. -
#10074
7443929381b47db0639c49a4d32aec4177bd9102
Thanks @Princesseuh! - Add a UI showing the list of found problems when using the audit app in the dev toolbar -
#10099
b340f8fe3aaa81e38c4f1aa41498b159dc733d86
Thanks @martrapp! - Fixes a regression where view transition names containing special characters such as spaces or punctuation stopped working.Regular use naming your transitions with
transition: name
is unaffected.However, this fix may result in breaking changes if your project relies on the particular character encoding strategy Astro uses to translate
transition:name
directives into values of the underlying CSSview-transition-name
property. For example,Welcome to Astro
is now encoded asWelcome_20to_20Astro_2e
.This mainly affects spaces and punctuation marks but no Unicode characters with codes >= 128.
-
#9976
91f75afbc642b6e73dd4ec18a1fe2c3128c68132
Thanks @OliverSpeir! - Adds a new optionalastro:assets
image attributeinferSize
for use with remote images.Remote images can now have their dimensions inferred just like local images. Setting
inferSize
totrue
allows you to usegetImage()
and the<Image />
and<Picture />
components without setting thewidth
andheight
properties.--- import { Image, Picture, getImage } from 'astro:assets'; const myPic = await getImage({ src: 'https://example.com/example.png', inferSize: true }); --- <Image src="https://example.com/example.png" inferSize alt="" /> <Picture src="https://example.com/example.png" inferSize alt="" />
Read more about using
inferSize
with remote images in our documentation. -
#10015
6884b103c8314a43e926c6acdf947cbf812a21f4
Thanks @Princesseuh! - Adds initial support for performance audits to the dev toolbar
Patch Changes
-
#10116
4bcc249a9f34aaac59658ca626c828bd6dbb8046
Thanks @lilnasy! - Fixes an issue where the dev server froze when typescript aliases were used. -
#10096
227cd83a51bbd451dc223fd16f4cf1b87b8e44f8
Thanks @Fryuni! - Fixes regression on routing priority for multi-layer index pagesThe sorting algorithm positions more specific routes before less specific routes, and considers index pages to be more specific than a dynamic route with a rest parameter inside of it. This means that
/blog
is considered more specific than/blog/[...slug]
.But this special case was being applied incorrectly to indexes, which could cause a problem in scenarios like the following:
-
/
-
/blog
-
/blog/[...slug]
The algorithm would make the following comparisons:
-
/
is more specific than/blog
(incorrect) -
/blog/[...slug]
is more specific than/
(correct) -
/blog
is more specific than/blog/[...slug]
(correct)
Although the incorrect first comparison is not a problem by itself, it could cause the algorithm to make the wrong decision. Depending on the other routes in the project, the sorting could perform just the last two comparisons and by transitivity infer the inverse of the third (
/blog/[...slug
>/
>/blog
), which is incorrect.Now the algorithm doesn't have a special case for index pages and instead does the comparison soleley for rest parameter segments and their immediate parents, which is consistent with the transitivity property.
-
-
#10120
787e6f52470cf07fb50c865948b2bc8fe45a6d31
Thanks @bluwy! - Updates and supports Vite 5.1 -
#10096
227cd83a51bbd451dc223fd16f4cf1b87b8e44f8
Thanks @Fryuni! - Fixes edge case on i18n fallback routesPreviously index routes deeply nested in the default locale, like
/some/nested/index.astro
could be mistaked as the root index for the default locale, resulting in an incorrect redirect on/
. -
#10112
476b79a61165d0aac5e98459a4ec90762050a14b
Thanks @Princesseuh! - Renames the home Astro Devoolbar App toastro:home
-
#10117
51b6ff7403c1223b1c399e88373075972c82c24c
Thanks @hippotastic! - Fixes an issue wherecreate astro
,astro add
and@astrojs/upgrade
would fail due to unexpected package manager CLI output.