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.11.5
->^4.15.1
Release Notes
withastro/astro (astro)
v4.15.1
Compare Source
Patch Changes
#11872
9327d56
Thanks @bluwy! - Fixesastro add
importing adapters and integrations#11767
d1bd1a1
Thanks @ascorbic! - Refactors content layer sync to use a queuev4.15.0
Compare Source
Minor Changes
#11729
1c54e63
Thanks @ematipico! - Adds a new variantsync
for theastro:config:setup
hook'scommand
property. This value is set when calling the commandastro sync
.If your integration previously relied on knowing how many variants existed for the
command
property, you must update your logic to account for this new option.#11743
cce0894
Thanks @ph1p! - Adds a new, optional propertytimeout
for theclient:idle
directive.This value allows you to specify a maximum time to wait, in milliseconds, before hydrating a UI framework component, even if the page is not yet done with its initial load. This means you can delay hydration for lower-priority UI elements with more control to ensure your element is interactive within a specified time frame.
#11677
cb356a5
Thanks @ematipico! - Adds a new optionfallbackType
toi18n.routing
configuration that allows you to control how fallback pages are handled.When
i18n.fallback
is configured, this new routing option controls whether to redirect to the fallback page, or to rewrite the fallback page's content in place.The
"redirect"
option is the default value and matches the current behavior of the existing fallback system.The option
"rewrite"
uses the new rewriting system to create fallback pages that render content on the original, requested URL without a browser refresh.For example, the following configuration will generate a page
/fr/index.html
that will contain the same HTML rendered by the page/en/index.html
whensrc/pages/fr/index.astro
does not exist.#11708
62b0d20
Thanks @martrapp! - Adds a new objectswapFunctions
to expose the necessary utility functions onastro:transitions/client
that allow you to build custom swap functions to be used with view transitions.The example below uses these functions to replace Astro's built-in default
swap
function with one that only swaps the<main>
part of the page:See the view transitions guide for more information about hooking into the
astro:before-swap
lifecycle event and adding a custom swap implementation.#11843
5b4070e
Thanks @bholmesdev! - Exposesz
from the newastro:schema
module. This is the new recommended import source for all Zod utilities when using Astro Actions.v4.14.6
Compare Source
Patch Changes
#11847
45b599c
Thanks @ascorbic! - Fixes a case where Vite would be imported by the SSR runtime, causing bundling errors and bloat.#11822
6fcaab8
Thanks @bluwy! - Marks internalvite-plugin-fileurl
plugin withenforce: 'pre'
#11713
497324c
Thanks @voidfill! - Prevents prefetching of the same urls with different hashes.#11814
2bb72c6
Thanks @eduardocereto! - Updates the documentation for experimental Content Layer API with a corrected code example#11842
1ffaae0
Thanks @stephan281094! - Fixes a typo in theMissingImageDimension
error message#11828
20d47aa
Thanks @bholmesdev! - Improves error message when invalid data is returned by an Action.v4.14.5
Compare Source
Patch Changes
#11809
62e97a2
Thanks @bholmesdev! - Fixes usage of.transform()
,.refine()
,.passthrough()
, and other effects on Action form inputs.#11812
260c4be
Thanks @bholmesdev! - ExposesActionAPIContext
type from theastro:actions
module.#11813
3f7630a
Thanks @bholmesdev! - Fixes unexpectedundefined
value when calling an action from the client without a return value.v4.14.4
Compare Source
Patch Changes
#11794
3691a62
Thanks @bholmesdev! - Fixes unexpected warning log when using Actions on "hybrid" rendered projects.#11801
9f943c1
Thanks @delucis! - Fixes a bug where thefilePath
property was not available on content collection entries when using the content layerfile()
loader with a JSON file that contained an object instead of an array. This was breaking use of theimage()
schema utility among other things.v4.14.3
Compare Source
Patch Changes
#11780
c6622ad
Thanks @Princesseuh! - Deprecates the Squoosh image service, to be removed in Astro 5.0. We recommend migrating to the default Sharp service.#11790
41c3fcb
Thanks @sarah11918! - Updates the documentation for experimentalastro:env
with a corrected link to the RFC proposal#11773
86a3391
Thanks @ematipico! - Changes messages logged when using unsupported, deprecated, or experimental adapter features for clarity#11745
89bab1e
Thanks @bluwy! - Prints prerender dynamic value usage warning only if it's used#11774
c6400ab
Thanks @florian-lefebvre! - Fixes the path returned byinjectTypes
#11730
2df49a6
Thanks @florian-lefebvre! - Simplifies path operations ofastro sync
#11771
49650a4
Thanks @florian-lefebvre! - Fixes an error thrown byastro sync
when anastro:env
virtual module is imported inside the Content Collections config#11744
b677429
Thanks @bluwy! - Disables the WebSocket server when creating a Vite server for loading config filesv4.14.2
Compare Source
Patch Changes
391324d
Thanks @bluwy! - Reverts back toyargs-parser
package for CLI argument parsingv4.14.1
Compare Source
Patch Changes
#11725
6c1560f
Thanks @ascorbic! - Prevents content layer importing node builtins in runtime#11692
35af73a
Thanks @matthewp! - Prevent errant HTML from crashing server islandsWhen an HTML minifier strips away the server island comment, the script can't correctly know where the end of the fallback content is. This makes it so that it simply doesn't remove any DOM in that scenario. This means the fallback isn't removed, but it also doesn't crash the browser.
#11727
3c2f93b
Thanks @florian-lefebvre! - Fixes a type issue when using the Content Layer in devv4.14.0
Compare Source
Minor Changes
#11657
a23c69d
Thanks @bluwy! - Deprecates the option for route-generating files to export a dynamic value forprerender
. Only static values are now supported (e.g.export const prerender = true
or= false
). This allows for better treeshaking and bundling configuration in the future.Adds a new
"astro:route:setup"
hook to the Integrations API to allow you to dynamically set options for a route at build or request time through an integration, such as enabling on-demand server rendering.To migrate from a dynamic export to the new hook, update or remove any dynamic
prerender
exports from individual routing files:// src/pages/blog/[slug].astro - export const prerender = import.meta.env.PRERENDER
Instead, create an integration with the
"astro:route:setup"
hook and update the route'sprerender
option:#11360
a79a8b0
Thanks @ascorbic! - Adds a newinjectTypes()
utility to the Integration API and refactors how type generation worksUse
injectTypes()
in theastro:config:done
hook to inject types into your user's project by adding a new a*.d.ts
file.The
filename
property will be used to generate a file at/.astro/integrations/<normalized_integration_name>/<normalized_filename>.d.ts
and must end with".d.ts"
.The
content
property will create the body of the file, and must be valid TypeScript.Additionally,
injectTypes()
returns a URL to the normalized path so you can overwrite its content later on, or manipulate it in any way you want.Codegen has been refactored. Although
src/env.d.ts
will continue to work as is, we recommend you update it:#11605
d3d99fb
Thanks @jcayzac! - Adds a new propertymeta
to Astro's built-in<Code />
component.This allows you to provide a value for Shiki's
meta
attribute to pass options to transformers.The following example passes an option to highlight lines 1 and 3 to Shiki's
tranformerMetaHighlight
:v4.13.4
Compare Source
Patch Changes
#11678
34da907
Thanks @ematipico! - Fixes a case where omitting a semicolon and line ending with carriage return - CRLF - in theprerender
option could throw an error.#11535
932bd2e
Thanks @matthewp! - Encrypt server island propsServer island props are now encrypted with a key generated at build-time. This is intended to prevent accidentally leaking secrets caused by exposing secrets through prop-passing. This is not intended to allow a server island to be trusted to skip authentication, or to protect against any other vulnerabilities other than secret leakage.
See the RFC for an explanation: https://github.com/withastro/roadmap/blob/server-islands/proposals/server-islands.md#props-serialization
#11655
dc0a297
Thanks @billy-le! - Fixes Astro Actionsinput
validation when usingdefault
values with a form input.#11689
c7bda4c
Thanks @ematipico! - Fixes an issue in the Astro actions, where the size of the generated cookie was exceeding the size permitted by theSet-Cookie
header.v4.13.3
Compare Source
Patch Changes
#11653
32be549
Thanks @florian-lefebvre! - Updatesastro:env
docs to reflect current developments and usage guidance#11658
13b912a
Thanks @bholmesdev! - FixesorThrow()
type when calling an Action without aninput
validator.#11603
f31d466
Thanks @bholmesdev! - Improves user experience when render an Action result from a form POST request:?_astroAction=NAME
flag when a result is rendered.Also improves the DX of directing to a new route on success. Actions will now redirect to the route specified in your
action
string on success, and redirect back to the previous page on error. This follows the routing convention of established backend frameworks like Laravel.For example, say you want to redirect to a
/success
route whenactions.signup
succeeds. You can add/success
to youraction
string like so:/success
.You can retrieve the action result from either page using the
Astro.getActionResult()
function.Note on security
This uses a temporary cookie to forward the action result to the next page. The cookie will be deleted when that page is rendered.
⚠ The action result is not encrypted. In general, we recommend returning minimal data from an action handler to a) avoid leaking sensitive information, and b) avoid unexpected render issues once the temporary cookie is deleted. For example, a
login
function may return a user's session id to retrieve from your Astro frontmatter, rather than the entire user object.v4.13.2
Compare Source
Patch Changes
#11648
589d351
Thanks @bholmesdev! - Fixes unexpected error when refreshing a POST request from a form using Actions.#11600
09ec2ca
Thanks @ArmandPhilippot! - DeprecatesgetEntryBySlug
andgetDataEntryById
functions exported byastro:content
in favor ofgetEntry
.#11593
81d7150
Thanks @bholmesdev! - Adds support forDate()
,Map()
, andSet()
from action results. See devalue for a complete list of supported values.Also fixes serialization exceptions when deploying Actions with edge middleware on Netlify and Vercel.
#11617
196092a
Thanks @abubakriz! - Fix toolbar audit incorrectly flagging images as above the fold.#11634
2716f52
Thanks @bholmesdev! - Fixes internal server error when calling an Astro Action without arguments on Vercel.#11628
9aaf58c
Thanks @madbook! - Ensures consistent CSS chunk hashes across different environmentsv4.13.1
Compare Source
Patch Changes
#11584
a65ffe3
Thanks @bholmesdev! - Removes async local storage dependency from Astro Actions. This allows Actions to run in Cloudflare and Stackblitz without opt-in flags or other configuration.This also introduces a new convention for calling actions from server code. Instead of calling actions directly, you must wrap function calls with the new
Astro.callAction()
utility.v4.13.0
Compare Source
Minor Changes
#11507
a62345f
Thanks @ematipico! - Adds color-coding to the console output during the build to highlight slow pages.Pages that take more than 500 milliseconds to render will have their build time logged in red. This change can help you discover pages of your site that are not performant and may need attention.
#11379
e5e2d3e
Thanks @alexanderniebuhr! - Theexperimental.contentCollectionJsonSchema
feature introduced behind a flag in v4.5.0 is no longer experimental and is available for general use.If you are working with collections of type
data
, Astro will now auto-generate JSON schema files for your editor to get IntelliSense and type-checking. A separate file will be created for each data collection in your project based on your collections defined insrc/content/config.ts
using a library calledzod-to-json-schema
.This feature requires you to manually set your schema's file path as the value for
$schema
in each data entry file of the collection:Alternatively, you can set this value in your editor settings. For example, to set this value in VSCode's
json.schemas
setting, provide the path of files to match and the location of your JSON schema:If you were previously using this feature, please remove the experimental flag from your Astro config:
If you have been waiting for stabilization before using JSON Schema generation for content collections, you can now do so.
Please see the content collections guide for more about this feature.
#11542
45ad326
Thanks @ematipico! - Theexperimental.rewriting
feature introduced behind a flag in v4.8.0 is no longer experimental and is available for general use.Astro.rewrite()
andcontext.rewrite()
allow you to render a different page without changing the URL in the browser. Unlike using a redirect, your visitor is kept on the original page they visited.Rewrites can be useful for showing the same content at multiple paths (e.g. /products/shoes/men/ and /products/men/shoes/) without needing to maintain two identical source files.
Rewrites are supported in Astro pages, endpoints, and middleware.
Return
Astro.rewrite()
in the frontmatter of a.astro
page component to display a different page's content, such as fallback localized content:v4.12.3
Compare Source
Patch Changes
#11509
dfbca06
Thanks @bluwy! - Excludes hoisted scripts and styles from Astro components imported with?url
or?raw
#11561
904f1e5
Thanks @ArmandPhilippot! - Uses the correct pageSize default inpage.size
JSDoc comment#11571
1c3265a
Thanks @bholmesdev! - BREAKING CHANGE to the experimental Actions API only. Install the latest@astrojs/react
integration as well if you're using React 19 features.Make
.safe()
the default return value for actions. This means{ data, error }
will be returned when calling an action directly. If you prefer to get the data while allowing errors to throw, chain the.orThrow()
modifier.v4.12.2
Compare Source
Patch Changes
#11505
8ff7658
Thanks @ematipico! - Enhances the dev server logging when rewrites occur during the lifecycle or rendering.The dev server will log the status code before and after a rewrite:
#11506
026e8ba
Thanks @sarah11918! - Fixes typo in documenting theslot="fallback"
attribute for Server Islands experimental feature.#11508
ca335e1
Thanks @cramforce! - Escapes HTML in serialized props#11501
4db78ae
Thanks @martrapp! - Adds the missing export for accessing thegetFallback()
function of the client site router.v4.12.1
Compare Source
Patch Changes
#11486
9c0c849
Thanks @ematipico! - Adds a new function calledaddClientRenderer
to the Container API.This function should be used when rendering components using the
client:*
directives. TheaddClientRenderer
API must be usedafter the use of the
addServerRenderer
:#11500
4e142d3
Thanks @Princesseuh! - Fixes inferRemoteSize type not working#11496
53ccd20
Thanks @alfawal! - Hide the dev toolbar onwindow.print()
(CTRL + P)v4.12.0
Compare Source
Minor Changes
#11341
49b5145
Thanks @madcampos! - Adds support for Shiki'sdefaultColor
option.This option allows you to override the values of a theme's inline style, adding only CSS variables to give you more flexibility in applying multiple color themes.
Configure
defaultColor: false
in your Shiki config to apply throughout your site, or pass to Astro's built-in<Code>
component to style an individual code block.v4.11.6
Compare Source
Patch Changes
#11459
bc2e74d
Thanks @mingjunlu! - Fixes false positive audit warnings on elements with the role "tabpanel".#11472
cb4e6d0
Thanks @delucis! - Avoids targeting all files in thesrc/
directory for eager optimization by Vite. After this change, only JSX, Vue, Svelte, and Astro components get scanned for early optimization.#11387
b498461
Thanks @bluwy! - Fixes prerendering not removing unused dynamic imported chunks#11437
6ccb30e
Thanks @NuroDev! - Fixes a case where Astro's configexperimental.env.schema
keys did not allow numbers. Numbers are still not allowed as the first character to be able to generate valid JavaScript identifiers#11439
08baf56
Thanks @bholmesdev! - Expands theisInputError()
utility fromastro:actions
to accept errors of any type. This should now allow type narrowing from a try / catch block.#11452
0e66849
Thanks @FugiTech! - Fixes an issue where using .nullish() in a formdata Astro action would always parse as a string#11438
619f07d
Thanks @bholmesdev! - Exposes utility types fromastro:actions
for thedefineAction
handler (ActionHandler
) and theActionError
code (ActionErrorCode
).#11456
17e048d
Thanks @RickyC0626! - Fixesastro dev --open
unexpected behavior that spawns a new tab every time a config file is saved#11337
0a4b31f
Thanks @florian-lefebvre! - Adds a new propertyexperimental.env.validateSecrets
to allow validating private variables on the server.By default, this is set to
false
and only public variables are checked on start. If enabled, secrets will also be checked on start (dev/build modes). This is useful for example in some CIs to make sure all your secrets are correctly set before deploying.#11443
ea4bc04
Thanks @bholmesdev! - Expose newActionReturnType
utility fromastro:actions
. This infers the return type of an action by passingtypeof actions.name
as a type argument. This example defines alike
action that returnslikes
as an object:In your client code, you can infer this handler return value with
ActionReturnType
:#11436
7dca68f
Thanks @bholmesdev! - Fixesastro:actions
autocompletion for thedefineAction
accept
property#11455
645e128
Thanks @florian-lefebvre! - Improvesastro:env
invalid variables errorsConfiguration
📅 Schedule: Branch creation - "before 4am on the first day of the month" (UTC), 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.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.