Major Changes
- #15451
84d6efdThanks @ematipico! - Changes how styles applied to code blocks are emitted to support CSP - (v6 upgrade guidance)
Minor Changes
-
#15529
a509941Thanks @florian-lefebvre! - Adds a new build-in font providernpmto access fonts installed as NPM packagesYou can now add web fonts specified in your
package.jsonthrough Astro's type-safe Fonts API. Thenpmfont provider allows you to add fonts either from locally installed packages innode_modulesor from a CDN.Set
fontProviders.npm()as your fonts provider along with the requirednameandcssVariablevalues, and addoptionsas needed:import { defineConfig, fontProviders } from 'astro/config'; export default defineConfig({ experimental: { fonts: [ { name: 'Roboto', provider: fontProviders.npm(), cssVariable: '--font-roboto', }, ], }, });
See the NPM font provider reference documentation for more details.
-
#15548
5b8f573Thanks @florian-lefebvre! - Adds a new optionalembeddedLangsprop to the<Code />component to support languages beyond the primarylangThis allows, for example, highlighting
.vuefiles with a<script setup lang="tsx">block correctly:--- import { Code } from 'astro:components'; const code = ` <script setup lang="tsx"> const Text = ({ text }: { text: string }) => <div>{text}</div>; </script> <template> <Text text="hello world" /> </template>`; --- <Code {code} lang="vue" embeddedLangs={['tsx']} />
See the
<Code />component documentation for more details. -
#15483
7be3308Thanks @florian-lefebvre! - Addsstreamingoption to thecreateApp()function in the Adapter API, mirroring the same functionality available when creating a newAppinstanceAn adapter's
createApp()function now acceptsstreaming(defaults totrue) as an option. HTML streaming breaks a document into chunks to send over the network and render on the page in order. This normally results in visitors seeing your HTML as fast as possible but factors such as network conditions and waiting for data fetches can block page rendering.HTML streaming helps with performance and generally provides a better visitor experience. In most cases, disabling streaming is not recommended.
However, when you need to disable HTML streaming (e.g. your host only supports non-streamed HTML caching at the CDN level), you can opt out of the default behavior by passing
streaming: falsetocreateApp():import { createApp } from 'astro/app/entrypoint'; const app = createApp({ streaming: false });
See more about the
createApp()function in the Adapter API reference.
Patch Changes
-
#15542
9760404Thanks @rururux! - Improves rendering by preservinghidden="until-found"value in attribues -
#15550
58df907Thanks @florian-lefebvre! - Improves the JSDoc annotations for theAstroAdaptertype -
#15507
07f6610Thanks @matthewp! - Avoid bundling SSR renderers when only API endpoints are dynamic -
#15459
a4406b4Thanks @florian-lefebvre! - Fixes a case wherecontext.cspwas logging warnings in development that should be logged in production only -
Updated dependencies [
84d6efd]:- @astrojs/markdown-remark@7.0.0-beta.7