Major Changes
-
#11982
d84e444
Thanks @Princesseuh! - Adds a default exclude and include value to the tsconfig presets.{projectDir}/dist
is now excluded by default, and{projectDir}/.astro/types.d.ts
and{projectDir}/**/*
are included by default.Both of these options can be overridden by setting your own values to the corresponding settings in your
tsconfig.json
file. -
#11987
bf90a53
Thanks @florian-lefebvre! - Thelocals
object can no longer be overriddenMiddleware, API endpoints, and pages can no longer override the
locals
object in its entirety. You can still append values onto the object, but you can not replace the entire object and delete its existing values.If you were previously overwriting like so:
ctx.locals = { one: 1, two: 2, };
This can be changed to an assignment on the existing object instead:
Object.assign(ctx.locals, { one: 1, two: 2, });
Minor Changes
-
#11980
a604a0c
Thanks @matthewp! - ViewTransitions component renamed to ClientRouterThe
<ViewTransitions />
component has been renamed to<ClientRouter />
. There are no other changes than the name. The old name will continue to work in Astro 5.x, but will be removed in 6.0.This change was done to clarify the role of the component within Astro's View Transitions support. Astro supports View Transitions APIs in a few different ways, and renaming the component makes it more clear that the features you get from the ClientRouter component are slightly different from what you get using the native CSS-based MPA router.
We still intend to maintain the ClientRouter as before, and it's still important for use-cases that the native support doesn't cover, such as persisting state between pages.
Patch Changes
-
#11987
bf90a53
Thanks @florian-lefebvre! -render()
signature now takesrenderOptions
as 2nd argumentThe signature for
app.render()
has changed, and the second argument is now an options object calledrenderOptions
with more options for customizing rendering.The
renderOptions
are:addCookieHeader
: Determines whether Astro will set theSet-Cookie
header, otherwise the adapter is expected to do so itself.clientAddress
: The client IP address used to setAstro.clientAddress
.locals
: An object of locals that's set toAstro.locals
.routeData
: An object specifying the route to use.
-
#11991
d7a396c
Thanks @matthewp! - Update error link to on-demand rendering guide