Releases: withastro/astro
[email protected]
Minor Changes
-
#14115
270e009
Thanks @ascorbic! - Removes "Open in x" badges from the README of the official Astro templates when a new project is created -
#14115
270e009
Thanks @ascorbic! - Adds support for marking sections in template READMEs to be removed when thecreate astro
command is used to create a new projectTheme authors can now use magic comments in template READMEs to mark sections that should not be included when a user runs
create-astro
with the--template
flag to create a new project.This allows templates to have content that is visible when viewed in the source repo but not when the template is copied for use in a new project. This is useful for content that is appropriate for a theme's own repository, but will not be useful to someone using the theme, such as
an "Open this repository in StackBlitz" badge where the URL is hardcoded .Use the magic comments
<!-- ASTRO:REMOVE:START -->
and<!-- ASTRO:REMOVE:END -->
to indicate content to be excluded from your README during thecreate astro
process.<!-- ASTRO:REMOVE:START --> [](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics) <!-- ASTRO:REMOVE:END -->
Note that these comments only remove content when new projects are created using
create astro
. When your theme template is forked, your README will be copied in its entirety.
[email protected]
Patch Changes
-
#14119
14807a4
Thanks @ascorbic! - Fixes a bug that caused builds to fail if a client directive was mistakenly added to an Astro component -
#14001
4b03d9c
Thanks @dnek! - Fixes an issue wheregetImage()
assigned the resized base URL to the srcset URL ofImageTransform
, which matched the width, height, and format of the original image.
@astrojs/[email protected]
Patch Changes
-
#14120
798b5fa
Thanks @ascorbic! - Adds mock feature flags in dev -
Updated dependencies []:
- @astrojs/[email protected]
[email protected]
Patch Changes
-
#14071
d2cb35d
Thanks @Grisoly! - Exposes theCode
componentlang
prop type:import type { CodeLanguage } from 'astro';
-
#14111
5452ee6
Thanks @ascorbic! - Fixes a bug that prevented "key" from being used as a prop for Astro components in MDX -
#14106
b5b39e4
Thanks @ascorbic! - Exits with non-zero exit code when config has an error -
#14112
37458b3
Thanks @ascorbic! - Fixes a bug that meant that SVG components could no longer be serialized withJSON.stringify
-
#14061
c7a7dd5
Thanks @jonasgeiler! - Add module declaration for?no-inline
asset imports -
#14109
5a08fa2
Thanks @ascorbic! - Throw a more helpful error if defineLiveCollection is used outside of a live.config file -
#14110
e7dd4e1
Thanks @ascorbic! - Warn if duplicate IDs are found by file loader
[email protected]
Patch Changes
-
#14094
22e9087
Thanks @ascorbic! - Correct types to allowpriority
on all images -
#14091
26c6b6d
Thanks @ascorbic! - Fixes a bug that caused a type error when defining session options without a driver -
#14082
93322cb
Thanks @louisescher! - Fixes an issue where Astro's default 404 route would incorrectly match routes containing "/404" in dev -
#14089
687d253
Thanks @florian-lefebvre! - Fixes a case whereastro:env
would not load the right environments variables in dev -
#14092
6692c71
Thanks @ascorbic! - Improves error handling in live collections -
#14074
144a950
Thanks @abcfy2! - Fixes a bug that caused some image service builds to fail -
#14092
6692c71
Thanks @ascorbic! - Fixes a case where zod could not be imported fromastro:content
virtual module in live collection config
@astrojs/[email protected]
@astrojs/[email protected]
Patch Changes
-
#14103
69d6871
Thanks @ascorbic! - Upgrades Netlify Vite plugin to fix error in edge functions. -
Updated dependencies []:
- @astrojs/[email protected]
[email protected]
Minor Changes
-
#13971
fe35ee2
Thanks @adamhl8! - Adds an experimental flagrawEnvValues
to disable coercion ofimport.meta.env
values (e.g. converting strings to other data types) that are populated fromprocess.env
Astro allows you to configure a type-safe schema for your environment variables, and converts variables imported via
astro:env
into the expected type.However, Astro also converts your environment variables used through
import.meta.env
in some cases, and this can prevent access to some values such as the strings"true"
(which is converted to a boolean value), and"1"
(which is converted to a number).The
experimental.rawEnvValues
flag disables coercion ofimport.meta.env
values that are populated fromprocess.env
, allowing you to use the raw value.To enable this feature, add the experimental flag in your Astro config:
import { defineConfig } from "astro/config" export default defineConfig({ + experimental: { + rawEnvValues: true, + } })
If you were relying on this coercion, you may need to update your project code to apply it manually:
- const enabled: boolean = import.meta.env.ENABLED + const enabled: boolean = import.meta.env.ENABLED === "true"
See the experimental raw environment variables reference docs for more information.
-
#13941
6bd5f75
Thanks @aditsachde! - Adds support for TOML files to Astro's built-inglob()
andfile()
content loaders.In Astro 5.2, Astro added support for using TOML frontmatter in Markdown files instead of YAML. However, if you wanted to use TOML files as local content collection entries themselves, you needed to write your own loader.
Astro 5.12 now directly supports loading data from TOML files in content collections in both the
glob()
and thefile()
loaders.If you had added your own TOML content parser for the
file()
loader, you can now remove it as this functionality is now included:// src/content.config.ts import { defineCollection } from "astro:content"; import { file } from "astro/loaders"; - import { parse as parseToml } from "toml"; const dogs = defineCollection({ - loader: file("src/data/dogs.toml", { parser: (text) => parseToml(text) }), + loader: file("src/data/dogs.toml") schema: /* ... */ })
Note that TOML does not support top-level arrays. Instead, the
file()
loader considers each top-level table to be an independent entry. The table header is populated in theid
field of the entry object.See Astro's content collections guide for more information on using the built-in content loaders.
Patch Changes
- Updated dependencies [
6bd5f75
]:- @astrojs/[email protected]
@astrojs/[email protected]
Patch Changes
- Updated dependencies [
6bd5f75
]:- @astrojs/[email protected]
@astrojs/[email protected]
Patch Changes
-
#13941
6bd5f75
Thanks @aditsachde! - Adds support for TOML files to Astro's built-inglob()
andfile()
content loaders.In Astro 5.2, Astro added support for using TOML frontmatter in Markdown files instead of YAML. However, if you wanted to use TOML files as local content collection entries themselves, you needed to write your own loader.
Astro 5.12 now directly supports loading data from TOML files in content collections in both the
glob()
and thefile()
loaders.If you had added your own TOML content parser for the
file()
loader, you can now remove it as this functionality is now included:// src/content.config.ts import { defineCollection } from "astro:content"; import { file } from "astro/loaders"; - import { parse as parseToml } from "toml"; const dogs = defineCollection({ - loader: file("src/data/dogs.toml", { parser: (text) => parseToml(text) }), + loader: file("src/data/dogs.toml") schema: /* ... */ })
Note that TOML does not support top-level arrays. Instead, the
file()
loader considers each top-level table to be an independent entry. The table header is populated in theid
field of the entry object.See Astro's content collections guide for more information on using the built-in content loaders.