Skip to content
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

Merged
merged 4 commits into from
Dec 23, 2023
Merged

feat: export JSX types from jsx-runtime #9501

merged 4 commits into from
Dec 23, 2023

Conversation

Princesseuh
Copy link
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

Copy link

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
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
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.

None yet

4 participants