-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: export JSX types from jsx-runtime #9501
Conversation
🦋 Changeset detectedLatest commit: e7d566c The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is actual syntax that works. I had never seen that before yesterday
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty, horrifying code. lgtm
Changes
We're migrating our language-tooling to use JSX pragmas, but this require exporting
astroHTML.JSX
asJSX
from something namedjsx-runtime
because it's hardcoded in TypeScript, very annoying, but nonetheless we can do that!For users on previous versions of Astro, our language server will fake this export until a majority of users are on whatever version this is released in.
Testing
N/A. Tested manually that it works in the language-server
Docs
N/A