diff --git a/.changeset/csp-shiki-warning.md b/.changeset/csp-shiki-warning.md new file mode 100644 index 000000000000..d30942d12fba --- /dev/null +++ b/.changeset/csp-shiki-warning.md @@ -0,0 +1,7 @@ +--- +'astro': patch +--- + +Reverts the support of Shiki with CSP. Unfortunately, after exhaustive tests, the highlighter can't be supported to cover all cases. + +Adds a warning when both Content Security Policy (CSP) and Shiki syntax highlighting are enabled, as they are incompatible due to Shiki's use of inline styles diff --git a/.changeset/fix-ssr-prerendered-image-deletion.md b/.changeset/fix-ssr-prerendered-image-deletion.md new file mode 100644 index 000000000000..01041c39b228 --- /dev/null +++ b/.changeset/fix-ssr-prerendered-image-deletion.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes an issue where original (unoptimized) images from prerendered pages could be kept in the build output during SSR builds. diff --git a/.changeset/happy-frogs-glow.md b/.changeset/happy-frogs-glow.md deleted file mode 100644 index 763ca0d46395..000000000000 --- a/.changeset/happy-frogs-glow.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@astrojs/markdown-remark': major -'@astrojs/mdx': major -'astro': major ---- - -Changes how styles applied to code blocks are emitted to support CSP - ([v6 upgrade guidance](https://v6.docs.astro.build/en/guides/upgrade-to/v6/#changed-how-shiki-code-block-styles-are-emitted)) diff --git a/.changeset/hot-eyes-sink.md b/.changeset/hot-eyes-sink.md new file mode 100644 index 000000000000..8787dcbdd372 --- /dev/null +++ b/.changeset/hot-eyes-sink.md @@ -0,0 +1,63 @@ +--- +'astro': minor +--- + +Adds a new experimental flag `queuedRendering` to enable a queue-based rendering engine + +The new engine is based on a two-pass process, where the first pass +traverses the tree of components, emits an ordered queue, and then the queue is rendered. + +The new engine does not use recursion, and comes with two customizable options. + +Early benchmarks showed significant speed improvements and memory efficiency in big projects. + +#### Queue-rendered based + +The new engine can be enabled in your Astro config with `experimental.queuedRendering.enabled` set to `true`, and can be further customized with additional sub-features. + +```js +// astro.config.mjs +export default defineConfig({ + experimental: { + queuedRendering: { + enabled: true + } + } +}) +``` + +#### Pooling + +With the new engine enabled, you now have the option to have a pool of nodes that can be saved and reused across page rendering. Node pooling has no effect when rendering pages on demand (SSR) because these rendering requests don't share memory. However, it can be very useful for performance when building static pages. + +```js +// astro.config.mjs +export default defineConfig({ + experimental: { + queuedRendering: { + enabled: true, + poolSize: 2000 // store up to 2k nodes to be reused across renderers + } + } +}); +``` + +#### Content caching + +The new engine additionally unlocks a new `contentCache` option. This allows you to cache values of nodes during the rendering phase. This is currently a boolean feature with no further customization (e.g. size of cache) that uses sensible defaults for most large content collections: + +When disabled, the pool engine won't cache strings, but only types. + +```js +// astro.config.mjs +export default defineConfig({ + experimental: { + queuedRendering: { + enabled: true, + contentCache: true // enable re-use of node values + } + } +}); +``` + +For more information on enabling and using this feature in your project, see the [experimental queued rendering docs](https://v6.docs.astro.build/en/reference/experimental-flags/queued-rendering/) for more details. diff --git a/.changeset/pre.json b/.changeset/pre.json index caeeeeb8a6a0..ea4ffeeee7a9 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -53,6 +53,7 @@ "better-redirect-error", "big-cups-drive", "big-forks-lead", + "big-jobs-make", "big-laws-dig", "bold-ghosts-sink", "bright-parrots-hear", @@ -63,19 +64,26 @@ "busy-actors-follow", "busy-humans-smoke", "busy-olives-chew", + "calm-bats-create", "calm-birds-fly", + "chubby-tips-change", "clean-planets-flow", "clear-areas-cry", "clear-route-cache-content", "clever-clubs-listen", "cloudflare-dev-styles", "cloudflare-entrypoint-breaking", + "cloudflare-image-component", + "cloudflare-image-dev-fix", + "cloudflare-image-service-object", "cloudflare-integration-wrangler", "cloudflare-workerd-prerender", "common-knives-rescue", "common-signs-punch", + "csp-shiki-warning", "cuddly-worlds-beam", "custom-prerenderer-api", + "cute-suns-check", "cyan-crews-cross", "dance-ornate-keen", "deep-states-talk", @@ -95,20 +103,25 @@ "famous-trees-tan", "fancy-bananas-sing", "fast-bushes-fall", + "fast-wolves-render", "fifty-dingos-study", "fix-content-hmr", "fix-create-astro-registry-hang", + "fix-font-head-swap", "fix-forwarded-proto-allowed-domains", + "fix-large-static-routes-stack-overflow", "fix-markdoc-table-attributes", "fix-mdx-slot-hydration", "fix-preact-cloudflare-hooks", "fix-rewrite-non-ascii-paths", "fix-serve-files-outside-srcdir", + "fix-ssr-prerendered-image-deletion", "fix-store-race-condition", "fix-vite-runner-closed", "flat-lions-care", "flat-symbols-arrive", "floppy-bottles-notice", + "floppy-cases-hug", "fluffy-pets-greet", "fluffy-shrimps-drop", "four-insects-tan", @@ -119,23 +132,28 @@ "full-poems-divide", "funny-planes-lick", "giant-areas-press", + "giant-bananas-sit", "good-camels-pull", "good-clubs-cover", "great-nails-brake", "green-garlics-heal", + "green-plants-act", + "green-zebras-lick", "grumpy-tables-serve", - "happy-frogs-glow", "heavy-beers-unite", "heavy-cats-own", "heavy-parts-throw", "helpful-runtime-errors", "hojze-jglnm-ggfbv", "honest-deer-add", + "hot-eyes-sink", "hungry-jars-pump", "icy-pigs-smile", "internal-helpers-normalize-pathname", "itchy-ghosts-flow", + "jolly-dots-shop", "khaki-bushes-stop", + "khaki-toys-think", "kind-emus-relate", "kind-pears-behave", "large-ears-ask", @@ -164,6 +182,7 @@ "open-days-watch", "open-monkeys-boil", "optional-wrangler-config", + "orange-boats-refuse", "polite-terms-shop", "pretty-forks-smash", "proud-pans-change", @@ -182,8 +201,10 @@ "rich-horses-begin", "ripe-nights-feel", "route-data-breaking", + "rust-compiler-experimental", "sad-lines-hear", "sad-teams-end", + "server-island-slot-scripts", "short-pears-hammer", "shy-cats-grin", "silly-eels-remain", @@ -213,9 +234,11 @@ "swift-planets-swim", "tall-needles-cross", "tall-worms-live", + "tame-lemons-probe", "tangy-days-wink", "tangy-tables-jog", "tangy-years-grin", + "ten-numbers-rush", "tender-bats-tan", "tender-moose-help", "thin-hands-find", @@ -225,6 +248,7 @@ "tricky-donkeys-camp", "true-bats-punch", "true-dingos-attack", + "twenty-signs-brush", "upset-dodos-rhyme", "vite-environments-breaking", "vite-plugin-react-v5", diff --git a/.changeset/server-island-slot-scripts.md b/.changeset/server-island-slot-scripts.md new file mode 100644 index 000000000000..3066706588e2 --- /dev/null +++ b/.changeset/server-island-slot-scripts.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a case where ` +
This page tests script and style tags
+