Conversation
7695bba to
e6a349f
Compare
e6a349f to
35bd384
Compare
35bd384 to
cbf8ba3
Compare
5954b3b to
90f2a8a
Compare
90f2a8a to
4d31ca4
Compare
4d31ca4 to
fbaa981
Compare
fbaa981 to
ea4cc30
Compare
ea4cc30 to
749869e
Compare
749869e to
82aab51
Compare
82aab51 to
5f6b8c9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
5.16.11->5.17.12.3.7->2.4.0Release Notes
withastro/astro (astro)
v5.17.1Compare Source
Patch Changes
#15334
d715f1fThanks @florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API onlyRemoves the
getFontBuffer()helper function exported fromastro:assetswhen using the experimental Fonts APIThis experimental feature introduced in v15.6.13 ended up causing significant memory usage during build. This feature has been removed and will be reintroduced after further exploration and testing.
If you were relying on this function, you can replicate the previous behavior manually:
node:fsfontDataandcontext.urlv5.17.0Compare Source
Minor Changes
#14932
b19d816Thanks @patrickarlt! - Adds support for returning a Promise from theparser()option of thefile()loaderThis enables you to run asynchronous code such as fetching remote data or using async parsers when loading files with the Content Layer API.
For example:
See the
parser()reference documentation for more information.#15171
f220726Thanks @mark-ignacio! - Adds a new, optionalkernelconfiguration option to select a resize algorithm in the Sharp image serviceBy default, Sharp resizes images with the
lanczos3kernel. This new config option allows you to set the default resizing algorithm to any resizing option supported by Sharp (e.g.linear,mks2021).Kernel selection can produce quite noticeable differences depending on various characteristics of the source image - especially drawn art - so changing the kernel gives you more control over the appearance of images on your site:
This selection will apply to all images on your site, and is not yet configurable on a per-image basis. For more information, see Sharps documentation on resizing images.
#15063
08e0fd7Thanks @jmortlock! - Adds a newpartitionedoption when setting a cookie to allow creating partitioned cookies.Partitioned cookies can only be read within the context of the top-level site on which they were set. This allows cross-site tracking to be blocked, while still enabling legitimate uses of third-party cookies.
You can create a partitioned cookie by passing
partitioned: truewhen setting a cookie. Note that partitioned cookies must also be set withsecure: true:For more information, see the
AstroCookieSetOptionsAPI reference.#15022
f1fce0eThanks @ascorbic! - Adds a newretainBodyoption to theglob()loader to allow reducing the size of the data store.Currently, the
glob()loader stores the raw body of each content file in the entry, in addition to the rendered HTML.The
retainBodyoption defaults totrue, but you can set it tofalseto prevent the raw body of content files from being stored in the data store. This significantly reduces the deployed size of the data store and helps avoid hitting size limits for sites with very large collections.The rendered body will still be available in the
entry.rendered.htmlproperty for markdown files, and theentry.filePathproperty will still point to the original file.When
retainBodyisfalse,entry.bodywill beundefinedinstead of containing the raw file contents.#15153
928529fThanks @jcayzac! - Adds a newbackgroundproperty to the<Image />component.This optional property lets you pass a background color to flatten the image with. By default, Sharp uses a black background when flattening an image that is being converted to a format that does not support transparency (e.g.
jpeg). Providing a value forbackgroundon an<Image />component, or passing it to thegetImage()helper, will flatten images using that color instead.This is especially useful when the requested output format doesn't support an alpha channel (e.g.
jpeg) and can't support transparent backgrounds.v5.16.16Compare Source
Patch Changes
#15281
a1b80c6Thanks @matthewp! - Ensures server island requests carry an encrypted component export identifier so they do not accidentally resolve to the wrong component.#15304
02ee3c7Thanks @cameronapak! - Fix: Remove await from getActionResult example#15324
ab41c3eThanks @Princesseuh! - Fixes an issue where certain unauthorized links could be rendered as clickable in the error overlayv5.16.15Compare Source
Patch Changes
0aafc83Thanks @florian-lefebvre! - Fixes a case where font providers provided as class instances may not work when using the experimental Fonts API. It affected the local providerv5.16.14Compare Source
Patch Changes
#15213
c775fceThanks @florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API onlyUpdates how the local provider must be used when using the experimental Fonts API
Previously, there were 2 kinds of font providers: remote and local.
Font providers are now unified. If you are using the local provider, the process for configuring local fonts must be updated:
Once configured, there is no change to using local fonts in your project. However, you should inspect your deployed site to confirm that your new font configuration is being applied.
See the experimental Fonts API docs for more information.
#15213
c775fceThanks @florian-lefebvre! - ExposesrootonFontProviderinit()contextWhen building a custom
FontProviderfor the experimental Fonts API, theinit()method receives acontext. This context now exposes arootURL, useful for resolving local files:import type { FontProvider } from "astro"; export function registryFontProvider(): FontProvider { return { // ... - init: async ({ storage }) => { + init: async ({ storage, root }) => { // ... }, }; }#15185
edabeaaThanks @EricGrill! - Add.vercelto.gitignorewhen adding the Vercel adapter viaastro add vercelv5.16.13Compare Source
Patch Changes
#15182
cb60ee1Thanks @florian-lefebvre! - Adds a newgetFontBuffer()method to retrieve font file buffers when using the experimental Fonts APIThe
getFontData()helper function fromastro:assetswas introduced in 5.14.0 to provide access to font family data for use outside of Astro. One of the goals of this API was to be able to retrieve buffers using URLs.However, it turned out to be impactical and even impossible during prerendering.
Astro now exports a new
getFontBuffer()helper function fromastro:assetsto retrieve font file buffers from URL returned bygetFontData(). For example, when using satori to generate OpenGraph images:// src/pages/og.png.ts import type{ APIRoute } from "astro" -import { getFontData } from "astro:assets" +import { getFontData, getFontBuffer } from "astro:assets" import satori from "satori" export const GET: APIRoute = (context) => { const data = getFontData("--font-roboto") const svg = await satori( <div style={{ color: "black" }}>hello, world</div>, { width: 600, height: 400, fonts: [ { name: "Roboto", - data: await fetch(new URL(data[0].src[0].url, context.url.origin)).then(res => res.arrayBuffer()), + data: await getFontBuffer(data[0].src[0].url), weight: 400, style: "normal", }, ], }, ) // ... }See the experimental Fonts API documentation for more information.
v5.16.12Compare Source
Patch Changes
#15175
47ae148Thanks @florian-lefebvre! - Allows experimental Font providers to specify family optionsPreviously, an Astro
FontProvidercould only accept options at the provider level when called. That could result in weird data structures for family-specific options.Astro
FontProviders can now declare family-specific options, by specifying a generic:// font-provider.ts import type { FontProvider } from "astro"; import { retrieveFonts, type Fonts } from "./utils.js", interface Config { token: string; } +interface FamilyOptions { + minimal?: boolean; +} -export function registryFontProvider(config: Config): FontProvider { +export function registryFontProvider(config: Config): FontProvider<FamilyOptions> { let data: Fonts = {} return { name: "registry", config, init: async () => { data = await retrieveFonts(token); }, listFonts: () => { return Object.keys(data); }, - resolveFont: ({ familyName, ...rest }) => { + // options is typed as FamilyOptions + resolveFont: ({ familyName, options, ...rest }) => { const fonts = data[familyName]; if (fonts) { return { fonts }; } return undefined; }, }; }Once the font provider is registered in the Astro config, types are automatically inferred:
// astro.config.ts import { defineConfig } from "astro/config"; import { registryFontProvider } from "./font-provider"; export default defineConfig({ experimental: { fonts: [{ provider: registryFontProvider({ token: "..." }), name: "Custom", cssVariable: "--font-custom", + options: { + minimal: true + } }] } });#15175
47ae148Thanks @florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API onlyUpdates how options are passed to the Google and Google Icons font providers when using the experimental Fonts API
Previously, the Google and Google Icons font providers accepted options that were specific to given font families.
These options must now be set using the
optionsproperty instead. For example using the Google provider:import { defineConfig, fontProviders } from "astro/config"; export default defineConfig({ experimental: { fonts: [{ name: 'Inter', cssVariable: '--astro-font-inter', weights: ['300 900'], - provider: fontProviders.google({ - experimental: { - variableAxis: { - Inter: { opsz: ['14..32'] } - } - } - }), + provider: fontProviders.google(), + options: { + experimental: { + variableAxis: { opsz: ['14..32'] } + } + } }] } })#15200
c0595b3Thanks @florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API onlyRemoves
getFontData()exported fromastro:assetswithfontDatawhen using the experimental Fonts APIAccessing 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 givencssVariable. That was however limiting for programmatic usages that need to access all font data.The
getFontData()helper function is removed and replaced by a newfontDataobject:We may reintroduce
getFontData()later on for a more friendly DX, based on your feedback.#15254
8d84b30Thanks @lamalex! - Fixes CSSassetsPrefixwith remote URLs incorrectly prepending a forward slashWhen using
build.assetsPrefixwith 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.This fix checks if the stylesheet link is a remote URL before prepending the forward slash.
#15178
731f52dThanks @kedarvartak! - Fixes an issue where stopping the dev server withq+enterincorrectly created adistfolder and copied font files when using the experimental Fonts API#15230
3da6272Thanks @rahuld109! - Fixes greedy regex in error message markdown rendering that caused link syntax examples to capture extra characters#15253
2a6315aThanks @matthewp! - Fixes hydration for React components nested inside HTML elements in MDX files#15227
9a609f4Thanks @matthewp! - Fixes styles not being included for conditionally rendered Svelte 5 components in production builds#14607
ee52160Thanks @simensfo! - Reintroduces css deduplication for hydrated client components. Ensures assets already added to a client chunk are not flagged as orphanedsurjithctly/astro-navbar (astro-navbar)
v2.4.0Compare Source
Full Changelog: surjithctly/astro-navbar@v2.3.9...v2.4.0
v2.3.9Compare Source
Fixed: Add
is:inlineto script.Full Changelog: surjithctly/astro-navbar@v2.3.8...v2.3.9
v2.3.8Compare Source
Fixed: Navbar doesn't keep style on scroll after View transitions: See: https://github.com/surjithctly/astro-navbar/issues/29
Thanks @KemaneWright and @Mesuva
Full Changelog: surjithctly/astro-navbar@v2.3.7...v2.3.8
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Renovate Bot.