Open
Conversation
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:
^4.4.2→^5.0.0^5.17.2→^6.0.0Release Notes
withastro/astro (@astrojs/react)
v5.0.0Compare Source
Major Changes
#14427
e131261Thanks @florian-lefebvre! - Increases minimum Node.js version to 22.12.0 - (v6 upgrade guidance)#14445
ecb0b98Thanks @florian-lefebvre! - Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler - (v6 upgrade guidance)Minor Changes
72f7960Thanks @ocavue! - Update@vitejs/plugin-reactto v5.Patch Changes
#15187
bbb5811Thanks @matthewp! - Update to Astro 6 beta#15264
11efb05Thanks @florian-lefebvre! - Lower the Node version requirement to allow running on Stackblitz until it supports v22#15700
4e7f3e8Thanks @ocavue! - Improves how React components are identified when setting theincludeand/orexcludeoptions in projects where multiple JSX frameworks are used togetherUpdated dependencies [
4ebc1e3,4e7f3e8,a164c77,cf6ea6b,a18d727,240c317,745e632]:withastro/astro (astro)
v6.0.0Compare Source
Major Changes
#14446
ece667aThanks @florian-lefebvre! - RemovesentryPointsonastro:build:ssrhook (Integration API) - (v6 upgrade guidance)#15535
dfe2e22Thanks @florian-lefebvre! - DeprecatesloadManifest()andloadApp()fromastro/app/node(Adapter API) - (v6 upgrade guidance)#15006
f361730Thanks @florian-lefebvre! - Removes sessiontestdriver - (v6 upgrade guidance)#15461
9f21b24Thanks @florian-lefebvre! - BREAKING CHANGE to the v6 beta Adapter API only: renamesentryTypetoentrypointResolutionand updates possible valuesAstro 6 introduced a way to let adapters have more control over the entrypoint by passing
entryType: 'self'tosetAdapter(). However during beta development, the name was unclear and confusing.entryTypeis now renamed toentrypointResolutionand its possible values are updated:legacy-dynamicbecomesexplicit.selfbecomesauto.If you are building an adapter with v6 beta and specifying
entryType, update it:setAdapter({ // ... - entryType: 'legacy-dynamic' + entrypointResolution: 'explicit' }) setAdapter({ // ... - entryType: 'self' + entrypointResolution: 'auto' })#14426
861b9ccThanks @florian-lefebvre! - Removes the deprecatedemitESMImage()function - (v6 upgrade guidance)#15006
f361730Thanks @florian-lefebvre! - Deprecates session driver string signature - (v6 upgrade guidance)#15180
8780ff2Thanks @Princesseuh! - Adds support for converting SVGs to raster images (PNGs, WebP, etc) to the default Sharp image service - (v6 upgrade guidance)#14446
ece667aThanks @florian-lefebvre! - Removesroutesonastro:build:donehook (Integration API) - (v6 upgrade guidance)#15424
33d6146Thanks @Princesseuh! - Throws an error whengetImage()fromastro:assetsis called on the client - (v6 upgrade guidance)#14462
9fdfd4cThanks @florian-lefebvre! - Removes the oldapp.render()signature (Adapter API) - (v6 upgrade guidance)#14956
0ff51dfThanks @matthewp! - Astro v6.0 upgrades to Zod v4 for schema validation - (v6 upgrade guidance)#14759
d7889f7Thanks @florian-lefebvre! - Updates how schema types are inferred for content loaders with schemas (Loader API) - (v6 upgrade guidance)#15192
ada2808Thanks @gameroman! - Removes support for CommonJS config files - (v6 upgrade guidance)#14462
9fdfd4cThanks @florian-lefebvre! - Removesprefetch()withoption - (v6 upgrade guidance)#14306
141c4a2Thanks @ematipico! - Removes support for routes with percent-encoded percent signs (e.g.%25) - (v6 upgrade guidance)#14432
b1d87ecThanks @florian-lefebvre! - DeprecatesAstroingetStaticPaths()- (v6 upgrade guidance)#14759
d7889f7Thanks @florian-lefebvre! - Removes the option to define dynamic schemas in content loaders as functions and adds a new equivalentcreateSchema()property (Loader API) - (v6 upgrade guidance)#14457
049da87Thanks @florian-lefebvre! - Updates trailing slash behavior of endpoint URLs - (v6 upgrade guidance)#14494
727b0a2Thanks @florian-lefebvre! - Updates Markdown heading ID generation - (v6 upgrade guidance)#14461
55a1a91Thanks @florian-lefebvre! - Deprecatesimport.meta.env.ASSETS_PREFIX- (v6 upgrade guidance)#14586
669ca5bThanks @ocavue! - Changes the values allowed inparamsreturned bygetStaticPaths()- (v6 upgrade guidance)#15668
1118ac4Thanks @florian-lefebvre! - Changes TypeScript configuration - (v6 upgrade guidance)#14421
df6d2d7Thanks @florian-lefebvre! - Removes the previously deprecatedAstro.glob()- (v6 upgrade guidance)#15049
beddfebThanks @Ntale3! - Removes the ability to render Astro components in Vitest client environments - (v6 upgrade guidance)#15461
9f21b24Thanks @florian-lefebvre! - DeprecatescreateExports()andstart()(Adapter API) - (v6 upgrade guidance)#15535
dfe2e22Thanks @florian-lefebvre! - DeprecatesNodeAppfromastro/app/node(Adapter API) - (v6 upgrade guidance)#14462
9fdfd4cThanks @florian-lefebvre! - Removes thehandleFormsprop for the<ClientRouter />component - (v6 upgrade guidance)#14427
e131261Thanks @florian-lefebvre! - Increases minimum Node.js version to 22.12.0 - (v6 upgrade guidance)#15332
7c55f80Thanks @matthewp! - Adds frontmatter parsing support torenderMarkdownin content loaders. When markdown content includes frontmatter, it is now extracted and available inmetadata.frontmatter, and excluded from the HTML output. This makesrenderMarkdownbehave consistently with theglobloader.#14400
c69c7deThanks @ellielok! - Removes the deprecated<ViewTransitions />component - (v6 upgrade guidance)#14306
141c4a2Thanks @ematipico! - RemovesRouteData.generatefrom the Integration API - (v6 upgrade guidance)#14406
4f11510Thanks @florian-lefebvre! - Changes the default routing configuration value ofi18n.routing.redirectToDefaultLocalefromtruetofalse- (v6 upgrade guidance)#14989
73e8232Thanks @florian-lefebvre! - Deprecates exposedastro:transitionsinternals - (v6 upgrade guidance)#15726
6f19eccThanks @ocavue! - Updates dependencyshikito v4Check Shiki's upgrade guide.
#14758
010f773Thanks @florian-lefebvre! - Removes thesetManifestDatamethod fromAppandNodeApp(Adapter API) - (v6 upgrade guidance)#14477
25fe093Thanks @florian-lefebvre! - Removesrewrite()from Actions context - (v6 upgrade guidance)#14826
170f64eThanks @florian-lefebvre! - Removes theexperimental.failOnPrerenderConflictflag and replaces it with a new configuration optionprerenderConflictBehavior- (v6 upgrade guidance)#14923
95a1969Thanks @florian-lefebvre! - Deprecatesastro:schemaandzfromastro:contentin favor ofastro/zod- (v6 upgrade guidance)#14844
8d43b1dThanks @trueberryless! - Removes exposedastro:actionsinternals - (v6 upgrade guidance)#14306
141c4a2Thanks @ematipico! - Changes the shape ofSSRManifestproperties and adds several new required properties in the Adapter API - (v6 upgrade guidance)#15266
f7c9365Thanks @florian-lefebvre! - AllowsAstro.cspandcontext.cspto be undefined instead of throwing errors whencsp: trueis not configuredWhen using the experimental Content Security Policy feature in Astro 5.x,
context.cspwas always defined but would throw ifexperimental.cspwas not enabled in the Astro config.For the stable version of this API in Astro 6,
context.cspcan now be undefined if CSP is not enabled and its methods will never throw.What should I do?
If you were using experimental CSP runtime utilities, you must now access methods conditionally:
#14445
ecb0b98Thanks @florian-lefebvre! - Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler - (v6 upgrade guidance)#15407
aedbbd8Thanks @ematipico! - Changes how styles of responsive images are emitted - (v6 upgrade guidance)#14306
141c4a2Thanks @ematipico! - Changes integration hooks and HMR access patterns in the Integration API - (v6 upgrade guidance)#14306
141c4a2Thanks @ematipico! - Removes the unusedastro:ssr-manifestvirtual module - (v6 upgrade guidance)#14485
6f67c6eThanks @florian-lefebvre! - Updatesimport.meta.envvalues to always be inlined - (v6 upgrade guidance)#14480
36a461bThanks @florian-lefebvre! - Updates<script>and<style>tags to render in the order they are defined - (v6 upgrade guidance)#14407
3bda3ceThanks @ascorbic! - Removes legacy content collection support - (v6 upgrade guidance)Minor Changes
#14306
141c4a2Thanks @ematipico! - Adds new optional properties tosetAdapter()for adapter entrypoint handling in the Adapter APIChanges:
entryType?: 'self' | 'legacy-dynamic'- determines if the adapter provides its own entrypoint ('self') or if Astro constructs one ('legacy-dynamic', default)Migration: Adapter authors can optionally add these properties to support custom dev entrypoints. If not specified, adapters will use the legacy behavior.
#15700
4e7f3e8Thanks @ocavue! - Updates the internal logic during SSR by providing additional metadata for UI framework integrations.#15231
3928b87Thanks @rururux! - Adds a new optionalgetRemoteSize()method to the Image Service API.Previously,
inferRemoteSize()had a fixed implementation that fetched the entire image to determine its dimensions.With this new helper function that extends
inferRemoteSize(), you can now override or extend how remote image metadata is retrieved.This enables use cases such as:
For example, you can add a simple cache layer to your existing image service:
See the Image Services API reference documentation for more information.
#15077
a164c77Thanks @matthewp! - Updates the Integration API to addsetPrerenderer()to theastro:build:starthook, allowing adapters to provide custom prerendering logic.The new API accepts either an
AstroPrerendererobject directly, or a factory function that receives the default prerenderer:Also adds the
astro:static-pathsvirtual module, which exports aStaticPathsclass for adapters to collect all prerenderable paths from within their target runtime. This is useful when implementing a custom prerenderer that runs in a non-Node environment:See the adapter reference for more details on implementing a custom prerenderer.
#15345
840fbf9Thanks @matthewp! - Adds a newemitClientAssetfunction toastro/assets/utilsfor integration authors. This function allows emitting assets that will be moved to the client directory during SSR builds, useful for assets referenced in server-rendered content that need to be available on the client.#15460
ee7e53fThanks @florian-lefebvre! - Updates the Adapter API to allow providing aserverEntrypointwhen usingentryType: 'self'Astro 6 introduced a new powerful yet simple Adapter API for defining custom server entrypoints. You can now call
setAdapter()with theentryType: 'self'option and specify your customserverEntrypoint:If you need further customization at the Vite level, you can omit
serverEntrypointand instead specify your custom server entrypoint withvite.build.rollupOptions.input.#15781
2de969dThanks @ematipico! - Adds a newclientAddressoption to thecreateContext()functionProviding this value gives adapter and middleware authors explicit control over the client IP address. When not provided, accessing
clientAddressthrows an error consistent with other contexts where it is not set by the adapter.Additionally, both of the official Netlify and Vercel adapters have been updated to provide this information in their edge middleware.
#15258
d339a18Thanks @ematipico! - Stabilizes the adapter featureexperimentalStatiHeaders. If you were using this feature in any of the supported adapters, you'll need to change the name of the flag:export default defineConfig({ adapter: netlify({ - experimentalStaticHeaders: true + staticHeaders: true }) })#15535
dfe2e22Thanks @florian-lefebvre! - Exports newcreateRequest()andwriteResponse()utilities fromastro/app/nodeTo replace the deprecated
NodeApp.createRequest()andNodeApp.writeResponse()methods, theastro/app/nodemodule now exposes newcreateRequest()andwriteResponse()utilities. These can be used to convert a NodeJSIncomingMessageinto a web-standardRequestand stream a web-standardResponseinto a NodeJSServerResponse:#15755
f9ee868Thanks @matthewp! - Adds a newsecurity.serverIslandBodySizeLimitconfiguration optionServer island POST endpoints now enforce a body size limit, similar to the existing
security.actionBodySizeLimitfor Actions. The new option defaults to1048576(1 MB) and can be configured independently.Requests exceeding the limit are rejected with a 413 response. You can customize the limit in your Astro config:
#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:See the NPM font provider reference documentation for more details.
#15471
32b4302Thanks @ematipico! - Adds a new experimental flagqueuedRenderingto enable a queue-based rendering engineThe new engine is based on a two-pass process, where the first pass
traverses the tree of components, emits an ordered queue, and then the queue is rendered.
The new engine does not use recursion, and comes with two customizable options.
Early benchmarks showed significant speed improvements and memory efficiency in big projects.
Queue-rendered based
The new engine can be enabled in your Astro config with
experimental.queuedRendering.enabledset totrue, and can be further customized with additional sub-features.Pooling
With the new engine enabled, you now have the option to have a pool of nodes that can be saved and reused across page rendering. Node pooling has no effect when rendering pages on demand (SSR) because these rendering requests don't share memory. However, it can be very useful for performance when building static pages.
Content caching
The new engine additionally unlocks a new
contentCacheoption. This allows you to cache values of nodes during the rendering phase. This is currently a boolean feature with no further customization (e.g. size of cache) that uses sensible defaults for most large content collections:When disabled, the pool engine won't cache strings, but only types.
For more information on enabling and using this feature in your project, see the experimental queued rendering docs for more details.
#14888
4cd3fe4Thanks @OliverSpeir! - Updatesastro add cloudflareto better setup types, by adding./worker-configuration.d.tsto tsconfig includes and agenerate-typesscript to package.json#15646
0dd9d00Thanks @delucis! - Removes redundantfetchpriorityattributes from the output of Astro’s<Image>componentPreviously, Astro would always include
fetchpriority="auto"on images not using thepriorityattribute.However, this is the default value, so specifying it is redundant. This change omits the attribute by default.
#15291
89b6cddThanks @florian-lefebvre! - Removes theexperimental.fontsflag and replaces it with a new configuration optionfonts- (v6 upgrade guidance)#15495
5b99e90Thanks @leekeh! - Adds a newmiddlewareModeadapter feature to replace the previousedgeMiddlewareoption.This feature only impacts adapter authors. If your adapter supports
edgeMiddleware, you should upgrade to the newmiddlewareModeoption to specify the middleware mode for your adapter as soon as possible. TheedgeMiddlewarefeature is deprecated and will be removed in a future major release.export default function createIntegration() { return { name: '@​example/my-adapter', hooks: { 'astro:config:done': ({ setAdapter }) => { setAdapter({ name: '@​example/my-adapter', serverEntrypoint: '@​example/my-adapter/server.js', adapterFeatures: { - edgeMiddleware: true + middlewareMode: 'edge' } }); }, }, }; }#15694
66449c9Thanks @matthewp! - AddspreserveBuildClientDiroption to adapter featuresAdapters can now opt in to preserving the client/server directory structure for static builds by setting
preserveBuildClientDir: truein their adapter features. When enabled, static builds will output files tobuild.clientinstead of directly tooutDir.This is useful for adapters that require a consistent directory structure regardless of the build output type, such as deploying to platforms with specific file organization requirements.
#15332
7c55f80Thanks @matthewp! - Adds afileURLoption torenderMarkdownin content loaders, enabling resolution of relative image paths. When provided, relative image paths in markdown will be resolved relative to the specified file URL and included inmetadata.localImagePaths.#15407
aedbbd8Thanks @ematipico! - Adds support for responsive images whensecurity.cspis enabled, out of the box.Astro's implementation of responsive image styles has been updated to be compatible with a configured Content Security Policy.
Instead of, injecting style elements at runtime, Astro will now generate your styles at build time using a combination of
class=""anddata-*attributes. This means that your processed styles are loaded and hashed out of the box by Astro.If you were previously choosing between Astro's CSP feature and including responsive images on your site, you may now use them together.
#15543
d43841dThanks @Princesseuh! - Adds a newexperimental.rustCompilerflag to opt into the experimental Rust-based Astro compilerThis experimental compiler is faster, provides better error messages, and generally has better support for modern JavaScript, TypeScript, and CSS features.
After enabling in your Astro config, the
@astrojs/compiler-rspackage must also be installed into your project separately:This new compiler is still in early development and may exhibit some differences compared to the existing Go-based compiler. Notably, this compiler is generally more strict in regard to invalid HTML syntax and may throw errors in cases where the Go-based compiler would have been more lenient. For example, unclosed tags (e.g.
<p>My paragraph) will now result in errors.For more information about using this experimental feature in your project, especially regarding expected differences and limitations, please see the experimental Rust compiler reference docs. To give feedback on the compiler, or to keep up with its development, see the RFC for a new compiler for Astro for more information and discussion.
#15349
a257c4cThanks @ascorbic! - Passes collection name to live content loadersLive content collection loaders now receive the collection name as part of their parameters. This is helpful for loaders that manage multiple collections or need to differentiate behavior based on the collection being accessed.
#15006
f361730Thanks @florian-lefebvre! - Adds new session driver object shapeFor greater flexibility and improved consistency with other Astro code, session drivers are now specified as an object:
Specifying the session driver as a string has been deprecated, but will continue to work until this feature is removed completely in a future major version. The object shape is the current recommended and documented way to configure a session driver.
#15291
89b6cddThanks @florian-lefebvre! - Adds a new Fonts API to provide first-party support for adding custom fonts in Astro.This feature allows you to use fonts from both your file system and several built-in supported providers (e.g. Google, Fontsource, Bunny) through a unified API. Keep your site performant thanks to sensible defaults and automatic optimizations including preloading and fallback font generation.
To enable this feature, configure
fontswith one or more fonts:Import and include the
<Font />component with the requiredcssVariableproperty in the head of your page, usually in a dedicatedHead.astrocomponent or in a layout component directly:In any page rendered with that layout, including the layout component itself, you can now define styles with your font's
cssVariableto apply your custom font.In the following example, the
<h1>heading will have the custom font applied, while the paragraph<p>will not.Visit the updated fonts guide to learn more about adding custom fonts to your project.
#14550
9c282b5Thanks @ascorbic! - Adds support for live content collectionsLive content collections are a new type of content collection that fetch their data at runtime rather than build time. This allows you to access frequently updated data from CMSs, APIs, databases, or other sources using a unified API, without needing to rebuild your site when the data changes.
Live collections vs build-time collections
In Astro 5.0, the content layer API added support for adding diverse content sources to content collections. You can create loaders that fetch data from any source at build time, and then access it inside a page via
getEntry()andgetCollection(). The data is cached between builds, giving fast access and updates.However, there was no method for updating the data store between builds, meaning any updates to the data needed a full site deploy, even if the pages are rendered on demand. This meant that content collections were not suitable for pages that update frequently. Instead, these pages tended to access the APIs directly in the frontmatter. This worked, but it led to a lot of boilerplate, and meant users didn't benefit from the simple, unified API that content loaders offer. In most cases, users tended to individually create loader libraries shared between pages.
Live content collections (introduced experimentally in Astro 5.10) solve this problem by allowing you to create loaders that fetch data at runtime, rather than build time. This means that the data is always up-to-date, without needing to rebuild the site.
How to use
To use live collections, create a new
src/live.config.tsfile (alongside yoursrc/content.config.tsif you have one) to define your live collections with a live content loader using the newdefineLiveCollection()function from theastro:contentmodule:You can then use the
getLiveCollection()andgetLiveEntry()functions to access your live data, along with error handling (since anything can happen when requesting live data!):Upgrading from experimental live collections
If you were using the experimental feature, you must remove the
experimental.liveContentCollectionsflag from yourastro.config.*file:export default defineConfig({ // ... - experimental: { - liveContentCollections: true, - }, });No other changes to your project code are required as long as you have been keeping up with Astro 5.x patch releases, which contained breaking changes to this experimental feature. If you experience problems with your live collections after upgrading to Astro v6 and removing this flag, please review the Astro CHANGELOG from 5.10.2 onwards for any potential updates you might have missed, or follow the current v6 documentation for live collections.
5b8f573Thanks @florian-lefebvre! - Adds a new optionalembeddedLangsprop to the<Code />component to support languaConfiguration
📅 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 was generated by Mend Renovate. View the repository job log.