astro 2.0.0-beta.3
Major Changes
-
#5891
05caf445dThanks @bholmesdev! - Remove deprecated Markdown APIs from Astro v0.X. This includesgetHeaders(), the.astroproperty for layouts, and therawContent()andcompiledContent()error messages for MDX. -
#5893
be901dc98Thanks @matthewp! - Move getEntry to getEntryBySlugThis change moves
getEntrytogetEntryBySlugand accepts a slug rather than an id.In order to improve support in
[id].astroroutes, particularly in SSR where you do not know what the id of a collection is. UsinggetEntryBySluginstead allows you to map the[id]param in your route to the entry. You can use it like this:--- import { getEntryBySlug } from 'astro:content'; const entry = await getEntryBySlug('docs', Astro.params.id); if (!entry) { return new Response(null, { status: 404, }); } --- <!-- You have an entry! Use it! --> -
#5608
899214298Thanks @konojunya! - A trailing slash will not be automatically appended toimport.meta.env.SITE. Instead, it will be the value of thesiteconfig as is. This may affect usages of${import.meta.env.SITE}image.png, which will need to be updated accordingly.
Minor Changes
-
#5901
a342a486cThanks @bluwy! - The fallback Svelte preprocessor will only be applied if a custompreprocessoption is not passed to thesvelte()integration option, or in thesvelte.config.jsfile.To support IDE autocompletion, or if you're migrating from
@astrojs/sveltev1, you can create asvelte.config.jsfile with:import { vitePreprocess } from '@astrojs/svelte'; export default { preprocess: vitePreprocess(), };This file will also be generated by
astro add svelteby default.
Patch Changes
-
#5855
16dc36a87Thanks @natemoo-re! - Remove legacy compiler error handling -
#5884
ce5c5dbd4Thanks @MoustaphaDev! - Add a theme toggle button to the error overlay -
#5845
e818cc046Thanks @bluwy! - Fix importing client-side components with alias -
#5849
8c100a6feThanks @bluwy! - Handle server restart from Vite plugins -
#5896
64b8082e7Thanks @natemoo-re! - Update@astrojs/compilertov1.0.0 -
#5852
3a00ecb3eThanks @rishi-raj-jain! - Respectvite.envPrefixif provided -
#5872
b66d7195cThanks @bluwy! - EnableskipLibCheckby default