Skip to content

feat: export JSX types from jsx-runtime#9501

Merged
Princesseuh merged 4 commits intomainfrom
fix/export-jsx
Dec 23, 2023
Merged

feat: export JSX types from jsx-runtime#9501
Princesseuh merged 4 commits intomainfrom
fix/export-jsx

Conversation

@Princesseuh
Copy link
Copy Markdown
Member

@Princesseuh Princesseuh commented Dec 22, 2023

Changes

We're migrating our language-tooling to use JSX pragmas, but this require exporting astroHTML.JSX as JSX from something named jsx-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

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Dec 22, 2023

🦋 Changeset detected

Latest 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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Dec 22, 2023
@github-actions github-actions bot added the pr: docs A PR that includes documentation for review label Dec 22, 2023
@Princesseuh Princesseuh marked this pull request as ready for review December 22, 2023 18:53
// 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;
Copy link
Copy Markdown
Member Author

@Princesseuh Princesseuh Dec 22, 2023

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

Copy link
Copy Markdown
Contributor

@jasikpark jasikpark left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants