From 72c981a628f435f37c6325245ee5510459115b42 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Fri, 9 Jun 2023 17:03:20 -0400 Subject: [PATCH 1/5] chore: remove legacy mdx mapping --- packages/astro/src/integrations/index.ts | 9 ------ .../content-entry-type.ts | 29 ------------------- 2 files changed, 38 deletions(-) diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index 6e27920eb89b..c9f41eb30f34 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -150,15 +150,6 @@ export async function runHookConfigSetup({ logging, }); - // Add MDX content entry type to support older `@astrojs/mdx` versions - // TODO: remove in next Astro minor release - if ( - integration.name === '@astrojs/mdx' && - !updatedSettings.contentEntryTypes.find((c) => c.extensions.includes('.mdx')) - ) { - addContentEntryType(mdxContentEntryType); - } - // Add custom client directives to settings, waiting for compiled code by esbuild for (const [name, compiled] of addedClientDirectives) { updatedSettings.clientDirectives.set(name, await compiled); diff --git a/packages/astro/src/vite-plugin-markdown/content-entry-type.ts b/packages/astro/src/vite-plugin-markdown/content-entry-type.ts index a3489c940132..92bb118d43a7 100644 --- a/packages/astro/src/vite-plugin-markdown/content-entry-type.ts +++ b/packages/astro/src/vite-plugin-markdown/content-entry-type.ts @@ -16,32 +16,3 @@ export const markdownContentEntryType: ContentEntryType = { // We need to handle propagation for Markdown because they support layouts which will bring in styles. handlePropagation: true, }; - -/** - * MDX content type for compatibility with older `@astrojs/mdx` versions - * TODO: remove in next Astro minor release - */ -export const mdxContentEntryType: ContentEntryType = { - extensions: ['.mdx'], - async getEntryInfo({ fileUrl, contents }: { fileUrl: URL; contents: string }) { - const parsed = parseFrontmatter(contents, fileURLToPath(fileUrl)); - return { - data: parsed.data, - body: parsed.content, - slug: parsed.data.slug, - rawData: parsed.matter, - }; - }, - // MDX can import scripts and styles, - // so wrap all MDX files with script / style propagation checks - handlePropagation: true, - contentModuleTypes: `declare module 'astro:content' { - interface Render { - '.mdx': Promise<{ - Content: import('astro').MarkdownInstance<{}>['Content']; - headings: import('astro').MarkdownHeading[]; - remarkPluginFrontmatter: Record; - }>; - } -}`, -}; From 69ea8c531bedbef12d5986c37ece67ddf82728d5 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Fri, 9 Jun 2023 17:04:34 -0400 Subject: [PATCH 2/5] chore: changeset --- .changeset/six-keys-cheat.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/six-keys-cheat.md diff --git a/.changeset/six-keys-cheat.md b/.changeset/six-keys-cheat.md new file mode 100644 index 000000000000..7d85209fd4bd --- /dev/null +++ b/.changeset/six-keys-cheat.md @@ -0,0 +1,5 @@ +--- +'astro': minor +--- + +Remove legacy handling for MDX content collections. Ensure you are using @astrojs/mdx v0.18 and above. From 05781d9e0cacb80392c3ef7edecff575a7867eac Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 12 Jun 2023 10:50:37 -0400 Subject: [PATCH 3/5] chore: remove dead mdxEntryType --- packages/astro/src/integrations/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index c9f41eb30f34..f0abd1576263 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -19,7 +19,6 @@ import { buildClientDirectiveEntrypoint } from '../core/client-directive/index.j import { mergeConfig } from '../core/config/config.js'; import { info, type LogOptions } from '../core/logger/core.js'; import { isServerLikeOutput } from '../prerender/utils.js'; -import { mdxContentEntryType } from '../vite-plugin-markdown/content-entry-type.js'; async function withTakingALongTimeMsg({ name, From 3a44e269d13d9399642c99ee241287dd8400ee76 Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Wed, 21 Jun 2023 07:21:21 -0400 Subject: [PATCH 4/5] nit: comments on mdx pkg name Co-authored-by: Emanuele Stoppa --- .changeset/six-keys-cheat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/six-keys-cheat.md b/.changeset/six-keys-cheat.md index 7d85209fd4bd..6059ff6a1809 100644 --- a/.changeset/six-keys-cheat.md +++ b/.changeset/six-keys-cheat.md @@ -2,4 +2,4 @@ 'astro': minor --- -Remove legacy handling for MDX content collections. Ensure you are using @astrojs/mdx v0.18 and above. +Remove legacy handling for MDX content collections. Ensure you are using `@astrojs/mdx` v0.18 and above. From c949a0a5e78b790f7e98537f2c174b12b66c67c0 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Wed, 21 Jun 2023 14:09:59 -0400 Subject: [PATCH 5/5] smol smol smol nit: and vs or --- .changeset/six-keys-cheat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/six-keys-cheat.md b/.changeset/six-keys-cheat.md index 6059ff6a1809..cf0c9bae5609 100644 --- a/.changeset/six-keys-cheat.md +++ b/.changeset/six-keys-cheat.md @@ -2,4 +2,4 @@ 'astro': minor --- -Remove legacy handling for MDX content collections. Ensure you are using `@astrojs/mdx` v0.18 and above. +Remove legacy handling for MDX content collections. Ensure you are using `@astrojs/mdx` v0.18 or above.