Skip to content

Commit

Permalink
feat: export JSX types from jsx-runtime (#9501)
Browse files Browse the repository at this point in the history
* feat: export JSX types from jsx-runtime

* fix: i wont make the same mistakes three times

* chore: changeset
  • Loading branch information
Princesseuh authored Dec 23, 2023
1 parent 4660aaa commit eb36e95
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-tips-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Export JSX namespace from `astro/jsx-runtime` for language tooling to consume
6 changes: 6 additions & 0 deletions packages/astro/jsx-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Q: Why this file?
// A: Our language tooling needs to access the JSX types from `astro/jsx-runtime`, due to TS limitations, however we
// can't import `astro-jsx` types inside the actual `jsx-runtime/index.js` file due to circular dependency issues.
import './astro-jsx.js';
export * from './dist/jsx-runtime/index.js';
export import JSX = astroHTML.JSX;
8 changes: 5 additions & 3 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@
"./env": "./env.d.ts",
"./types": "./types.d.ts",
"./client": "./client.d.ts",
"./import-meta": "./import-meta.d.ts",
"./astro-jsx": "./astro-jsx.d.ts",
"./tsconfigs/*.json": "./tsconfigs/*",
"./tsconfigs/*": "./tsconfigs/*.json",
"./jsx/*": "./dist/jsx/*",
"./jsx-runtime": "./dist/jsx-runtime/index.js",
"./jsx-runtime": {
"types": "./jsx-runtime.d.ts",
"default": "./dist/jsx-runtime/index.js"
},
"./compiler-runtime": "./dist/runtime/compiler/index.js",
"./runtime/*": "./dist/runtime/*",
"./config": {
Expand Down Expand Up @@ -90,9 +92,9 @@
"zod.mjs",
"env.d.ts",
"client.d.ts",
"jsx-runtime.d.ts",
"content-types.template.d.ts",
"content-module.template.mjs",
"import-meta.d.ts",
"astro-jsx.d.ts",
"types.d.ts",
"README.md",
Expand Down

0 comments on commit eb36e95

Please sign in to comment.