Skip to content

Commit

Permalink
Remove legacy.astroFlavoredMarkdown (#5771)
Browse files Browse the repository at this point in the history
* Remove legacy.astroFlavoredMarkdown

* update vue mdx test

* Add a changeset
  • Loading branch information
matthewp committed Jan 5, 2023
1 parent 9ef0c50 commit 259a539
Show file tree
Hide file tree
Showing 109 changed files with 15 additions and 1,870 deletions.
9 changes: 9 additions & 0 deletions .changeset/grumpy-days-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'astro': major
---

Removes support for astroFlavoredMarkdown

In 1.0 Astro moved the old Astro Flavored Markdown (also sometimes called Components in Markdown) to a legacy feature. This change removes the `legacy.astroFlavoredMarkdown` option completely.

In 2.0 this feature will not be available in Astro at all. We recommend migration to MDX for those were still using this feature in 1.x.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ import preact from '@astrojs/preact';

// https://astro.build/config
export default defineConfig({
legacy: {
astroFlavoredMarkdown: true,
},
integrations: [preact({ compat: true })],
});

This file was deleted.

3 changes: 0 additions & 3 deletions packages/astro/e2e/fixtures/preact-component/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ import mdx from '@astrojs/mdx';

// https://astro.build/config
export default defineConfig({
legacy: {
astroFlavoredMarkdown: true,
},
integrations: [preact(), mdx()],
});
32 changes: 0 additions & 32 deletions packages/astro/e2e/fixtures/preact-component/src/pages/markdown.md

This file was deleted.

3 changes: 0 additions & 3 deletions packages/astro/e2e/fixtures/react-component/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ import mdx from '@astrojs/mdx';

// https://astro.build/config
export default defineConfig({
legacy: {
astroFlavoredMarkdown: true,
},
integrations: [react(), mdx()],
});
32 changes: 0 additions & 32 deletions packages/astro/e2e/fixtures/react-component/src/pages/markdown.md

This file was deleted.

3 changes: 0 additions & 3 deletions packages/astro/e2e/fixtures/solid-component/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ import solid from '@astrojs/solid-js';

// https://astro.build/config
export default defineConfig({
legacy: {
astroFlavoredMarkdown: true,
},
integrations: [solid(), mdx()],
});
32 changes: 0 additions & 32 deletions packages/astro/e2e/fixtures/solid-component/src/pages/markdown.md

This file was deleted.

3 changes: 0 additions & 3 deletions packages/astro/e2e/fixtures/svelte-component/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ import mdx from '@astrojs/mdx';

// https://astro.build/config
export default defineConfig({
legacy: {
astroFlavoredMarkdown: true,
},
integrations: [svelte(), mdx()],
});
32 changes: 0 additions & 32 deletions packages/astro/e2e/fixtures/svelte-component/src/pages/markdown.md

This file was deleted.

3 changes: 0 additions & 3 deletions packages/astro/e2e/fixtures/vue-component/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import mdx from '@astrojs/mdx';

// https://astro.build/config
export default defineConfig({
legacy: {
astroFlavoredMarkdown: true,
},
integrations: [
mdx(),
vue({
Expand Down
32 changes: 0 additions & 32 deletions packages/astro/e2e/fixtures/vue-component/src/pages/markdown.md

This file was deleted.

8 changes: 0 additions & 8 deletions packages/astro/e2e/preact-compat-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@ test.describe('preact/compat components in Astro files', () => {
pageSourceFilePath: './src/pages/index.astro',
});
});

test.describe('preact/compat components in Markdown files', () => {
createTests({
...config,
pageUrl: '/markdown/',
pageSourceFilePath: './src/pages/markdown.md',
});
});
8 changes: 0 additions & 8 deletions packages/astro/e2e/preact-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ test.describe('Preact components in Astro files', () => {
});
});

test.describe('Preact components in Markdown files', () => {
createTests({
...config,
pageUrl: '/markdown/',
pageSourceFilePath: './src/pages/markdown.md',
});
});

test.describe('Preact components in MDX files', () => {
createTests({
...config,
Expand Down
8 changes: 0 additions & 8 deletions packages/astro/e2e/react-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ test.describe('React components in Astro files', () => {
});
});

test.describe('React components in Markdown files', () => {
createTests({
...config,
pageUrl: '/markdown/',
pageSourceFilePath: './src/pages/markdown.md',
});
});

test.describe('React components in MDX files', () => {
createTests({
...config,
Expand Down
8 changes: 0 additions & 8 deletions packages/astro/e2e/solid-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ test.describe('Solid components in Astro files', () => {
});
});

test.describe('Solid components in Markdown files', () => {
createTests({
...config,
pageUrl: '/markdown/',
pageSourceFilePath: './src/pages/markdown.md',
});
});

test.describe('Solid components in MDX files', () => {
createTests({
...config,
Expand Down
8 changes: 0 additions & 8 deletions packages/astro/e2e/svelte-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ test.describe('Svelte components in Astro files', () => {
});
});

test.describe('Svelte components in Markdown files', () => {
createTests({
...config,
pageUrl: '/markdown/',
pageSourceFilePath: './src/pages/markdown.md',
});
});

test.describe('Svelte components in MDX files', () => {
createTests({
...config,
Expand Down
8 changes: 0 additions & 8 deletions packages/astro/e2e/vue-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ test.describe('Vue components in Astro files', () => {
});
});

test.describe('Vue components in Markdown files', () => {
createTests({
...config,
pageUrl: '/markdown/',
pageSourceFilePath: './src/pages/markdown.md',
});
});

test.describe('Vue components in MDX files', () => {
createTests({
...config,
Expand Down
25 changes: 1 addition & 24 deletions packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,30 +870,7 @@ export interface AstroUserConfig {
* These flags allow you to opt in to some deprecated or otherwise outdated behavior of Astro
* in the latest version, so that you can continue to upgrade and take advantage of new Astro releases.
*/
legacy?: {
/**
* @docs
* @name legacy.astroFlavoredMarkdown
* @type {boolean}
* @default `false`
* @version 1.0.0-rc.1
* @description
* Enable Astro's pre-v1.0 support for components and JSX expressions in `.md` (and alternative extensions for markdown files like ".markdown") Markdown files.
* In Astro `1.0.0-rc`, this original behavior was removed as the default, in favor of our new [MDX integration](https://docs.astro.build/en/guides/integrations-guide/mdx/).
*
* To enable this behavior, set `legacy.astroFlavoredMarkdown` to `true` in your [`astro.config.mjs` configuration file](https://docs.astro.build/en/guides/configuring-astro/#the-astro-config-file).
*
* ```js
* {
* legacy: {
* // Example: Add support for legacy Markdown features
* astroFlavoredMarkdown: true,
* },
* }
* ```
*/
astroFlavoredMarkdown?: boolean;
};
legacy?: object;

/**
* @docs
Expand Down
1 change: 0 additions & 1 deletion packages/astro/src/core/build/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ async function generatePath(
logging,
markdown: {
...settings.config.markdown,
isAstroFlavoredMd: settings.config.legacy.astroFlavoredMarkdown,
isExperimentalContentCollections: settings.config.experimental.contentCollections,
contentDir: getContentPaths(settings.config).contentDir,
},
Expand Down
1 change: 0 additions & 1 deletion packages/astro/src/core/build/vite-plugin-ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ function buildManifest(
base: settings.config.base,
markdown: {
...settings.config.markdown,
isAstroFlavoredMd: settings.config.legacy.astroFlavoredMarkdown,
isExperimentalContentCollections: settings.config.experimental.contentCollections,
contentDir: getContentPaths(settings.config).contentDir,
},
Expand Down
Loading

0 comments on commit 259a539

Please sign in to comment.