-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Playground: dependencies for jsxImportSource are not installed #1427
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
Comments
I also tried placing /* @fooImportSource foo-package */ hoping it would import the I think we should stick with ES Module semantics anyway, because that's the standard way to import everything in JS world (and hence TS world). No idea why we want to import things with a new |
The compile-time semantics are built to replicate the source of truth for JSX parsing (aka the babel plugin) - but sure, I'd accept a PR adding the module in |
@orta My last comment was intended as a joke, but the actual attempt to use (Just kidding about supporting arbitrary |
TypeScript is doing the wrong thing with JSX, in my opinion. We should be able to use |
@orta One more example to make the bug clear: Two things:
|
The compiler follows the JSX babel implementation, so if that changes so will we. That said this is the website repo, and I'm still OK with what I said earlier. I'd accept a PR for where ATA would handle this case but given that most examples would import the module for its API anywau, it'd get picked up by that. |
Not sure if by that you mean I made another example, that shows that even if This JSX stuff is difficult to learn, and by it not working in playground may give users a false sense of that approach being wrong. |
Looks like the problem has been partially fixed, and now my previous comment's example works. If you comment that line out (and refresh), then the The separate |
TS team decided to use
/* @fooImportSource */
syntax for importing JSX types (otherwise if JSX types are imported withimport
syntax then the JSX expressions do not see theJSX
namespace), but the playground is unaware that it needs to import the dependencies for that sort of syntax:playground example
If we could instead rely on
import
for importing JSX types (as would be intuitive and aligned with EcmasScript standards and conventions, instead of having to use new@fooImportSource
syntax), the playground example (which will install solid-js based on theimport
statement) would just work already.The text was updated successfully, but these errors were encountered: