This repository was archived by the owner on Nov 17, 2025. It is now read-only.
Merged
Conversation
🦋 Changeset detectedLatest commit: 873a126 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Princesseuh
commented
Dec 21, 2023
Princesseuh
commented
Dec 21, 2023
Princesseuh
commented
Jan 5, 2024
| @@ -0,0 +1,6 @@ | |||
| --- | |||
Member
Author
There was a problem hiding this comment.
This needs to be in a real file now because otherwise it cannot seems to resolve astro/jsx-runtime, not sure why. Might be something with how fake files works in tests.
natemoo-re
approved these changes
Jan 5, 2024
Member
natemoo-re
left a comment
There was a problem hiding this comment.
As much as I am able to wrap my head around this it LGTM!
natemoo-re
reviewed
Jan 5, 2024
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fixing
astro check's checking behaviour so it checks.js(x)files properly revealed a problem: We forceastroHTML's types in every file types. This is not a problem in the editor really, because in Astro projects you kinda don't rely on the types of JSX components inside Astro files, but inastro check, this is obviously wrong.In withastro/compiler#917, I made it so our TSX is now prefixed with a JSX pragma, that way we don't need to force a JSX setting on every file, our files just set the proper runtime types to use automatically. Unfortunately, this is quite rigid and requires exporting the JSX types from somewhere named
package/jsx-runtime, so I did that in Astro's JSX runtime in withastro/astro#9501This is all great and awesome, however a lot of our mapping around auto imports and code actions depended on the frontmatter being the first thing in the generated TSX and JSX pragmas needs to be on the first lines of TSX files, so in withastro/compiler#931, I made it so the compiler now returns the ranges of the TSX inside the virtual file, that way we can map directly to there. This was a fair amount of work.
The diff is larger than it might seems due to many dependencies updates needed for kinda unrelated things, Volar's current essentially pre-1.0 state suggest updating everything to be at the same exact version when you update one thing. The Astro version used for tests was also updated to account for the jsx-runtime export
Fix #727 (I'll remove the
astro checkhotfix workaround in a separate PR)Fix #715 by accident too
Testing
Tests should pass! Updated the unit tests for the utils to match the new ranges they return (since they now return ranges in the TSX vs ranges in the Astro file, they might look inaccurate, but as far as I can tell, everything is okay!)
Docs
N/A