Releases: withastro/astro
astro@4.16.8
Patch Changes
-
#12338
9ca89b3
Thanks @situ2001! - ResetsNODE_ENV
to ensure install command run in dev mode -
#12286
9d6bcdb
Thanks @florian-lefebvre! - Fixes a case where a warning for experimentalastro:env
support would be shown when using an adapter but not actually usingastro:env
-
#12342
ffc836b
Thanks @liruifengv! - Fixes a typo in the command name of the CLI -
#12301
0cfc69d
Thanks @apatel369! - Fixes an issue with action handler context by passing the correct context (ActionAPIContext
). -
#12312
5642ef9
Thanks @koyopro! - Fixes an issue where usinggetViteConfig()
returns incorrect and duplicate configuration -
#12245
1d4f6a4
Thanks @bmenant! - Addcomponents
property to MDXInstance type definition (RenderResult and module import) -
#12340
94eaeea
Thanks @ematipico! - Fixes an issue where Astro actions didn't work whenbase
was different from/
@astrojs/mdx@3.1.9
astro@5.0.0-beta.6
Major Changes
-
#12268
4e9a3ac
Thanks @ematipico! - The commandastro add vercel
now updates the configuration file differently, and adds@astrojs/vercel
as module to import.This is a breaking change because it requires the version
8.*
of@astrojs/vercel
. -
#12231
90ae100
Thanks @bluwy! - Updates the automaticcharset=utf-8
behavior for Markdown pages, where instead of responding withcharset=utf-8
in theContent-Type
header, Astro will now automatically add the<meta charset="utf-8">
tag instead.This behaviour only applies to Markdown pages (
.md
or similar Markdown files located withinsrc/pages/
) that do not use Astro's speciallayout
frontmatter property. It matches the rendering behaviour of other non-content pages, and retains the minimal boilerplate needed to write with non-ASCII characters when adding individual Markdown pages to your site.If your Markdown pages use the
layout
frontmatter property, then HTML encoding will be handled by the designated layout component instead, and the<meta charset="utf-8">
tag will not be added to your page by default.If you require
charset=utf-8
to render your page correctly, make sure that your layout components contain the<meta charset="utf-8">
tag. You may need to add this if you have not already done so.
Minor Changes
-
#12243
eb41d13
Thanks @florian-lefebvre! - ImprovesdefineConfig
type safety. TypeScript will now error if a group of related configuration options do not have consistent types. For example, you will now see an error if your language set fori18n.defaultLocale
is not one of the supported locales specified ini18n.locales
. -
#12150
93351bc
Thanks @bluwy! - Adds support for passing values other than"production"
or"development"
to the--mode
flag (e.g."staging"
,"testing"
, or any custom value) to change the value ofimport.meta.env.MODE
or the loaded.env
file. This allows you take advantage of Vite's mode feature.Also adds a new
--devOutput
flag forastro build
that will output a development-based build.Note that changing the
mode
does not change the kind of code transform handled by Vite and Astro:- In
astro dev
, Astro will transform code with debug information. - In
astro build
, Astro will transform code with the most optimized output and removes debug information. - In
astro build --devOutput
(new flag), Astro will transform code with debug information like inastro dev
.
This enables various usecases like:
# Run the dev server connected to a "staging" API astro dev --mode staging # Build a site that connects to a "staging" API astro build --mode staging # Build a site that connects to a "production" API with additional debug information astro build --devOutput # Build a site that connects to a "testing" API astro build --mode testing
The different modes can be used to load different
.env
files, e.g..env.staging
or.env.production
, which can be customized for each environment, for example with differentAPI_URL
environment variable values. - In
Patch Changes
-
#12302
7196c24
Thanks @ematipico! - Fixes an issue where the origin check middleware run for prendered pages -
#12341
c1786d6
Thanks @ematipico! - Fixes and issue whereAstro.currentLocale
always returned the default locale when consumed inside a server island. -
#12270
25192a0
Thanks @ematipico! - Fixes a bug where the params weren't correctly computed when rendering URLs with non-English characters
@astrojs/vue@5.0.0-beta.1
@astrojs/mdx@4.0.0-beta.3
Major Changes
-
#12231
90ae100
Thanks @bluwy! - Handles the breaking change in Astro where content pages (including.mdx
pages located withinsrc/pages/
) no longer respond withcharset=utf-8
in theContent-Type
header.For MDX pages without layouts,
@astrojs/mdx
will automatically add the<meta charset="utf-8">
tag to the page by default. This reduces the boilerplate needed to write with non-ASCII characters. If your MDX pages have a layout, the layout component should include the<meta charset="utf-8">
tag.If you require
charset=utf-8
to render your page correctly, make sure that your layout components have the<meta charset="utf-8">
tag added.
astro@4.16.7
Patch Changes
-
#12263
e9e8080
Thanks @Fryuni! - Fixes conflict between server islands and on-demand dynamic routes in the form of/[...rest]
or/[paramA]/[paramB]
. -
#12279
b781f88
Thanks @jsparkdev! - Update wrong error message -
#12273
c2ee963
Thanks @ascorbic! - Fixes an issue with some package managers where sites would not build if TypeScript was not installed. -
#12235
a75bc5e
Thanks @ematipico! - Fixes a bug where Astro Actions couldn't redirect to the correct pathname when there was a rewrite involved. -
#11839
ff522b9
Thanks @icaliman! - Fixes error when returning a top-levelnull
from an Astro file frontmatter -
#12272
388d237
Thanks @ascorbic! - Correctly handles local images when using a base path in SSR
@astrojs/db@0.14.3
astro@4.16.6
Patch Changes
-
#11823
a3d30a6
Thanks @DerTimonius! - fix: improve error message when inferSize is used in local images with the Image component -
#12227
8b1a641
Thanks @florian-lefebvre! - Fixes a case where environment variables would not be refreshed when usingastro:env
-
#12239
2b6daa5
Thanks @ematipico! - BREAKING CHANGE to the experimental Container API onlyChanges the default page rendering behavior of Astro components in containers, and adds a new option
partial: false
to render full Astro pages as before.Previously, the Container API was rendering all Astro components as if they were full Astro pages containing
<!DOCTYPE html>
by default. This was not intended, and now by default, all components will render as page partials: only the contents of the components without a page shell.To render the component as a full-fledged Astro page, pass a new option called
partial: false
torenderToString()
andrenderToResponse()
:import { experimental_AstroContainer as AstroContainer } from 'astro/container'; import Card from '../src/components/Card.astro'; const container = AstroContainer.create(); await container.renderToString(Card); // the string will not contain `<!DOCTYPE html>` await container.renderToString(Card, { partial: false }); // the string will contain `<!DOCTYPE html>`
astro@4.16.5
astro@4.16.4
Patch Changes
-
#12223
79ffa5d
Thanks @ArmandPhilippot! - Fixes a false positive reported by the dev toolbar Audit app where a label was considered missing when associated with a buttonThe
button
element can be used with a label (e.g. to create a switch) and should not be reported as an accessibility issue when used as a child of alabel
. -
#12199
c351352
Thanks @ematipico! - Fixes a regression in the computation ofAstro.currentLocale
-
#12222
fb55695
Thanks @ematipico! - Fixes an issue where the edge middleware couldn't correctly compute the client IP address when callingctx.clientAddress()