Update dependency astro to v4.9.0 #1328
Merged
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.8.7
->4.9.0
Release Notes
withastro/astro (astro)
v4.9.0
Compare Source
Minor Changes
#11051
12a1bcc
Thanks @ematipico! - Introduces an experimental Container API to render.astro
components in isolation.This API introduces three new functions to allow you to create a new container and render an Astro component returning either a string or a Response:
create()
: creates a new instance of the container.renderToString()
: renders a component and return a string.renderToResponse()
: renders a component and returns theResponse
emitted by the rendering phase.The first supported use of this new API is to enable unit testing. For example, with
vitest
, you can create a container to render your component with test data and check the result:For a complete reference, see the Container API docs.
For a feature overview, and to give feedback on this experimental API, see the Container API roadmap discussion.
#11021
2d4c8fa
Thanks @ematipico! - The CSRF protection feature that was introduced behind a flag in v4.6.0 is no longer experimental and is available for general use.To enable the stable version, add the new top-level
security
option inastro.config.mjs
. If you were previously using the experimental version of this feature, also delete the experimental flag:Enabling this setting performs a check that the
"origin"
header, automatically passed by all modern browsers, matches the URL sent by each Request.This check is executed only for pages rendered on demand, and only for the requests
POST
,PATCH
,DELETE
andPUT
with one of the following"content-type"
headers:'application/x-www-form-urlencoded'
,'multipart/form-data'
,'text/plain'
.If the
"origin"
header doesn't match the pathname of the request, Astro will return a 403 status code and won't render the page.For more information, see the
security
configuration docs.#11022
be68ab4
Thanks @ematipico! - Thei18nDomains
routing feature introduced behind a flag in v3.4.0 is no longer experimental and is available for general use.This routing option allows you to configure different domains for individual locales in entirely server-rendered projects using the @astrojs/node or @astrojs/vercel adapter with a
site
configured.If you were using this feature, please remove the experimental flag from your Astro config:
If you have been waiting for stabilization before using this routing option, you can now do so.
Please see the internationalization docs for more about this feature.
#11071
8ca7c73
Thanks @bholmesdev! - Adds two new functionsexperimental_getActionState()
andexperimental_withState()
to support the React 19useActionState()
hook when using Astro Actions. This introduces progressive enhancement when calling an Action with thewithState()
utility.This example calls a
like
action that accepts apostId
and returns the number of likes. Pass this action to theexperimental_withState()
function to apply progressive enhancement info, and apply touseActionState()
to track the result:You can also access the state stored by
useActionState()
from your actionhandler
. Callexperimental_getActionState()
with the API context, and optionally apply a type to the result:#11101
a6916e4
Thanks @linguofeng! - Updates Astro's code for adapters to use the headerx-forwarded-for
to initialize theclientAddress
.To take advantage of the new change, integration authors must upgrade the version of Astro in their adapter
peerDependencies
to4.9.0
.#11071
8ca7c73
Thanks @bholmesdev! - Adds compatibility for Astro Actions in the React 19 beta. Actions can be passed to aform action
prop directly, and Astro will automatically add metadata for progressive enhancement.Patch Changes
#11088
9566fa0
Thanks @bholmesdev! - Allow actions to be called on the server. This allows you to call actions as utility functions in your Astro frontmatter, endpoints, and server-side UI components.Import and call directly from
astro:actions
as you would for client actions:Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ 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 has been generated by Mend Renovate. View repository job log here.