Skip to content

Conversation

@astrobot-houston
Copy link
Contributor

@astrobot-houston astrobot-houston commented Jun 4, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

[email protected]

Minor Changes

  • #13802 0eafe14 Thanks @ematipico! - Adds experimental Content Security Policy (CSP) support

    CSP is an important feature to provide fine-grained control over resources that can or cannot be downloaded and executed by a document. In particular, it can help protect against cross-site scripting (XSS) attacks.

    Enabling this feature adds additional security to Astro's handling of processed and bundled scripts and styles by default, and allows you to further configure these, and additional, content types. This new experimental feature has been designed to work in every Astro rendering environment (static pages, dynamic pages and single page applications), while giving you maximum flexibility and with type-safety in mind.

    It is compatible with most of Astro's features such as client islands, and server islands, although Astro's view transitions using the <ClientRouter /> are not yet fully supported. Inline scripts are not supported out of the box, but you can provide your own hashes for external and inline scripts.

    To enable this feature, add the experimental flag in your Astro config:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        csp: true,
      },
    });

    For more information on enabling and using this feature in your project, see the Experimental CSP docs.

    For a complete overview, and to give feedback on this experimental API, see the Content Security Policy RFC.

  • #13850 1766d22 Thanks @ascorbic! - Provides a Markdown renderer to content loaders

    When creating a content loader, you will now have access to a renderMarkdown function that allows you to render Markdown content directly within your loaders. It uses the same settings and plugins as the renderer used for Markdown files in Astro, and follows any Markdown settings you have configured in your Astro project.

    This allows you to render Markdown content from various sources, such as a CMS or other data sources, directly in your loaders without needing to preprocess the Markdown content separately.

    import type { Loader } from 'astro/loaders';
    import { loadFromCMS } from './cms';
    
    export function myLoader(settings): Loader {
      return {
        name: 'my-loader',
        async load({ renderMarkdown, store }) {
          const entries = await loadFromCMS();
    
          store.clear();
    
          for (const entry of entries) {
            // Assume each entry has a 'content' field with markdown content
            store.set(entry.id, {
              id: entry.id,
              data: entry,
              rendered: await renderMarkdown(entry.content),
            });
          }
        },
      };
    }

    The return value of renderMarkdown is an object with two properties: html and metadata. These match the rendered property of content entries in content collections, so you can use them to render the content in your components or pages.

    ---
    import { getEntry, render } from 'astro:content';
    const entry = await getEntry('my-collection', Astro.params.id);
    const { Content } = await render(entry);
    ---
    
    <Content />

    For more information, see the Content Loader API docs.

  • #13887 62f0668 Thanks @yanthomasdev! - Adds an option for integration authors to suppress adapter warning/errors in supportedAstroFeatures. This is useful when either an warning/error isn't applicable in a specific context or the default one might conflict and confuse users.

    To do so, you can add suppress: "all" (to suppress both the default and custom message) or suppress: "default" (to only suppress the default one):

    setAdapter({
      name: 'my-astro-integration',
      supportedAstroFeatures: {
        staticOutput: 'stable',
        hybridOutput: 'stable',
        sharpImageService: {
          support: 'limited',
          message:
            "The sharp image service isn't available in the deploy environment, but will be used by prerendered pages on build.",
          suppress: 'default',
        },
      },
    });

    For more information, see the Adapter API reference docs.

@astrojs/[email protected]

Patch Changes

  • #13817 b7258f1 Thanks @yanthomasdev! - Clarifies and reduces a few logs when starting the dev server with @astrojs/cloudflare.

    Warnings about sharp support will now be suppressed when you have explicitly set an imageService option.

  • Updated dependencies []:

Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor

@github-actions github-actions bot added pkg: example Related to an example package (scope) pkg: astro Related to the core `astro` package (scope) labels Jun 4, 2025
@github-actions github-actions bot force-pushed the changeset-release/main branch 2 times, most recently from 3450ee9 to e192c45 Compare June 4, 2025 12:49
@github-actions github-actions bot force-pushed the changeset-release/main branch from e192c45 to 9e7fc0b Compare June 4, 2025 12:50
@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Jun 5, 2025
@ascorbic ascorbic dismissed their stale review June 5, 2025 12:43

release time

@ascorbic ascorbic merged commit 0947a69 into main Jun 5, 2025
15 checks passed
@ascorbic ascorbic deleted the changeset-release/main branch June 5, 2025 12:44
openscript pushed a commit to openscript/astro that referenced this pull request Sep 12, 2025
* [ci] release

* Update packages/astro/CHANGELOG.md

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Kane <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope) pkg: example Related to an example package (scope) pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants