diff --git a/.changeset/cuddly-baboons-begin.md b/.changeset/cuddly-baboons-begin.md new file mode 100644 index 000000000000..bfb45dae0a47 --- /dev/null +++ b/.changeset/cuddly-baboons-begin.md @@ -0,0 +1,5 @@ +--- +'@astrojs/markdown-remark': minor +--- + +Export remarkShiki and remarkPrism plugins diff --git a/.changeset/forty-hotels-itch.md b/.changeset/forty-hotels-itch.md new file mode 100644 index 000000000000..b13c6db35b5a --- /dev/null +++ b/.changeset/forty-hotels-itch.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vercel': patch +--- + +Fix Astro's `domains` and `remotePatterns` not being used by Vercel when using Vercel Image Optimization diff --git a/.changeset/giant-cycles-marry.md b/.changeset/giant-cycles-marry.md new file mode 100644 index 000000000000..284f8531b5bc --- /dev/null +++ b/.changeset/giant-cycles-marry.md @@ -0,0 +1,5 @@ +--- +'@astrojs/solid-js': patch +--- + +Fix hydration in Solid renderer diff --git a/.changeset/olive-deers-switch.md b/.changeset/olive-deers-switch.md deleted file mode 100644 index 84cba951a634..000000000000 --- a/.changeset/olive-deers-switch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/mdx': patch ---- - -Fix errors not having a stacktrace diff --git a/.changeset/strong-colts-hang.md b/.changeset/strong-colts-hang.md new file mode 100644 index 000000000000..90b822b41d42 --- /dev/null +++ b/.changeset/strong-colts-hang.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fix "Cannot read properties of null" error in CLI code diff --git a/.changeset/stupid-olives-push.md b/.changeset/stupid-olives-push.md new file mode 100644 index 000000000000..078e1c69bed5 --- /dev/null +++ b/.changeset/stupid-olives-push.md @@ -0,0 +1,5 @@ +--- +'@astrojs/mdx': patch +--- + +Use exported remarkShiki and remarkPrism plugins from `@astrojs/markdown-remark` diff --git a/.changeset/sweet-sheep-sell.md b/.changeset/sweet-sheep-sell.md new file mode 100644 index 000000000000..986a60478f60 --- /dev/null +++ b/.changeset/sweet-sheep-sell.md @@ -0,0 +1,5 @@ +--- +'@astrojs/svelte': patch +--- + +Fix potential memory leak when component is unmounted diff --git a/README.md b/README.md index 3a28ad530281..c49b4760e085 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Several official projects are maintained outside of this repo: ## Sponsors -Astro is generously supported by Netlify, Storyblok, and several other amazing organizations. +Astro is free, open source software made possible by these wonderful sponsors. [❤️ Sponsor Astro! ❤️](https://github.com/withastro/.github/blob/main/FUNDING.md) @@ -91,7 +91,7 @@ Astro is generously supported by Netlify, Storyblok, and several other amazing o [![Astro's sponsors.](https://astro.build/sponsors.png "Astro's sponsors. -Platinum sponsors: Netlify, storyblok, Vercel, Ship Shape, Google Chrome +Platinum sponsors: Vercel, storyblok, Netlify, Ship Shape, Google Chrome Gold sponsors: ‹div›RIOTS, DEEPGRAM, Transloadit, CloudCannon Sponsors: Monogram, Qoddi, Dimension")](https://github.com/sponsors/withastro) diff --git a/examples/basics/package.json b/examples/basics/package.json index d0a0d8f7bba1..f732916c21a5 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.9" + "astro": "^3.0.10" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index b3c524f4c453..e76a9055ac0d 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^1.0.1", + "@astrojs/mdx": "^1.0.2", "@astrojs/rss": "^3.0.0", "@astrojs/sitemap": "^3.0.0", - "astro": "^3.0.9" + "astro": "^3.0.10" } } diff --git a/examples/component/package.json b/examples/component/package.json index b2b270543a96..aa119f483c97 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^3.0.9" + "astro": "^3.0.10" }, "peerDependencies": { "astro": "^2.0.0-beta.0" diff --git a/examples/deno/package.json b/examples/deno/package.json index 973ebdca8e18..5815e400e09a 100644 --- a/examples/deno/package.json +++ b/examples/deno/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.9" + "astro": "^3.0.10" }, "devDependencies": { "@astrojs/deno": "^5.0.0" diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index a96093c5eea6..5f13afc74433 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -14,6 +14,6 @@ "@astrojs/alpinejs": "^0.3.0", "@types/alpinejs": "^3.7.2", "alpinejs": "^3.12.3", - "astro": "^3.0.9" + "astro": "^3.0.10" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index 404fe4c8dd90..054bb3c0b5b8 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^3.0.0", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^3.0.9", + "astro": "^3.0.10", "lit": "^2.8.0" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index 5b024a4a32ec..e590a485e098 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -16,7 +16,7 @@ "@astrojs/solid-js": "^3.0.0", "@astrojs/svelte": "^4.0.1", "@astrojs/vue": "^3.0.0", - "astro": "^3.0.9", + "astro": "^3.0.10", "preact": "^10.17.1", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index a17431e753b7..1d9ed72a9ae9 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.0.0", "@preact/signals": "^1.2.1", - "astro": "^3.0.9", + "astro": "^3.0.10", "preact": "^10.17.1" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index f0b5b5f98982..db5754bb2d1d 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -14,7 +14,7 @@ "@astrojs/react": "^3.0.1", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", - "astro": "^3.0.9", + "astro": "^3.0.10", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index e0f2f9b45ae0..e5d6ab7a987b 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^3.0.0", - "astro": "^3.0.9", + "astro": "^3.0.10", "solid-js": "^1.7.11" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 31b9f0ac1def..f7104d2fc11e 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/svelte": "^4.0.1", - "astro": "^3.0.9", + "astro": "^3.0.10", "svelte": "^4.2.0" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index 97d7e6037d69..f92608783d7a 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^3.0.0", - "astro": "^3.0.9", + "astro": "^3.0.10", "vue": "^3.3.4" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index 01f246380d55..2ebf73fdc5da 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^6.0.0", - "astro": "^3.0.9" + "astro": "^3.0.10" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index f8f6a7a14f67..5ec161e24ec3 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^3.0.9" + "astro": "^3.0.10" }, "peerDependencies": { "astro": "^2.0.0-beta.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index 4375233e36ff..79571c378e39 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^6.0.0", - "astro": "^3.0.9", + "astro": "^3.0.10", "html-minifier": "^4.0.0" } } diff --git a/examples/minimal/package.json b/examples/minimal/package.json index edd0a11e6a5c..b8e75bb6c42e 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.9" + "astro": "^3.0.10" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index b3ee60a10888..7e796a00fe68 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.9" + "astro": "^3.0.10" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 1b71525c22b7..43c0678cfc6d 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.9" + "astro": "^3.0.10" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index d6a72b46334f..3fc520d83a2f 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -14,7 +14,7 @@ "dependencies": { "@astrojs/node": "^6.0.0", "@astrojs/svelte": "^4.0.1", - "astro": "^3.0.9", + "astro": "^3.0.10", "svelte": "^4.2.0" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index 19c667974442..91549f22f20d 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/markdoc": "^0.5.0", - "astro": "^3.0.9" + "astro": "^3.0.10" } } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index 7beb4eb38e1a..b26e87e27505 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/markdown-remark": "^3.0.0", - "astro": "^3.0.9", + "astro": "^3.0.10", "hast-util-select": "^5.0.5", "rehype-autolink-headings": "^6.1.1", "rehype-slug": "^5.1.0", diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index 7b59b817b4b1..04fda8dcf274 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.9" + "astro": "^3.0.10" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index ff9ecdb5dc9c..20f48cfcc8ad 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^1.0.1", + "@astrojs/mdx": "^1.0.2", "@astrojs/preact": "^3.0.0", - "astro": "^3.0.9", + "astro": "^3.0.10", "preact": "^10.17.1" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 880586df2855..6f976aa7886f 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.0.0", "@nanostores/preact": "^0.5.0", - "astro": "^3.0.9", + "astro": "^3.0.10", "nanostores": "^0.9.3", "preact": "^10.17.1" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index 1bda2e29f3b9..b0f816abaa35 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -11,10 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^1.0.1", + "@astrojs/mdx": "^1.0.2", "@astrojs/tailwind": "^5.0.0", "@types/canvas-confetti": "^1.6.0", - "astro": "^3.0.9", + "astro": "^3.0.10", "autoprefixer": "^10.4.15", "canvas-confetti": "^1.6.0", "postcss": "^8.4.28", diff --git a/examples/with-vite-plugin-pwa/package.json b/examples/with-vite-plugin-pwa/package.json index 55009fa4ed01..944c4dcbd4a3 100644 --- a/examples/with-vite-plugin-pwa/package.json +++ b/examples/with-vite-plugin-pwa/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.9", + "astro": "^3.0.10", "vite-plugin-pwa": "0.16.4", "workbox-window": "^7.0.0" } diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index fdbead58f8a1..2a24e8865145 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^3.0.9", + "astro": "^3.0.10", "vitest": "^0.34.2" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 5bd2e69d3be5..5cb03114ecb8 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,13 @@ # astro +## 3.0.10 + +### Patch Changes + +- [#8437](https://github.com/withastro/astro/pull/8437) [`b3cf1b327`](https://github.com/withastro/astro/commit/b3cf1b32765c76cfc90e497a68280ad52f02cb1f) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fix imports of images with uppercased file extensions not working + +- [#8440](https://github.com/withastro/astro/pull/8440) [`b92d066b7`](https://github.com/withastro/astro/commit/b92d066b737f64f08a9cf293bd07c9263ef8f32d) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Fix issue where `renderToFinalDestination` would throw in internal Astro code + ## 3.0.9 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index 4d45d722ac5d..7db6c2767649 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "3.0.9", + "version": "3.0.10", "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/astro/src/assets/vite-plugin-assets.ts b/packages/astro/src/assets/vite-plugin-assets.ts index d91d0e492867..f114e7ef8371 100644 --- a/packages/astro/src/assets/vite-plugin-assets.ts +++ b/packages/astro/src/assets/vite-plugin-assets.ts @@ -8,12 +8,14 @@ import { prependForwardSlash, removeQueryString, } from '../core/path.js'; -import { VIRTUAL_MODULE_ID, VIRTUAL_SERVICE_ID } from './consts.js'; +import { VALID_INPUT_FORMATS, VIRTUAL_MODULE_ID, VIRTUAL_SERVICE_ID } from './consts.js'; import { emitESMImage } from './utils/emitAsset.js'; import { hashTransform, propsToFilename } from './utils/transformToPath.js'; const resolvedVirtualModuleId = '\0' + VIRTUAL_MODULE_ID; +const assetRegex = new RegExp(`\.(${VALID_INPUT_FORMATS.join('|')})$`, 'i'); + export default function assets({ settings, mode, @@ -121,7 +123,7 @@ export default function assets({ if (id !== removeQueryString(id)) { return; } - if (/\.(jpeg|jpg|png|tiff|webp|gif|svg)$/.test(id)) { + if (assetRegex.test(id)) { const meta = await emitESMImage(id, this.meta.watchMode, this.emitFile); return `export default ${JSON.stringify(meta)}`; } diff --git a/packages/astro/src/cli/telemetry/index.ts b/packages/astro/src/cli/telemetry/index.ts index dffb18bd90d0..fd664fcc9441 100644 --- a/packages/astro/src/cli/telemetry/index.ts +++ b/packages/astro/src/cli/telemetry/index.ts @@ -9,7 +9,7 @@ interface TelemetryOptions { } export async function notify() { - const packageManager = (await whichPm(process.cwd())).name ?? 'npm'; + const packageManager = (await whichPm(process.cwd()))?.name ?? 'npm'; await telemetry.notify(() => { console.log(msg.telemetryNotice(packageManager) + '\n'); return true; diff --git a/packages/astro/src/runtime/server/render/any.ts b/packages/astro/src/runtime/server/render/any.ts index 89c92757690a..0b61f919cd21 100644 --- a/packages/astro/src/runtime/server/render/any.ts +++ b/packages/astro/src/runtime/server/render/any.ts @@ -18,6 +18,7 @@ export async function renderChild(destination: RenderDestination, child: any) { }); }); for (const childRender of childRenders) { + if (!childRender) continue; await childRender.renderToFinalDestination(destination); } } else if (typeof child === 'function') { diff --git a/packages/astro/test/core-image.test.js b/packages/astro/test/core-image.test.js index c2f9b698276a..f5a1b28f4fd4 100644 --- a/packages/astro/test/core-image.test.js +++ b/packages/astro/test/core-image.test.js @@ -3,10 +3,10 @@ import * as cheerio from 'cheerio'; import { basename } from 'node:path'; import { Writable } from 'node:stream'; import { removeDir } from '../dist/core/fs/index.js'; +import { Logger } from '../dist/core/logger/core.js'; import testAdapter from './test-adapter.js'; import { testImageService } from './test-image-service.js'; import { loadFixture } from './test-utils.js'; -import { Logger } from '../dist/core/logger/core.js'; describe('astro:image', () => { /** @type {import('./test-utils').Fixture} */ @@ -159,6 +159,21 @@ describe('astro:image', () => { res = await fixture.fetch(src); expect(res.status).to.equal(200); }); + + it('supports uppercased imports', async () => { + let res = await fixture.fetch('/uppercase'); + let html = await res.text(); + $ = cheerio.load(html); + + let $img = $('img'); + expect($img).to.have.a.lengthOf(1); + + let src = $img.attr('src'); + let loading = $img.attr('loading'); + res = await fixture.fetch(src); + expect(res.status).to.equal(200); + expect(loading).to.not.be.undefined; + }); }); describe('vite-isms', () => { diff --git a/packages/astro/test/fixtures/core-image/src/assets/walrus.JPG b/packages/astro/test/fixtures/core-image/src/assets/walrus.JPG new file mode 100644 index 000000000000..123958e89f96 Binary files /dev/null and b/packages/astro/test/fixtures/core-image/src/assets/walrus.JPG differ diff --git a/packages/astro/test/fixtures/core-image/src/pages/uppercase.astro b/packages/astro/test/fixtures/core-image/src/pages/uppercase.astro new file mode 100644 index 000000000000..30a04f2f09ea --- /dev/null +++ b/packages/astro/test/fixtures/core-image/src/pages/uppercase.astro @@ -0,0 +1,6 @@ +--- +import { Image } from "astro:assets"; +import walrus from "../assets/walrus.JPG"; +--- + +My favorite animal, the walrus diff --git a/packages/integrations/cloudflare/package.json b/packages/integrations/cloudflare/package.json index 6cc0ac32da98..6d231a3e6727 100644 --- a/packages/integrations/cloudflare/package.json +++ b/packages/integrations/cloudflare/package.json @@ -45,7 +45,7 @@ "tiny-glob": "^0.2.9" }, "peerDependencies": { - "astro": "workspace:^3.0.9" + "astro": "workspace:^3.0.10" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/deno/package.json b/packages/integrations/deno/package.json index b941f976f6e4..843ac65ddc64 100644 --- a/packages/integrations/deno/package.json +++ b/packages/integrations/deno/package.json @@ -36,7 +36,7 @@ "esbuild": "^0.19.2" }, "peerDependencies": { - "astro": "workspace:^3.0.9" + "astro": "workspace:^3.0.10" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/markdoc/package.json b/packages/integrations/markdoc/package.json index 49b05d19fe2c..513c126115e0 100644 --- a/packages/integrations/markdoc/package.json +++ b/packages/integrations/markdoc/package.json @@ -75,7 +75,7 @@ "zod": "3.21.1" }, "peerDependencies": { - "astro": "workspace:^3.0.9" + "astro": "workspace:^3.0.10" }, "devDependencies": { "@astrojs/markdown-remark": "workspace:*", diff --git a/packages/integrations/mdx/CHANGELOG.md b/packages/integrations/mdx/CHANGELOG.md index 67031990bccd..61144df435a9 100644 --- a/packages/integrations/mdx/CHANGELOG.md +++ b/packages/integrations/mdx/CHANGELOG.md @@ -1,5 +1,14 @@ # @astrojs/mdx +## 1.0.2 + +### Patch Changes + +- [#8438](https://github.com/withastro/astro/pull/8438) [`6df4f3bd9`](https://github.com/withastro/astro/commit/6df4f3bd9d74de47dc8732e7f3b42bef42d2facf) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fix errors not having a stacktrace + +- Updated dependencies [[`b3cf1b327`](https://github.com/withastro/astro/commit/b3cf1b32765c76cfc90e497a68280ad52f02cb1f), [`b92d066b7`](https://github.com/withastro/astro/commit/b92d066b737f64f08a9cf293bd07c9263ef8f32d)]: + - astro@3.0.10 + ## 1.0.1 ### Patch Changes diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index ddd2925fd15a..5d9296f1ff4f 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/mdx", "description": "Add support for MDX pages in your Astro site", - "version": "1.0.1", + "version": "1.0.2", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", @@ -35,7 +35,6 @@ }, "dependencies": { "@astrojs/markdown-remark": "workspace:*", - "@astrojs/prism": "workspace:*", "@mdx-js/mdx": "^2.3.0", "acorn": "^8.10.0", "es-module-lexer": "^1.3.0", @@ -45,16 +44,14 @@ "hast-util-to-html": "^8.0.4", "kleur": "^4.1.4", "rehype-raw": "^6.1.1", - "remark-frontmatter": "^4.0.1", "remark-gfm": "^3.0.1", "remark-smartypants": "^2.0.0", - "shiki": "^0.14.3", "source-map": "^0.7.4", "unist-util-visit": "^4.1.2", "vfile": "^5.3.7" }, "peerDependencies": { - "astro": "workspace:^3.0.9" + "astro": "workspace:^3.0.10" }, "devDependencies": { "@types/chai": "^4.3.5", diff --git a/packages/integrations/mdx/src/plugins.ts b/packages/integrations/mdx/src/plugins.ts index 5d7b9b58cc25..a3d9e4ff30ee 100644 --- a/packages/integrations/mdx/src/plugins.ts +++ b/packages/integrations/mdx/src/plugins.ts @@ -1,4 +1,9 @@ -import { rehypeHeadingIds, remarkCollectImages } from '@astrojs/markdown-remark'; +import { + rehypeHeadingIds, + remarkCollectImages, + remarkPrism, + remarkShiki, +} from '@astrojs/markdown-remark'; import { InvalidAstroDataError, safelyGetAstroData, @@ -16,8 +21,6 @@ import { rehypeInjectHeadingsExport } from './rehype-collect-headings.js'; import rehypeMetaString from './rehype-meta-string.js'; import { rehypeOptimizeStatic } from './rehype-optimize-static.js'; import { remarkImageToComponent } from './remark-images-to-component.js'; -import remarkPrism from './remark-prism.js'; -import remarkShiki from './remark-shiki.js'; import { jsToTreeNode } from './utils.js'; // Skip nonessential plugins during performance benchmark runs @@ -112,7 +115,7 @@ export async function getRemarkPlugins(mdxOptions: MdxOptions): Promise - visit(tree, 'code', (node: any) => { - let { lang, value } = node; - node.type = 'html'; - - let { html, classLanguage } = runHighlighterWithAstro(lang, value); - let classes = [classLanguage]; - node.value = `
${html}
`; - return node; - }); -} diff --git a/packages/integrations/mdx/src/remark-shiki.ts b/packages/integrations/mdx/src/remark-shiki.ts deleted file mode 100644 index a241aaa4e5b1..000000000000 --- a/packages/integrations/mdx/src/remark-shiki.ts +++ /dev/null @@ -1,94 +0,0 @@ -import type { ShikiConfig } from 'astro'; -import type * as shiki from 'shiki'; -import { getHighlighter } from 'shiki'; -import { visit } from 'unist-util-visit'; - -/** - * getHighlighter() is the most expensive step of Shiki. Instead of calling it on every page, - * cache it here as much as possible. Make sure that your highlighters can be cached, state-free. - * We make this async, so that multiple calls to parse markdown still share the same highlighter. - */ -const highlighterCacheAsync = new Map>(); - -const remarkShiki = async ({ langs = [], theme = 'github-dark', wrap = false }: ShikiConfig) => { - const cacheID: string = typeof theme === 'string' ? theme : theme.name; - let highlighterAsync = highlighterCacheAsync.get(cacheID); - if (!highlighterAsync) { - highlighterAsync = getHighlighter({ theme }).then((hl) => { - hl.setColorReplacements({ - '#000001': 'var(--astro-code-color-text)', - '#000002': 'var(--astro-code-color-background)', - '#000004': 'var(--astro-code-token-constant)', - '#000005': 'var(--astro-code-token-string)', - '#000006': 'var(--astro-code-token-comment)', - '#000007': 'var(--astro-code-token-keyword)', - '#000008': 'var(--astro-code-token-parameter)', - '#000009': 'var(--astro-code-token-function)', - '#000010': 'var(--astro-code-token-string-expression)', - '#000011': 'var(--astro-code-token-punctuation)', - '#000012': 'var(--astro-code-token-link)', - }); - return hl; - }); - highlighterCacheAsync.set(cacheID, highlighterAsync); - } - const highlighter = await highlighterAsync; - - // NOTE: There may be a performance issue here for large sites that use `lang`. - // Since this will be called on every page load. Unclear how to fix this. - for (const lang of langs) { - await highlighter.loadLanguage(lang); - } - - return () => (tree: any) => { - visit(tree, 'code', (node) => { - let lang: string; - - if (typeof node.lang === 'string') { - const langExists = highlighter.getLoadedLanguages().includes(node.lang); - if (langExists) { - lang = node.lang; - } else { - console.warn(`The language "${node.lang}" doesn't exist, falling back to plaintext.`); - lang = 'plaintext'; - } - } else { - lang = 'plaintext'; - } - - let html = highlighter.codeToHtml(node.value, { lang }); - - // Q: Couldn't these regexes match on a user's inputted code blocks? - // A: Nope! All rendered HTML is properly escaped. - // Ex. If a user typed `([\+|\-])/g, - '$2' - ); - } - // Handle code wrapping - // if wrap=null, do nothing. - if (wrap === false) { - html = html.replace(/style="(.*?)"/, 'style="$1; overflow-x: auto;"'); - } else if (wrap === true) { - html = html.replace( - /style="(.*?)"/, - 'style="$1; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;"' - ); - } - - node.type = 'html'; - node.value = html; - node.children = []; - }); - }; -}; - -export default remarkShiki; diff --git a/packages/integrations/netlify/package.json b/packages/integrations/netlify/package.json index 3445d9f96441..a4b5479299e5 100644 --- a/packages/integrations/netlify/package.json +++ b/packages/integrations/netlify/package.json @@ -43,7 +43,7 @@ "esbuild": "^0.19.2" }, "peerDependencies": { - "astro": "workspace:^3.0.9" + "astro": "workspace:^3.0.10" }, "devDependencies": { "@netlify/edge-functions": "^2.0.0", diff --git a/packages/integrations/node/package.json b/packages/integrations/node/package.json index 12b1833f9ea8..22a795d1a515 100644 --- a/packages/integrations/node/package.json +++ b/packages/integrations/node/package.json @@ -37,7 +37,7 @@ "server-destroy": "^1.0.1" }, "peerDependencies": { - "astro": "workspace:^3.0.9" + "astro": "workspace:^3.0.10" }, "devDependencies": { "@types/node": "^18.17.8", diff --git a/packages/integrations/solid/src/client.ts b/packages/integrations/solid/src/client.ts index 71a7db5e2e93..58f41160da14 100644 --- a/packages/integrations/solid/src/client.ts +++ b/packages/integrations/solid/src/client.ts @@ -1,4 +1,3 @@ -import { sharedConfig } from 'solid-js'; import { createComponent, hydrate, render } from 'solid-js/web'; export default (element: HTMLElement) => @@ -11,19 +10,25 @@ export default (element: HTMLElement) => const boostrap = client === 'only' ? render : hydrate; + let slot: HTMLElement | null; let _slots: Record = {}; if (Object.keys(slotted).length > 0) { - // hydrating - if (sharedConfig.context) { - element.querySelectorAll('astro-slot').forEach((slot) => { - _slots[slot.getAttribute('name') || 'default'] = slot.cloneNode(true); + // hydratable + if (client !== 'only') { + const iterator = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, (node) => { + if (node === element) return NodeFilter.FILTER_SKIP; + if (node.nodeName === 'ASTRO-SLOT') return NodeFilter.FILTER_ACCEPT; + if (node.nodeName === 'ASTRO-ISLAND') return NodeFilter.FILTER_REJECT; + return NodeFilter.FILTER_SKIP; }); - } else { - for (const [key, value] of Object.entries(slotted)) { - _slots[key] = document.createElement('astro-slot'); - if (key !== 'default') _slots[key].setAttribute('name', key); - _slots[key].innerHTML = value; - } + while ((slot = iterator.nextNode() as HTMLElement | null)) + _slots[slot.getAttribute('name') || 'default'] = slot; + } + for (const [key, value] of Object.entries(slotted)) { + if (_slots[key]) continue; + _slots[key] = document.createElement('astro-slot'); + if (key !== 'default') _slots[key].setAttribute('name', key); + _slots[key].innerHTML = value; } } diff --git a/packages/integrations/svelte/client.js b/packages/integrations/svelte/client.js index 73cc305c147e..9e3df401915c 100644 --- a/packages/integrations/svelte/client.js +++ b/packages/integrations/svelte/client.js @@ -3,9 +3,9 @@ const noop = () => {}; let originalConsoleWarning; let consoleFilterRefs = 0; -export default (target) => { +export default (element) => { return (Component, props, slotted, { client }) => { - if (!target.hasAttribute('ssr')) return; + if (!element.hasAttribute('ssr')) return; const slots = {}; for (const [key, value] of Object.entries(slotted)) { slots[key] = createSlotDefinition(key, value); @@ -15,7 +15,7 @@ export default (target) => { if (import.meta.env.DEV) useConsoleFilter(); const component = new Component({ - target, + target: element, props: { ...props, $$slots: slots, diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index a6161eaaa8e3..814bad39ddce 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -48,7 +48,7 @@ "vite": "^4.4.9" }, "peerDependencies": { - "astro": "workspace:^3.0.9", + "astro": "workspace:^3.0.10", "svelte": "^3.55.0 || ^4.0.0" }, "engines": { diff --git a/packages/integrations/tailwind/package.json b/packages/integrations/tailwind/package.json index b0a2b0126bfa..3f88e6f6fcb8 100644 --- a/packages/integrations/tailwind/package.json +++ b/packages/integrations/tailwind/package.json @@ -43,7 +43,7 @@ "vite": "^4.4.9" }, "peerDependencies": { - "astro": "workspace:^3.0.9", + "astro": "workspace:^3.0.10", "tailwindcss": "^3.0.24" } } diff --git a/packages/integrations/vercel/README.md b/packages/integrations/vercel/README.md index 9587ab96e0a8..73ecb622183b 100644 --- a/packages/integrations/vercel/README.md +++ b/packages/integrations/vercel/README.md @@ -114,6 +114,8 @@ export default defineConfig({ Configuration options for [Vercel's Image Optimization API](https://vercel.com/docs/concepts/image-optimization). See [Vercel's image configuration documentation](https://vercel.com/docs/build-output-api/v3/configuration#images) for a complete list of supported parameters. +The `domains` and `remotePatterns` properties will automatically be filled using [the Astro corresponding `image` settings](https://docs.astro.build/en/reference/configuration-reference/#image-options). + ```js // astro.config.mjs import { defineConfig } from 'astro/config'; diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json index f5b52b2fe5a0..d1e1eeb1c273 100644 --- a/packages/integrations/vercel/package.json +++ b/packages/integrations/vercel/package.json @@ -61,7 +61,7 @@ "web-vitals": "^3.4.0" }, "peerDependencies": { - "astro": "workspace:^3.0.9" + "astro": "workspace:^3.0.10" }, "devDependencies": { "@types/set-cookie-parser": "^2.4.3", diff --git a/packages/integrations/vercel/src/image/shared.ts b/packages/integrations/vercel/src/image/shared.ts index 7469ca9d04d4..f2843fe02573 100644 --- a/packages/integrations/vercel/src/image/shared.ts +++ b/packages/integrations/vercel/src/image/shared.ts @@ -1,9 +1,13 @@ -import type { ImageMetadata, ImageQualityPreset, ImageTransform } from 'astro'; - -export const defaultImageConfig: VercelImageConfig = { - sizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840], - domains: [], -}; +import type { AstroConfig, ImageMetadata, ImageQualityPreset, ImageTransform } from 'astro'; + +export function getDefaultImageConfig(astroImageConfig: AstroConfig['image']): VercelImageConfig { + return { + sizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840], + domains: astroImageConfig.domains ?? [], + // Cast is necessary here because Vercel's types are slightly different from ours regarding allowed protocols. Behavior should be the same, however. + remotePatterns: (astroImageConfig.remotePatterns as VercelImageConfig['remotePatterns']) ?? [], + }; +} export function isESMImportedImage(src: ImageMetadata | string): src is ImageMetadata { return typeof src === 'object'; @@ -56,11 +60,12 @@ export const qualityTable: Record = { max: 100, }; -export function getImageConfig( +export function getAstroImageConfig( images: boolean | undefined, imagesConfig: VercelImageConfig | undefined, command: string, useSquoosh: boolean | undefined + astroImageConfig: AstroConfig['image'] ) { if (images) { return { @@ -72,7 +77,7 @@ export function getImageConfig( ? '@astrojs/vercel/squoosh-dev-image-service' : '@astrojs/vercel/dev-image-service' : '@astrojs/vercel/build-image-service', - config: imagesConfig ? imagesConfig : defaultImageConfig, + config: imagesConfig ? imagesConfig : getDefaultImageConfig(astroImageConfig), }, }, }; diff --git a/packages/integrations/vercel/src/serverless/adapter.ts b/packages/integrations/vercel/src/serverless/adapter.ts index cee9c9b92eeb..1e223bf27524 100644 --- a/packages/integrations/vercel/src/serverless/adapter.ts +++ b/packages/integrations/vercel/src/serverless/adapter.ts @@ -9,7 +9,11 @@ import { AstroError } from 'astro/errors'; import glob from 'fast-glob'; import { basename } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; -import { defaultImageConfig, getImageConfig, type VercelImageConfig } from '../image/shared.js'; +import { + getAstroImageConfig, + getDefaultImageConfig, + type VercelImageConfig, +} from '../image/shared.js'; import { exposeEnv } from '../lib/env.js'; import { getVercelOutput, removeDir, writeJson } from '../lib/fs.js'; import { copyDependenciesToFunction } from '../lib/nft.js'; @@ -146,6 +150,7 @@ export default function vercelServerless({ }, }, ...getImageConfig(imageService, imagesConfig, command, useSquooshDev), + ...getAstroImageConfig(imageService, imagesConfig, command, useSquooshDev, config.image), }); }, 'astro:config:done': ({ setAdapter, config, logger }) => { @@ -252,7 +257,18 @@ You can set functionPerRoute: false to prevent surpassing the limit.` ...routeDefinitions, ], ...(imageService || imagesConfig - ? { images: imagesConfig ? imagesConfig : defaultImageConfig } + ? { + images: imagesConfig + ? { + ...imagesConfig, + domains: [...imagesConfig.domains, ..._config.image.domains], + remotePatterns: [ + ...(imagesConfig.remotePatterns ?? []), + ..._config.image.remotePatterns, + ], + } + : getDefaultImageConfig(_config.image), + } : {}), }); diff --git a/packages/integrations/vercel/src/static/adapter.ts b/packages/integrations/vercel/src/static/adapter.ts index 7cf5dd140ba3..232519c026bd 100644 --- a/packages/integrations/vercel/src/static/adapter.ts +++ b/packages/integrations/vercel/src/static/adapter.ts @@ -1,6 +1,10 @@ import type { AstroAdapter, AstroConfig, AstroIntegration } from 'astro'; -import { defaultImageConfig, getImageConfig, type VercelImageConfig } from '../image/shared.js'; +import { + getAstroImageConfig, + getDefaultImageConfig, + type VercelImageConfig, +} from '../image/shared.js'; import { exposeEnv } from '../lib/env.js'; import { emptyDir, getVercelOutput, writeJson } from '../lib/fs.js'; import { isServerLikeOutput } from '../lib/prerender.js'; @@ -61,7 +65,7 @@ export default function vercelStatic({ vite: { define: viteDefine, }, - ...getImageConfig(imageService, imagesConfig, command, useSquooshDev), + ...getAstroImageConfig(imageService, imagesConfig, command, useSquooshDev, config.image), }); }, 'astro:config:done': ({ setAdapter, config }) => { @@ -93,7 +97,18 @@ export default function vercelStatic({ { handle: 'filesystem' }, ], ...(imageService || imagesConfig - ? { images: imagesConfig ? imagesConfig : defaultImageConfig } + ? { + images: imagesConfig + ? { + ...imagesConfig, + domains: [...imagesConfig.domains, ..._config.image.domains], + remotePatterns: [ + ...(imagesConfig.remotePatterns ?? []), + ..._config.image.remotePatterns, + ], + } + : getDefaultImageConfig(_config.image), + } : {}), }); }, diff --git a/packages/integrations/vercel/test/fixtures/image/astro.config.mjs b/packages/integrations/vercel/test/fixtures/image/astro.config.mjs index 2a343d03577b..78923f2cbb9b 100644 --- a/packages/integrations/vercel/test/fixtures/image/astro.config.mjs +++ b/packages/integrations/vercel/test/fixtures/image/astro.config.mjs @@ -6,5 +6,10 @@ export default defineConfig({ adapter: vercel({imageService: true}), image: { service: testImageService(), + domains: ['astro.build'], + remotePatterns: [{ + protocol: 'https', + hostname: '**.amazonaws.com', + }], }, }); diff --git a/packages/integrations/vercel/test/image.test.js b/packages/integrations/vercel/test/image.test.js index 307e25c7778b..b8bc3af95bd8 100644 --- a/packages/integrations/vercel/test/image.test.js +++ b/packages/integrations/vercel/test/image.test.js @@ -32,7 +32,13 @@ describe('Image', () => { expect(vercelConfig.images).to.deep.equal({ sizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840], - domains: [], + domains: ['astro.build'], + remotePatterns: [ + { + protocol: 'https', + hostname: '**.amazonaws.com', + }, + ], }); }); diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json index 60d34634b3c7..276d019d25e5 100644 --- a/packages/integrations/vue/package.json +++ b/packages/integrations/vue/package.json @@ -56,7 +56,7 @@ "vue": "^3.3.4" }, "peerDependencies": { - "astro": "workspace:^3.0.9", + "astro": "workspace:^3.0.10", "vue": "^3.2.30" }, "engines": { diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index 43ab885b63a9..c54826bdc656 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -9,9 +9,8 @@ import { toRemarkInitializeAstroData } from './frontmatter-injection.js'; import { loadPlugins } from './load-plugins.js'; import { rehypeHeadingIds } from './rehype-collect-headings.js'; import { remarkCollectImages } from './remark-collect-images.js'; -import remarkPrism from './remark-prism.js'; -import scopedStyles from './remark-scoped-styles.js'; -import remarkShiki from './remark-shiki.js'; +import { remarkPrism } from './remark-prism.js'; +import { remarkShiki } from './remark-shiki.js'; import rehypeRaw from 'rehype-raw'; import rehypeStringify from 'rehype-stringify'; @@ -25,6 +24,8 @@ import { rehypeImages } from './rehype-images.js'; export { rehypeHeadingIds } from './rehype-collect-headings.js'; export { remarkCollectImages } from './remark-collect-images.js'; +export { remarkPrism } from './remark-prism.js'; +export { remarkShiki } from './remark-shiki.js'; export * from './types.js'; export const markdownConfigDefaults: Omit, 'drafts'> = { @@ -61,7 +62,6 @@ export async function renderMarkdown( frontmatter: userFrontmatter = {}, } = opts; const input = new VFile({ value: content, path: fileURL }); - const scopedClassName = opts.$?.scopedClassName; let parser = unified() .use(markdown) @@ -85,18 +85,14 @@ export async function renderMarkdown( }); if (!isPerformanceBenchmark) { - if (scopedClassName) { - parser.use([scopedStyles(scopedClassName)]); - } - if (syntaxHighlight === 'shiki') { - parser.use([await remarkShiki(shikiConfig, scopedClassName)]); + parser.use(remarkShiki, shikiConfig); } else if (syntaxHighlight === 'prism') { - parser.use([remarkPrism(scopedClassName)]); + parser.use(remarkPrism); } // Apply later in case user plugins resolve relative image paths - parser.use([remarkCollectImages]); + parser.use(remarkCollectImages); } parser.use([ diff --git a/packages/markdown/remark/src/remark-prism.ts b/packages/markdown/remark/src/remark-prism.ts index 6147d9ee9cf4..a3f476d6e4ab 100644 --- a/packages/markdown/remark/src/remark-prism.ts +++ b/packages/markdown/remark/src/remark-prism.ts @@ -1,31 +1,19 @@ import { runHighlighterWithAstro } from '@astrojs/prism/dist/highlighter'; import { visit } from 'unist-util-visit'; +import type { RemarkPlugin } from './types.js'; -type MaybeString = string | null | undefined; - -/** */ -function transformer(className: MaybeString) { +export function remarkPrism(): ReturnType { return function (tree: any) { - const visitor = (node: any) => { + visit(tree, 'code', (node) => { let { lang, value } = node; node.type = 'html'; let { html, classLanguage } = runHighlighterWithAstro(lang, value); let classes = [classLanguage]; - if (className) { - classes.push(className); - } node.value = `
${html}
`; return node; - }; - return visit(tree, 'code', visitor); + }); }; } - -function plugin(className: MaybeString) { - return transformer.bind(null, className); -} - -export default plugin; diff --git a/packages/markdown/remark/src/remark-scoped-styles.ts b/packages/markdown/remark/src/remark-scoped-styles.ts deleted file mode 100644 index ba8780bb7026..000000000000 --- a/packages/markdown/remark/src/remark-scoped-styles.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { visit } from 'unist-util-visit'; -const noVisit = new Set(['root', 'html', 'text']); - -/** */ -export default function scopedStyles(className: string) { - const visitor = (node: any) => { - if (noVisit.has(node.type)) return; - - const { data } = node; - let currentClassName = data?.hProperties?.class ?? ''; - node.data = node.data || {}; - node.data.hProperties = node.data.hProperties || {}; - node.data.hProperties.class = `${className} ${currentClassName}`.trim(); - - return node; - }; - return () => (tree: any) => visit(tree, visitor); -} diff --git a/packages/markdown/remark/src/remark-shiki.ts b/packages/markdown/remark/src/remark-shiki.ts index 77cbf16c6515..6cd3861e5cf1 100644 --- a/packages/markdown/remark/src/remark-shiki.ts +++ b/packages/markdown/remark/src/remark-shiki.ts @@ -1,7 +1,7 @@ import type * as shiki from 'shiki'; import { getHighlighter } from 'shiki'; import { visit } from 'unist-util-visit'; -import type { ShikiConfig } from './types.js'; +import type { RemarkPlugin, ShikiConfig } from './types.js'; /** * getHighlighter() is the most expensive step of Shiki. Instead of calling it on every page, @@ -10,10 +10,11 @@ import type { ShikiConfig } from './types.js'; */ const highlighterCacheAsync = new Map>(); -const remarkShiki = async ( - { langs = [], theme = 'github-dark', wrap = false }: ShikiConfig, - scopedClassName?: string | null -) => { +export function remarkShiki({ + langs = [], + theme = 'github-dark', + wrap = false, +}: ShikiConfig = {}): ReturnType { const cacheID: string = typeof theme === 'string' ? theme : theme.name; let highlighterAsync = highlighterCacheAsync.get(cacheID); if (!highlighterAsync) { @@ -35,15 +36,22 @@ const remarkShiki = async ( }); highlighterCacheAsync.set(cacheID, highlighterAsync); } - const highlighter = await highlighterAsync; - // NOTE: There may be a performance issue here for large sites that use `lang`. - // Since this will be called on every page load. Unclear how to fix this. - for (const lang of langs) { - await highlighter.loadLanguage(lang); - } + let highlighter: shiki.Highlighter; + + return async (tree: any) => { + // Lazily assign the highlighter as async can only happen within this function, + // and not on `remarkShiki` directly. + if (!highlighter) { + highlighter = await highlighterAsync!; + + // NOTE: There may be a performance issue here for large sites that use `lang`. + // Since this will be called on every page load. Unclear how to fix this. + for (const lang of langs) { + await highlighter.loadLanguage(lang); + } + } - return () => (tree: any) => { visit(tree, 'code', (node) => { let lang: string; @@ -69,10 +77,7 @@ const remarkShiki = async ( // <span class="line" // Replace "shiki" class naming with "astro" and add "is:raw". - html = html.replace( - /
/g, `;
 }
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ee6c198e34e8..605f793ec119 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -125,13 +125,13 @@ importers:
   examples/basics:
     dependencies:
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/blog:
     dependencies:
       '@astrojs/mdx':
-        specifier: ^1.0.1
+        specifier: ^1.0.2
         version: link:../../packages/integrations/mdx
       '@astrojs/rss':
         specifier: ^3.0.0
@@ -140,19 +140,19 @@ importers:
         specifier: ^3.0.0
         version: link:../../packages/integrations/sitemap
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/component:
     devDependencies:
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/deno:
     dependencies:
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
     devDependencies:
       '@astrojs/deno':
@@ -171,7 +171,7 @@ importers:
         specifier: ^3.12.3
         version: 3.12.3
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/framework-lit:
@@ -183,7 +183,7 @@ importers:
         specifier: ^0.2.1
         version: 0.2.1
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       lit:
         specifier: ^2.8.0
@@ -207,7 +207,7 @@ importers:
         specifier: ^3.0.0
         version: link:../../packages/integrations/vue
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       preact:
         specifier: ^10.17.1
@@ -237,7 +237,7 @@ importers:
         specifier: ^1.2.1
         version: 1.2.1(preact@10.17.1)
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       preact:
         specifier: ^10.17.1
@@ -255,7 +255,7 @@ importers:
         specifier: ^18.2.7
         version: 18.2.7
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       react:
         specifier: ^18.2.0
@@ -270,7 +270,7 @@ importers:
         specifier: ^3.0.0
         version: link:../../packages/integrations/solid
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       solid-js:
         specifier: ^1.7.11
@@ -282,7 +282,7 @@ importers:
         specifier: ^4.0.1
         version: link:../../packages/integrations/svelte
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       svelte:
         specifier: ^4.2.0
@@ -294,7 +294,7 @@ importers:
         specifier: ^3.0.0
         version: link:../../packages/integrations/vue
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       vue:
         specifier: ^3.3.4
@@ -306,13 +306,13 @@ importers:
         specifier: ^6.0.0
         version: link:../../packages/integrations/node
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/integration:
     devDependencies:
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/middleware:
@@ -321,7 +321,7 @@ importers:
         specifier: ^6.0.0
         version: link:../../packages/integrations/node
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       html-minifier:
         specifier: ^4.0.0
@@ -330,19 +330,19 @@ importers:
   examples/minimal:
     dependencies:
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/non-html-pages:
     dependencies:
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/portfolio:
     dependencies:
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/ssr:
@@ -354,7 +354,7 @@ importers:
         specifier: ^4.0.1
         version: link:../../packages/integrations/svelte
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       svelte:
         specifier: ^4.2.0
@@ -366,7 +366,7 @@ importers:
         specifier: ^0.5.0
         version: link:../../packages/integrations/markdoc
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/with-markdown-plugins:
@@ -375,7 +375,7 @@ importers:
         specifier: ^3.0.0
         version: link:../../packages/markdown/remark
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       hast-util-select:
         specifier: ^5.0.5
@@ -396,19 +396,19 @@ importers:
   examples/with-markdown-shiki:
     dependencies:
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
 
   examples/with-mdx:
     dependencies:
       '@astrojs/mdx':
-        specifier: ^1.0.1
+        specifier: ^1.0.2
         version: link:../../packages/integrations/mdx
       '@astrojs/preact':
         specifier: ^3.0.0
         version: link:../../packages/integrations/preact
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       preact:
         specifier: ^10.17.1
@@ -423,7 +423,7 @@ importers:
         specifier: ^0.5.0
         version: 0.5.0(nanostores@0.9.3)(preact@10.17.1)
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       nanostores:
         specifier: ^0.9.3
@@ -435,7 +435,7 @@ importers:
   examples/with-tailwindcss:
     dependencies:
       '@astrojs/mdx':
-        specifier: ^1.0.1
+        specifier: ^1.0.2
         version: link:../../packages/integrations/mdx
       '@astrojs/tailwind':
         specifier: ^5.0.0
@@ -444,7 +444,7 @@ importers:
         specifier: ^1.6.0
         version: 1.6.0
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       autoprefixer:
         specifier: ^10.4.15
@@ -462,7 +462,7 @@ importers:
   examples/with-vite-plugin-pwa:
     dependencies:
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       vite-plugin-pwa:
         specifier: 0.16.4
@@ -474,7 +474,7 @@ importers:
   examples/with-vitest:
     dependencies:
       astro:
-        specifier: ^3.0.9
+        specifier: ^3.0.10
         version: link:../../packages/astro
       vitest:
         specifier: ^0.34.2
@@ -3984,9 +3984,6 @@ importers:
       '@astrojs/markdown-remark':
         specifier: workspace:*
         version: link:../../markdown/remark
-      '@astrojs/prism':
-        specifier: workspace:*
-        version: link:../../astro-prism
       '@mdx-js/mdx':
         specifier: ^2.3.0
         version: 2.3.0
@@ -4014,18 +4011,12 @@ importers:
       rehype-raw:
         specifier: ^6.1.1
         version: 6.1.1
-      remark-frontmatter:
-        specifier: ^4.0.1
-        version: 4.0.1
       remark-gfm:
         specifier: ^3.0.1
         version: 3.0.1
       remark-smartypants:
         specifier: ^2.0.0
         version: 2.0.0
-      shiki:
-        specifier: ^0.14.3
-        version: 0.14.3
       source-map:
         specifier: ^0.7.4
         version: 0.7.4
@@ -4083,7 +4074,7 @@ importers:
         version: 4.0.3
       rehype-pretty-code:
         specifier: ^0.10.0
