Skip to content

Commit

Permalink
Cleanup unused JSX code (#11741)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <[email protected]>
  • Loading branch information
bluwy and sarah11918 authored Aug 20, 2024
1 parent f239242 commit 6617491
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 772 deletions.
14 changes: 14 additions & 0 deletions .changeset/many-garlics-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'astro': major
---

Removes internal JSX handling and moves the responsibility to the `@astrojs/mdx` package directly. The following exports are also now removed:

- `astro/jsx/babel.js`
- `astro/jsx/component.js`
- `astro/jsx/index.js`
- `astro/jsx/renderer.js`
- `astro/jsx/server.js`
- `astro/jsx/transform-options.js`

If your project includes `.mdx` files, you must upgrade `@astrojs/mdx` to the latest version so that it doesn't rely on these entrypoints to handle your JSX.
7 changes: 7 additions & 0 deletions .changeset/perfect-fans-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astrojs/mdx': minor
---

Updates adapter server entrypoint to use `@astrojs/mdx/server.js`

This is an internal change. Handling JSX in your `.mdx` files has been moved from Astro internals and is now the responsibility of this integration. You should not notice a change in your project, and no update to your code is required.
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"./astro-jsx": "./astro-jsx.d.ts",
"./tsconfigs/*.json": "./tsconfigs/*",
"./tsconfigs/*": "./tsconfigs/*.json",
"./jsx/*": "./dist/jsx/*",
"./jsx/rehype.js": "./dist/jsx/rehype.js",
"./jsx-runtime": {
"types": "./jsx-runtime.d.ts",
"default": "./dist/jsx-runtime/index.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/build/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The emitted file has content similar to:
```js
const renderers = [
Object.assign(
{ name: 'astro:jsx', serverEntrypoint: 'astro/jsx/server.js', jsxImportSource: 'astro' },
{ name: 'astro:framework', serverEntrypoint: '@astrojs/framework/server.js' },
{ ssr: server_default },
),
];
Expand Down
2 changes: 0 additions & 2 deletions packages/astro/src/core/create-vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import htmlVitePlugin from '../vite-plugin-html/index.js';
import astroIntegrationsContainerPlugin from '../vite-plugin-integrations-container/index.js';
import astroLoadFallbackPlugin from '../vite-plugin-load-fallback/index.js';
import markdownVitePlugin from '../vite-plugin-markdown/index.js';
import mdxVitePlugin from '../vite-plugin-mdx/index.js';
import astroScannerPlugin from '../vite-plugin-scanner/index.js';
import astroScriptsPlugin from '../vite-plugin-scripts/index.js';
import astroScriptsPageSSRPlugin from '../vite-plugin-scripts/page-ssr.js';
Expand Down Expand Up @@ -136,7 +135,6 @@ export async function createVite(
astroEnv({ settings, mode, fs, sync }),
markdownVitePlugin({ settings, logger }),
htmlVitePlugin(),
mdxVitePlugin(),
astroPostprocessVitePlugin(),
astroIntegrationsContainerPlugin({ settings, logger }),
astroScriptsPageSSRPlugin({ settings }),
Expand Down
326 changes: 0 additions & 326 deletions packages/astro/src/jsx/babel.ts

This file was deleted.

9 changes: 0 additions & 9 deletions packages/astro/src/jsx/component.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/astro/src/jsx/index.ts

This file was deleted.

Loading

0 comments on commit 6617491

Please sign in to comment.