-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
(typescript) Add JSX support to Typescript #1155
(typescript) Add JSX support to Typescript #1155
Comments
Ping @isagalaev? |
We'll get to this (and other) issues eventually. No estimates though, as there are too few of us… |
OK, no problem -- I just noticed that this was the only open issue without a label so I was afraid you'd missed it. :) |
Is there any progress on this? @pkaminski have you figured out any other solution? Thanks :) |
Nope, I don't have any workaround at this time, sorry. |
Thanks for the answer. I'll use 'js' as language than, it looks good enough. |
This uses the same rules as JavaScript's JSX support. Fixes highlightjs#1155
This uses the same rules as JavaScript's JSX support. Fixes highlightjs#1155
This uses the same rules as JavaScript's JSX support. Fixes highlightjs#1155
This uses the same rules as JavaScript's JSX support. Fixes highlightjs#1155
This uses the same rules as JavaScript's JSX support. Fixes highlightjs#1155
Tagging this beginner friendly and help welcome incase @ddevault doesn't have time to see this thru to completition. |
This will be closed by #2568 when it closes. |
No. It's built into Typescript now just like Javascript. It's not a different grammar. |
@joshgoebel it would be much nicer to use My IDE (WebStorm) complains when writing TSX code inside of a But it does not complain when the code from above is inside of a Unfortunately, highlight.js only renders syntax highlighting when using |
But how is this relevant to us? If you just mean "people think of it as tsx"... then it seems like perhaps we should add an alias to typescript for Right now our current grammar should "just work" regardless of whether you throw TS or TSX at it... meaning there is no need for two grammars. Having a separate TS grammar would be simpler in one or two regards (highlighting operators, no having to tell type annotations from HTML), but I dunno if having yet another variant is actually a good idea or not. Because if we went that way we'd really need 4:
Definitely something to keep in mind if I ever find the time to try and finish/flesh out our TSX support further. |
In fact since we already do this for |
Using an alias sounds like a great idea. It will improve the developer experience for people like me who edit files, which are later highlighted by highlight.js, and want to have syntax support in their IDEs (which differentiate between TS and TSX). |
There's a somewhat popular variant of TypeScript that incorporates JSX, and replaces TypeScript's normal angle-bracket casts with the
as
keyword. Source files typically end in.tsx
. It would be nice to have a language definition for this -- it's not hard to make one, but not clear how to cleanly share the bulk of the definition withtypescript
.Related issues: #878, Reviewable/Reviewable#285
The text was updated successfully, but these errors were encountered: