Aller au contenu
verdict:

Astro 5.16.12

digest

note: la synthèse et les notes de version sont en anglais

note: pas de synthèse pour cette release digest

Les releases digest sont listées sans synthèse. Les notes de version originales de cette version sont ci-dessous.

release-notesgithub.com/withastro/astro · 138 lignes
  1. ### Patch Changes
  2. - [#15175](https://github.com/withastro/astro/pull/15175) [`47ae148`](https://github.com/withastro/astro/commit/47ae1480eecd5da7080f1e659b6aef211aaf3300) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Allows experimental Font providers to specify family options
  3. Previously, an Astro `FontProvider` could only accept options at the provider level when called. That could result in weird data structures for family-specific options.
  4. Astro `FontProvider`s can now declare family-specific options, by specifying a generic:
  5. ```diff
  6. // font-provider.ts
  7. import type { FontProvider } from "astro";
  8. import { retrieveFonts, type Fonts } from "./utils.js",
  9. interface Config {
  10. token: string;
  11. }
  12. +interface FamilyOptions {
  13. + minimal?: boolean;
  14. +}
  15. -export function registryFontProvider(config: Config): FontProvider {
  16. +export function registryFontProvider(config: Config): FontProvider<FamilyOptions> {
  17. let data: Fonts = {}
  18. return {
  19. name: "registry",
  20. config,
  21. init: async () => {
  22. data = await retrieveFonts(token);
  23. },
  24. listFonts: () => {
  25. return Object.keys(data);
  26. },
  27. - resolveFont: ({ familyName, ...rest }) => {
  28. + // options is typed as FamilyOptions
  29. + resolveFont: ({ familyName, options, ...rest }) => {
  30. const fonts = data[familyName];
  31. if (fonts) {
  32. return { fonts };
  33. }
  34. return undefined;
  35. },
  36. };
  37. }
  38. ```
  39. Once the font provider is registered in the Astro config, types are automatically inferred:
  40. ```diff
  41. // astro.config.ts
  42. import { defineConfig } from "astro/config";
  43. import { registryFontProvider } from "./font-provider";
  44. export default defineConfig({
  45. experimental: {
  46. fonts: [{
  47. provider: registryFontProvider({
  48. token: "..."
  49. }),
  50. name: "Custom",
  51. cssVariable: "--font-custom",
  52. + options: {
  53. + minimal: true
  54. + }
  55. }]
  56. }
  57. });
  58. ```
  59. - [#15175](https://github.com/withastro/astro/pull/15175) [`47ae148`](https://github.com/withastro/astro/commit/47ae1480eecd5da7080f1e659b6aef211aaf3300) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only**
  60. Updates how options are passed to the Google and Google Icons font providers when using the experimental Fonts API
  61. Previously, the Google and Google Icons font providers accepted options that were specific to given font families.
  62. These options must now be set using the `options` property instead. For example using the Google provider:
  63. ```diff
  64. import { defineConfig, fontProviders } from "astro/config";
  65. export default defineConfig({
  66. experimental: {
  67. fonts: [{
  68. name: 'Inter',
  69. cssVariable: '--astro-font-inter',
  70. weights: ['300 900'],
  71. - provider: fontProviders.google({
  72. - experimental: {
  73. - variableAxis: {
  74. - Inter: { opsz: ['14..32'] }
  75. - }
  76. - }
  77. - }),
  78. + provider: fontProviders.google(),
  79. + options: {
  80. + experimental: {
  81. + variableAxis: { opsz: ['14..32'] }
  82. + }
  83. + }
  84. }]
  85. }
  86. })
  87. ```
  88. - [#15200](https://github.com/withastro/astro/pull/15200) [`c0595b3`](https://github.com/withastro/astro/commit/c0595b3e71a3811921ddc24e6ed7538c0df53a96) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only**
  89. Removes `getFontData()` exported from `astro:assets` with `fontData` when using the experimental Fonts API
  90. Accessing font data can be useful for advanced use cases, such as generating meta tags or Open Graph images. Before, we exposed a `getFontData()` helper function to retrieve the font data for a given `cssVariable`. That was however limiting for programmatic usages that need to access all font data.
  91. The `getFontData()` helper function is removed and replaced by a new `fontData` object:
  92. ```diff
  93. -import { getFontData } from "astro:assets";
  94. -const data = getFontData("--font-roboto")
  95. +import { fontData } from "astro:assets";
  96. +const data = fontData["--font-roboto"]
  97. ```
  98. We may reintroduce `getFontData()` later on for a more friendly DX, based on your feedback.
  99. - [#15254](https://github.com/withastro/astro/pull/15254) [`8d84b30`](https://github.com/withastro/astro/commit/8d84b3040181018f358b4e5684f9df55949aa4ca) Thanks [@lamalex](https://github.com/lamalex)! - Fixes CSS `assetsPrefix` with remote URLs incorrectly prepending a forward slash
  100. When using `build.assetsPrefix` with a remote URL (e.g., `https://cdn.example.com`) for CSS assets, the generated `<link>` elements were incorrectly getting a `/` prepended to the full URL, resulting in invalid URLs like `/https://cdn.example.com/assets/style.css`.
  101. This fix checks if the stylesheet link is a remote URL before prepending the forward slash.
  102. - [#15178](https://github.com/withastro/astro/pull/15178) [`731f52d`](https://github.com/withastro/astro/commit/731f52dd68c538a3372d4ac078e72d1090cc4cce) Thanks [@kedarvartak](https://github.com/kedarvartak)! - Fixes an issue where stopping the dev server with `q+enter` incorrectly created a `dist` folder and copied font files when using the experimental Fonts API
  103. - [#15230](https://github.com/withastro/astro/pull/15230) [`3da6272`](https://github.com/withastro/astro/commit/3da62721f02e7cbf1344ae9766ca73cae71b23c8) Thanks [@rahuld109](https://github.com/rahuld109)! - Fixes greedy regex in error message markdown rendering that caused link syntax examples to capture extra characters
  104. - [#15253](https://github.com/withastro/astro/pull/15253) [`2a6315a`](https://github.com/withastro/astro/commit/2a6315a3a38273ed47e4aa16a4dd9449fc7927c9) Thanks [@matthewp](https://github.com/matthewp)! - Fixes hydration for React components nested inside HTML elements in MDX files
  105. - [#15227](https://github.com/withastro/astro/pull/15227) [`9a609f4`](https://github.com/withastro/astro/commit/9a609f4a6264fc2238e02cffb00a9285f4a10973) Thanks [@matthewp](https://github.com/matthewp)! - Fixes styles not being included for conditionally rendered Svelte 5 components in production builds
  106. - [#14607](https://github.com/withastro/astro/pull/14607) [`ee52160`](https://github.com/withastro/astro/commit/ee52160f3374f65d1a8cb460c1340172902313bc) Thanks [@simensfo](https://github.com/simensfo)! - Reintroduces css deduplication for hydrated client components. Ensures assets already added to a client chunk are not flagged as orphaned

voir sur githubimported 2026-09-28 via npm