github withastro/astro astro@2.0.0-beta.3

latest releases: astro@5.0.0-beta.7, @astrojs/svelte@6.0.0-beta.2, create-astro@4.11.0-beta.0...
pre-release22 months ago

Major Changes

  • #5891 05caf445d Thanks @bholmesdev! - Remove deprecated Markdown APIs from Astro v0.X. This includes getHeaders(), the .astro property for layouts, and the rawContent() and compiledContent() error messages for MDX.

  • #5893 be901dc98 Thanks @matthewp! - Move getEntry to getEntryBySlug

    This change moves getEntry to getEntryBySlug and accepts a slug rather than an id.

    In order to improve support in [id].astro routes, particularly in SSR where you do not know what the id of a collection is. Using getEntryBySlug instead 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 899214298 Thanks @konojunya! - A trailing slash will not be automatically appended to import.meta.env.SITE. Instead, it will be the value of the site config as is. This may affect usages of ${import.meta.env.SITE}image.png, which will need to be updated accordingly.

  • #5862 1ca81c16b Thanks @bluwy! - Remove unused exports

Minor Changes

  • #5901 a342a486c Thanks @bluwy! - The fallback Svelte preprocessor will only be applied if a custom preprocess option is not passed to the svelte() integration option, or in the svelte.config.js file.

    To support IDE autocompletion, or if you're migrating from @astrojs/svelte v1, you can create a svelte.config.js file with:

    import { vitePreprocess } from '@astrojs/svelte';
    
    export default {
      preprocess: vitePreprocess(),
    };

    This file will also be generated by astro add svelte by default.

Patch Changes

Don't miss a new astro release

NewReleases is sending notifications on new releases.