diff options
author | 2025-06-05 05:44:36 -0700 | |
---|---|---|
committer | 2025-06-05 13:44:36 +0100 | |
commit | 0947a69192ad6820970902c7c951fb0cf31fcf4b (patch) | |
tree | 3eea4faad541012db34d2c98ddaa2c1d942fca20 /packages | |
parent | 761abb61d8a2ca79be729ab4d7285f10606cd2fd (diff) | |
download | astro-0947a69192ad6820970902c7c951fb0cf31fcf4b.tar.gz astro-0947a69192ad6820970902c7c951fb0cf31fcf4b.tar.zst astro-0947a69192ad6820970902c7c951fb0cf31fcf4b.zip |
[ci] release (#13889)astro@5.9.0@astrojs/cloudflare@12.5.4
* [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 <m@mk.gg>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/astro/CHANGELOG.md | 96 | ||||
-rw-r--r-- | packages/astro/package.json | 2 | ||||
-rw-r--r-- | packages/integrations/cloudflare/CHANGELOG.md | 11 | ||||
-rw-r--r-- | packages/integrations/cloudflare/package.json | 2 |
4 files changed, 109 insertions, 2 deletions
diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index a69a1068f..8d2811d11 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,101 @@ # astro +## 5.9.0 + +### Minor Changes + +- [#13802](https://github.com/withastro/astro/pull/13802) [`0eafe14`](https://github.com/withastro/astro/commit/0eafe14b08c627b116842ea0a5299a00f9baa3d1) Thanks [@ematipico](https://github.com/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)](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting) 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: + + ```js + // 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](https://docs.astro.build/en/reference/experimental-flags/csp/). + + For a complete overview, and to give feedback on this experimental API, see the [Content Security Policy RFC](https://github.com/withastro/roadmap/blob/feat/rfc-csp/proposals/0055-csp.md). + +- [#13850](https://github.com/withastro/astro/pull/13850) [`1766d22`](https://github.com/withastro/astro/commit/1766d222e7bb4adb6d15090e2d6331a0d8978303) Thanks [@ascorbic](https://github.com/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. + + ```ts + 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. + + ```astro + --- + 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](https://docs.astro.build/en/reference/content-loader-reference/#rendermarkdown). + +- [#13887](https://github.com/withastro/astro/pull/13887) [`62f0668`](https://github.com/withastro/astro/commit/62f0668aa1e066c1c07ee0e774192def4cac43c4) Thanks [@yanthomasdev](https://github.com/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): + + ```ts + 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](https://docs.astro.build/en/reference/adapter-reference/#astro-features). + ## 5.8.2 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index 4ea60acf7..112566f9b 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "5.8.2", + "version": "5.9.0", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "type": "module", "author": "withastro", diff --git a/packages/integrations/cloudflare/CHANGELOG.md b/packages/integrations/cloudflare/CHANGELOG.md index 859b062be..c03fc4445 100644 --- a/packages/integrations/cloudflare/CHANGELOG.md +++ b/packages/integrations/cloudflare/CHANGELOG.md @@ -1,5 +1,16 @@ # @astrojs/cloudflare +## 12.5.4 + +### Patch Changes + +- [#13817](https://github.com/withastro/astro/pull/13817) [`b7258f1`](https://github.com/withastro/astro/commit/b7258f1243189218604346f5e0301dbdd363a57f) Thanks [@yanthomasdev](https://github.com/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 []: + - @astrojs/underscore-redirects@0.6.1 + ## 12.5.3 ### Patch Changes diff --git a/packages/integrations/cloudflare/package.json b/packages/integrations/cloudflare/package.json index 4ca2b8bc0..a09516fd5 100644 --- a/packages/integrations/cloudflare/package.json +++ b/packages/integrations/cloudflare/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/cloudflare", "description": "Deploy your site to Cloudflare Workers/Pages", - "version": "12.5.3", + "version": "12.5.4", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", |