feat(tsx): Prefix tsx output with a JSX pragma#917
Conversation
🦋 Changeset detectedLatest commit: 9a69bbf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
!preview tsx-prefix |
|
| if char != ';' { | ||
| p.addNilSourceMapping() | ||
| p.print("\"\";") | ||
| p.print("{};") |
There was a problem hiding this comment.
From my tests, this seemed fine as a replacement of "";, but I feel like there must be a reason I went for ""; back in the day. Can't remember it, though. I also wonder if TypeScript didn't fix a lot of those issues in the past 2 years...
(When I first joined Astro, it was ;//, from withastro/language-tools#59 )
|
!preview tsx-prefix |
|
Ah, I forgot to mention the justification, it's because it's seen as a string pragma (like use client, use strict) and so TypeScript will attempt to move it at the top of the file, which messes with imports |
|
Ah ok, makes sense now |
Changes
Add
/** @jsxImportSource astro */to our TSX output so it uses the newly exported types at withastro/astro#9501, this is all to attempt to fix withastro/language-tools#727Testing
Adjusted tests
Docs
N/A