astro 4.11.0
Minor Changes
-
#11197
4b46bd9Thanks @braebo! - AddsShikiTransformersupport to the<Code />component with a newtransformersprop.Note that
transformersonly applies classes and you must provide your own CSS rules to target the elements of your code block.--- import { transformerNotationFocus } from '@shikijs/transformers'; import { Code } from 'astro:components'; const code = `const foo = 'hello' const bar = ' world' console.log(foo + bar) // [!code focus] `; --- <Code {code} lang="js" transformers={[transformerNotationFocus()]} /> <style is:global> pre.has-focused .line:not(.focused) { filter: blur(1px); } </style> -
#11134
9042be0Thanks @florian-lefebvre! - Improves the developer experience of the500.astrofile by passing it a newerrorprop.When an error is thrown, the special
src/pages/500.astropage now automatically receives the error as a prop. This allows you to display more specific information about the error on a custom 500 page.--- // src/pages/500.astro interface Props { error: unknown; } const { error } = Astro.props; --- <div>{error instanceof Error ? error.message : 'Unknown error'}</div>If an error occurs rendering this page, your host's default 500 error page will be shown to your visitor in production, and Astro's default error overlay will be shown in development.
Patch Changes
-
#11280
fd3645fThanks @ascorbic! - Fixes a bug that prevented cookies from being set when using experimental rewrites -
#11275
bab700dThanks @syhily! - Drop duplicated brackets in data collections schema generation. -
#11272
ea987d7Thanks @ematipico! - Fixes a case where rewriting/would cause an issue, whentrailingSlashwas set to"never". -
#11272
ea987d7Thanks @ematipico! - Reverts a logic where it wasn't possible to rewrite/404in static mode. It's now possible again -
#11264
5a9c9a6Thanks @Fryuni! - Fixes type generation for empty content collections -
#11279
9a08d74Thanks @ascorbic! - Improves type-checking and error handling to catch case where an image import is passed directly togetImage() -
#11292
7f8f347Thanks @jdtjenkins! - Fixes a case wheredefineActionautocomplete for theacceptprop would not show"form"as a possible value -
#11273
cb4d078Thanks @ascorbic! - Corrects an inconsistency in dev where middleware would run for prerendered 404 routes. Middleware is not run for prerendered 404 routes in production, so this was incorrect. -
#11284
f4b029bThanks @ascorbic! - Fixes an issue that would breakAstro.request.urlandAstro.request.headersinastro devif HTTP/2 was enabled.HTTP/2 is now enabled by default in
astro devifhttpsis configured in the Vite config.