-        version: 0.10.0(shiki@0.14.3)
+        version: 0.10.0
       remark-math:
         specifier: ^5.1.1
         version: 5.1.1
@@ -11595,12 +11586,6 @@ packages:
     dependencies:
       reusify: 1.0.4
 
-  /fault@2.0.1:
-    resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==}
-    dependencies:
-      format: 0.2.2
-    dev: false
-
   /fenceparser@1.1.1:
     resolution: {integrity: sha512-VdkTsK7GWLT0VWMK5S5WTAPn61wJ98WPFwJiRHumhg4ESNUO/tnkU8bzzzc62o6Uk1SVhuZFLnakmDA4SGV7wA==}
     engines: {node: '>=12'}
@@ -11701,11 +11686,6 @@ packages:
       combined-stream: 1.0.8
       mime-types: 2.1.35
 
-  /format@0.2.2:
-    resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==}
-    engines: {node: '>=0.4.x'}
-    dev: false
-
   /formdata-polyfill@4.0.10:
     resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}
     engines: {node: '>=12.20.0'}
@@ -13329,14 +13309,6 @@ packages:
     transitivePeerDependencies:
       - supports-color
 
-  /mdast-util-frontmatter@1.0.1:
-    resolution: {integrity: sha512-JjA2OjxRqAa8wEG8hloD0uTU0kdn8kbtOWpPP94NBkfAlbxn4S8gCGf/9DwFtEeGPXrDcNXdiDjVaRdUFqYokw==}
-    dependencies:
-      '@types/mdast': 3.0.12
-      mdast-util-to-markdown: 1.5.0
-      micromark-extension-frontmatter: 1.1.0
-    dev: false
-
   /mdast-util-gfm-autolink-literal@1.0.3:
     resolution: {integrity: sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==}
     dependencies:
@@ -13599,15 +13571,6 @@ packages:
       micromark-util-types: 1.0.2
       uvu: 0.5.6
 
-  /micromark-extension-frontmatter@1.1.0:
-    resolution: {integrity: sha512-0nLelmvXR5aZ+F2IL6/Ed4cDnHLpL/VD/EELKuclsTWHrLI8UgxGHEmeoumeX2FXiM6z2WrBIOEcbKUZR8RYNg==}
-    dependencies:
-      fault: 2.0.1
-      micromark-util-character: 1.1.0
-      micromark-util-symbol: 1.0.1
-      micromark-util-types: 1.0.2
-    dev: false
-
   /micromark-extension-gfm-autolink-literal@1.0.4:
     resolution: {integrity: sha512-WCssN+M9rUyfHN5zPBn3/f0mIA7tqArHL/EKbv3CZK+LT2rG77FEikIQEqBkv46fOqXQK4NEW/Pc7Z27gshpeg==}
     dependencies:
@@ -15584,7 +15547,7 @@ packages:
       unified: 10.1.2
     dev: false
 
-  /rehype-pretty-code@0.10.0(shiki@0.14.3):
+  /rehype-pretty-code@0.10.0:
     resolution: {integrity: sha512-qCD071Y+vUxEy9yyrATPk2+W9q7qCbzZgtc9suZhu75bmRQvOlBhJt4d3WvqSMTamkKoFkvqtCjyAk+ggH+aXQ==}
     engines: {node: '>=16'}
     peerDependencies:
@@ -15593,7 +15556,6 @@ packages:
       '@types/hast': 2.3.5
       hash-obj: 4.0.0
       parse-numeric-range: 1.3.0
-      shiki: 0.14.3
     dev: true
 
   /rehype-raw@6.1.1:
@@ -15652,15 +15614,6 @@ packages:
     dependencies:
       unist-util-visit: 1.4.1
 
-  /remark-frontmatter@4.0.1:
-    resolution: {integrity: sha512-38fJrB0KnmD3E33a5jZC/5+gGAC2WKNiPw1/fdXJvijBlhA7RCsvJklrYJakS0HedninvaCYW8lQGf9C918GfA==}
-    dependencies:
-      '@types/mdast': 3.0.12
-      mdast-util-frontmatter: 1.0.1
-      micromark-extension-frontmatter: 1.1.0
-      unified: 10.1.2
-    dev: false
-
   /remark-gfm@3.0.1:
     resolution: {integrity: sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==}
     dependencies: