github withastro/astro astro@2.2.0

latest releases: astro@4.15.9, astro@4.15.8, @astrojs/mdx@3.1.7...
17 months ago

Minor Changes

  • #6703 a1108e037 Thanks @Princesseuh! - Move image() to come from schema instead to fix it not working with refine and inside complex types

    Migration:

    Remove the image import from astro:content, and instead use a function to generate your schema, like such:

    import { defineCollection, z } from 'astro:content';
    
    defineCollection({
      schema: ({ image }) =>
        z.object({
          image: image().refine((img) => img.width >= 200, {
            message: 'image too small',
          }),
        }),
    });
  • #6714 ff0430786 Thanks @bluwy! - Add build.assetsPrefix option for CDN support. If set, all Astro-generated asset links will be prefixed with it. For example, setting it to https://cdn.example.com would generate https://cdn.example.com/_astro/penguin.123456.png links.

    Also adds import.meta.env.ASSETS_PREFIX environment variable that can be used to manually create asset links not handled by Astro.

Patch Changes

  • #6753 489dd8d69 Thanks @bluwy! - Fix getViteConfig return type

  • #6744 a1a4f45b5 Thanks @Princesseuh! - Fix remote images in Markdown throwing errors when using experimental.assets

  • #6762 8b88e4cf1 Thanks @Princesseuh! - Improved error message when an error was encountered while generating types

  • #6719 d54cbe413 Thanks @matthewp! - Better errors for when response is already sent

    This adds clearer error messaging when a Response has already been sent to the browser and the developer attempts to use:

    • Astro.cookies.set
    • Astro.redirect
  • #6741 4c347ab51 Thanks @Princesseuh! - Fix content-type header being wrong in dev on images from astro:assets

  • #6739 2f2e572e9 Thanks @Princesseuh! - Added more types and utilities exports related to astro:assets to help building custom image components and image services

  • #6759 7116c021a Thanks @bluwy! - Upgrade to Vite 4.2

  • Updated dependencies [a1a4f45b5]:

    • @astrojs/markdown-remark@2.1.3

Don't miss a new astro release

NewReleases is sending notifications on new releases.