The web framework for content-driven websites. ⭐️ Star to support our work!
OTHER License
Published by astrobot-houston 8 months ago
#10063 dac759798c111494e76affd2c2504d63944871fe
Thanks @marwan-mohamed12! - Moves shikiji-core
from devDependencies
to dependencies
to prevent type errors
#10067 989ea63bb2a5a670021541198aa70b8dc7c4bd2f
Thanks @ematipico! - Fixes a regression in the astro:i18n
module, where the functions getAbsoluteLocaleUrl
and getAbsoluteLocaleUrlList
returned a URL with double slash with a certain combination of options.
#10060 1810309e65c596266355c3b7bb36cdac70f3305e
Thanks @lilnasy! - Fixes an issue where custom client directives added by integrations broke builds with a custom root.
#9991 8fb67c81bb84530b39df4a1449c0862def0854af
Thanks @ktym4a! - Increases compatibility with standard browser behavior by changing where view transitions occur on browser back navigation.
Published by astrobot-houston 8 months ago
#9958 14ce8a6ebfc9daf951d2dca54737d857c229667c
Thanks @Princesseuh! - Adds support for using a custom tag (component) for optimized images
Starting from this version, when a tag called image
is used, its src
attribute will automatically be resolved if it's a local image. Astro will pass the result ImageMetadata
object to the underlying component as the src
prop. For non-local images (i.e. images using URLs or absolute paths), Astro will continue to pass the src
as a string.
// markdoc.config.mjs
import { component, defineMarkdocConfig, nodes } from '@astrojs/markdoc/config';
export default defineMarkdocConfig({
tags: {
image: {
attributes: nodes.image.attributes,
render: component('./src/components/MarkdocImage.astro'),
},
},
});
---
// src/components/MarkdocImage.astro
import { Image } from 'astro:assets';
interface Props {
src: ImageMetadata | string;
alt: string;
width: number;
height: number;
}
const { src, alt, width, height } = Astro.props;
---
<Image {src} {alt} {width} {height} />
{% image src="./astro-logo.png" alt="Astro Logo" width="100" height="100" %}
Published by astrobot-houston 9 months ago
#10022 3fc76efb2a8faa47edf67562a1f0c84a19be1b33
Thanks @lilnasy! - Fixes a regression where types for the astro:content
module did not include required exports, leading to typescript errors.
#10016 037e4f12dd2f460d66f72c9f2d992b95e74d2da9
Thanks @ematipico! - Fixes a bug where routes with a name that start with the name of the i18n.defaultLocale
were incorrectly returning a 404 response.
Published by astrobot-houston 9 months ago
#9987 0699f34d5c4481c027c4d29d73944f79f97008df
Thanks @lilnasy! - Implements verification for edge middleware. This is a security measure to ensure that your serverless functions are only ever called by your edge middleware and not a third party.
When edgeMiddleware
is enabled, the serverless function will now respond with 403 Forbidden
for requests that are not verified to have come from the generated edge middleware. No user action is necessary.
Published by astrobot-houston 9 months ago
20ca3154fb37049cbcd51b06d9fa2ef25ac25a36
Thanks @StandardGage! - Fixes an issue where passing void elements (img, etc..) did not work with the experimentalReactChildren
option enabledPublished by astrobot-houston 9 months ago
#10013 e6b5306a7de779ce495d0ff076d302de0aa57eaf
Thanks @delucis! - Fixes a regression in content collection types
#10003 ce4283331f18c6178654dd705e3cf02efeef004a
Thanks @bholmesdev! - Adds support for .strict()
on content collection schemas when a custom slug
is present.
Published by astrobot-houston 9 months ago
#9714 e2fe51c828dc7ea8204788e59e3953fe36c97836
Thanks @lilnasy! - Introduces a new config option, isr
, that allows you to deploy your project as an ISR function. ISR (Incremental Static Regeneration) caches your on-demand rendered pages in the same way as prerendered pages after first request.
To enable this feature, set isr
to true in your Vercel adapter configuration in astro.config.mjs
:
export default defineConfig({
output: 'server',
adapter: vercel({ isr: true }),
});
By default, ISR responses are cached for the duration of your deployment. You can further control caching by setting an expiration
time or prevent caching entirely for certain routes.
You can change the length of time to cache routes this by configuring an expiration
value in seconds:
export default defineConfig({
output: 'server',
adapter: vercel({
isr: {
// caches all pages on first request and saves for 1 day
expiration: 60 * 60 * 24,
},
}),
});
To implement Vercel's Draft mode, or On-Demand Incremental Static Regeneration (ISR), you can create a bypass token and provide it to the isr
config along with the paths to exclude from caching:
export default defineConfig({
output: 'server',
adapter: vercel({
isr: {
// A secret random string that you create.
bypassToken: '005556d774a8',
// Paths that will always be served fresh.
exclude: ['/api/invalidate'],
},
}),
});
Published by astrobot-houston 9 months ago
#9998 18ac0940ea1b49b6b0ddd9be1f96aef416e2d7ee
Thanks @ematipico! - Fixes a bug in Astro.currentLocale
that wasn't returning the correct locale when a locale is configured via path
#9998 18ac0940ea1b49b6b0ddd9be1f96aef416e2d7ee
Thanks @ematipico! - Fixes a regression in Astro.currentLocale
where it stopped working properly with dynamic routes
#9956 81acac24a3cac5a9143155c1d9f838ea84a70421
Thanks @matthewp! - Fixes HMR for MDX dependencies in Content Collections
#9999 c53a31321a935e4be04809046d7e0ba3cc41b272
Thanks @MoustaphaDev! - Rollbacks the feature which allowed to dynamically generate slots with variable slot names due to unexpected regressions.
#9906 3c0876cbed5033e6b5b42cc2b9d8b393d7e5a55e
Thanks @florian-lefebvre! - Improves the types for the astro:content
module by making low fidelity types available before running astro sync
Published by astrobot-houston 9 months ago
8b8f26fdf2af2a769f4846bdaaf4cf6b30f9e37c
Thanks @madcampos! - Allows `enclosure' to have a length of 0Published by astrobot-houston 9 months ago
#9932 9f0d89fa7e9e7c08c8600b0c49c2cce7489a7582
Thanks @ematipico! - Fixes a case where a warning was logged even when the feature i18nDomains
wasn't enabled
#9907 6c894af5ab79f290f4ff7feb68617a66e91febc1
Thanks @ktym4a! - Load 404.html on all non-existent paths on astro preview.
Published by astrobot-houston 9 months ago
bc1742df9423ba66e33dcbf65fbebf67a236175d
Thanks @matthewp! - Fix regression with bundling of @libsql/clientPublished by astrobot-houston 9 months ago
#9841 27ea080e24e2c5cdc59b63b1dfe0a83a0c696597
Thanks @kristianbinau! - Makes the warning clearer when having a custom base
and requesting a public URL without it
#9888 9d2fdb293d6a7323e10126cebad18ef9a2ea2800
Thanks @natemoo-re! - Improves error handling logic for the astro sync
command.
#9918 d52529e09450c84933dd15d6481edb32269f537b
Thanks @LarryIVC! - Adds the name
attribute to the <details>
tag type
#9938 1568afb78a163db63a4cde146dec87785a83db1d
Thanks @lilnasy! - Fixes a regression where middleware did not run for prerendered pages and endpoints.
#9931 44674418965d658733d3602668a9354e18f8ef89
Thanks @lilnasy! - Fixes a regression where a response created with Response.redirect
or containing null
as the body never completed in node-based adapters.
Published by astrobot-houston 9 months ago
#9839 58f9e393a188702eef5329e41deff3dcb65a3230
Thanks @Princesseuh! - Adds a new ComponentProps
type export from astro/types
to get the props type of an Astro component.
---
import type { ComponentProps } from 'astro/types';
import { Button } from './Button.astro';
type myButtonProps = ComponentProps<typeof Button>;
---
#9159 7d937c158959e76443a02f740b10e251d14dbd8c
Thanks @bluwy! - Adds CLI shortcuts as an easter egg for the dev server:
o + enter
: opens the site in your browserq + enter
: quits the dev serverh + enter
: prints all available shortcuts#9764 fad4f64aa149086feda2d1f3a0b655767034f1a8
Thanks @matthewp! - Adds a new build.format
configuration option: 'preserve'
. This option will preserve your source structure in the final build.
The existing configuration options, file
and directory
, either build all of your HTML pages as files matching the route name (e.g. /about.html
) or build all your files as index.html
within a nested directory structure (e.g. /about/index.html
), respectively. It was not previously possible to control the HTML file built on a per-file basis.
One limitation of build.format: 'file'
is that it cannot create index.html
files for any individual routes (other than the base path of /
) while otherwise building named files. Creating explicit index pages within your file structure still generates a file named for the page route (e.g. src/pages/about/index.astro
builds /about.html
) when using the file
configuration option.
Rather than make a breaking change to allow build.format: 'file'
to be more flexible, we decided to create a new build.format: 'preserve'
.
The new format will preserve how the filesystem is structured and make sure that is mirrored over to production. Using this option:
about.astro
becomes about.html
about/index.astro
becomes about/index.html
See the build.format
configuration options reference for more details.
#9143 041fdd5c89920f7ccf944b095f29e451f78b0e28
Thanks @ematipico! - Adds experimental support for a new i18n domain routing option ("domains"
) that allows you to configure different domains for individual locales in entirely server-rendered projects.
To enable this in your project, first configure your server
-rendered project's i18n routing with your preferences if you have not already done so. Then, set the experimental.i18nDomains
flag to true
and add i18n.domains
to map any of your supported locales
to custom URLs:
//astro.config.mjs"
import { defineConfig } from 'astro/config';
export default defineConfig({
site: 'https://example.com',
output: 'server', // required, with no prerendered pages
adapter: node({
mode: 'standalone',
}),
i18n: {
defaultLocale: 'en',
locales: ['es', 'en', 'fr', 'ja'],
routing: {
prefixDefaultLocale: false,
},
domains: {
fr: 'https://fr.example.com',
es: 'https://example.es',
},
},
experimental: {
i18nDomains: true,
},
});
With "domains"
configured, the URLs emitted by getAbsoluteLocaleUrl()
and getAbsoluteLocaleUrlList()
will use the options set in i18n.domains
.
import { getAbsoluteLocaleUrl } from 'astro:i18n';
getAbsoluteLocaleUrl('en', 'about'); // will return "https://example.com/about"
getAbsoluteLocaleUrl('fr', 'about'); // will return "https://fr.example.com/about"
getAbsoluteLocaleUrl('es', 'about'); // will return "https://example.es/about"
getAbsoluteLocaleUrl('ja', 'about'); // will return "https://example.com/ja/about"
Similarly, your localized files will create routes at corresponding URLs:
/en/about.astro
will be reachable at the URL https://example.com/about
./fr/about.astro
will be reachable at the URL https://fr.example.com/about
./es/about.astro
will be reachable at the URL https://example.es/about
./ja/about.astro
will be reachable at the URL https://example.com/ja/about
.See our Internationalization Guide for more details and limitations on this experimental routing feature.
#9755 d4b886141bb342ac71b1c060e67d66ca2ffbb8bd
Thanks @OliverSpeir! - Fixes an issue where images in Markdown required a relative specifier (e.g. ./
)
Now, you can use the standard ![](img.png)
syntax in Markdown files for images colocated in the same folder: no relative specifier required!
There is no need to update your project; your existing images will still continue to work. However, you may wish to remove any relative specifiers from these Markdown images as they are no longer necessary:
- ![A cute dog](./dog.jpg)
+ ![A cute dog](dog.jpg)
<!-- This dog lives in the same folder as my article! -->
#9908 2f6d1faa6f2d6de2d4ccd2a48adf5adadc82e593
Thanks @lilnasy! - Improves http behavior relating to errors encountered while streaming a response.
#9877 7be5f94dcfc73a78d0fb301eeff51614d987a165
Thanks @fabiankachlock! - Fixes the content config type path on windows
#9143 041fdd5c89920f7ccf944b095f29e451f78b0e28
Thanks @ematipico! - Fixes an issue where the function getLocaleRelativeUrlList
wasn't normalising the paths by default
#9911 aaedb848b1d6f683840035865528506a346ea659
Thanks @natemoo-re! - Fixes an issue where some adapters that do not include a start()
export would error rather than silently proceed
Published by astrobot-houston 9 months ago
041fdd5c89920f7ccf944b095f29e451f78b0e28
Thanks @ematipico! - Adds experimental support for internationalization domains#9885 49e0c24d7f90d00e986533fcf546665967540ce7
Thanks @matthewp! - Better ignores for Vercel file-tracer
The Vercel adapter has a file-tracer it uses to detect which files should be moved over to the dist/
folder. When it's done, it prints warnings for things that it detected that maybe should be moved.
This change expands how we do ignores so that:
.pnpm
.@libsql/client
is ignored, a package we know is not bundled.Published by astrobot-houston 9 months ago
041fdd5c89920f7ccf944b095f29e451f78b0e28
Thanks @ematipico! - Adds experimental support for internationalization domainsPublished by astrobot-houston 9 months ago
#9884 37369550ab57ca529fd6c796e5b0e96e897ca6e5
Thanks @lilnasy! - Fixes an issue where multiple cookies were sent in a single Set-Cookie header in the dev mode.
#9876 e9027f194b939ac5a4d795ee1a2c24e4a6fbefc0
Thanks @friedemannsommer! - Fixes an issue where using Response.redirect
in an endpoint led to an error.
#9882 13c3b712c7ba45d0081f459fc06f142216a4ec59
Thanks @natemoo-re! - Improves handling of YAML parsing errors
#9878 a40a0ff5883c7915dd55881dcebd052b9f94a0eb
Thanks @lilnasy! - Fixes an issue where setting trailingSlash to "never" had no effect on Astro.url
.
Published by astrobot-houston 9 months ago
#9840 70fdf1a5c660057152c1ca111dcc89ceda5c8840
Thanks @delucis! - Expose ContentConfig
type from astro:content
#9865 00ba9f1947ca9016cd0ee4d8f6048027fab2ab9a
Thanks @ematipico! - Fixes a bug in Astro.currentLocale
where the value was incorrectly computed during the build.
#9838 0a06d87a1e2b94be00a954f350c184222fa0594d
Thanks @lilnasy! - Fixes an issue where astro:i18n
could not be used in framework components.
Updated dependencies [44c957f893c6bf5f5b7c78301de7b21c5975584d
]:
Published by astrobot-houston 9 months ago
44c957f893c6bf5f5b7c78301de7b21c5975584d
Thanks @ktym4a! - Fixes a bug where non-UTF-8 file names are not displayed when using relative paths in markdowns.Published by astrobot-houston 9 months ago
44c957f893c6bf5f5b7c78301de7b21c5975584d
]:
Published by astrobot-houston 9 months ago
#9825 e4370e9e9dd862425eced25823c82e77d9516927
Thanks @tugrulates! - Fixes false positive aria role errors on interactive elements
#9828 a3df9d83ca92abb5f08f576631019c1604204bd9
Thanks @ematipico! - Fixes a case where shared modules among pages and middleware were transformed to a no-op after the build.
#9834 1885cea308a62b173a50967cf5a0b174b3c3f3f1
Thanks @Princesseuh! - Fixes third-party dev toolbar apps not loading correctly when using absolute paths on Windows