Uh oh!
There was an error while loading. Please reload this page.
JSX and as operator - #3564
Conversation
There was a problem hiding this comment.
Double quotes on these.
JSX and `as` operator
Basarat Ali Syed (basarat)
commented
Jun 30, 2015
Chad Tolkien (@ctolkien) just pushed Ryan Cavanaugh (@RyanCavanaugh) love at first sight 🌹 |
Jason Imison (nosami)
commented
Jun 30, 2015
Basarat Ali Syed (@basarat) nice :) |
Tom Jacques (tejacques)
commented
Jul 1, 2015
This is great! Really excited to be able to use JSX in TypeScript. Not sure where best to voice this, so I'll mention it here -- is it a concern that the semantics of The Facebook devs working on Flow chose to deal with casts by reusing the colon notation, e.g.: varfoo: bar={}: barThe type annotations used between Flow and TypeScript are very similar otherwise, I'd love to see the similarities grow where possible to potentially improve the odds of ECMAScript standardization as well as tool interoperability. |
Ryan Cavanaugh (RyanCavanaugh)
commented
Jul 1, 2015
TypeScript already has many keywords/oprators that are the same as in other languages; adding one more isn't particularly interesting IMHO. Because none of our type-related syntax has runtime semantics, it shouldn't be too confusing that The flow-style assertion was discussed briefly at #3203 (comment). I'd also try to chime in at issue #296 for further discussion if you're interested. |
Lennart (Lenne231)
commented
Jul 3, 2015
Is it possible to emit react elements as defined in https://facebook.github.io/react/blog/2014/10/14/introducing-react-elements.html under "Third-party Languages" instead of |
Ryan Cavanaugh (RyanCavanaugh)
commented
Jul 4, 2015
You can use We'll be looking at what kind of JSX emit people find the most useful to see if it's worth the cost to add them to TypeScript directly. |
Lennart (Lenne231)
commented
Jul 4, 2015
Ok. There should be at least a compiler error if TypeScript emits |
Claudia Meadows (dead-claudia)
commented
Jul 8, 2015
Yeah...such a pragma is nice. Other places where JSX is used outside of React:
|
vilicvane (vilicvane)
commented
Jul 10, 2015
Does this mean Facebook is joining the TypeScript ecosystem along with Google? |
Ryan Cavanaugh (RyanCavanaugh)
commented
Jul 10, 2015
Thanks for the list! Keep it coming -- it's good for us to understand what other JSX transforms we might need to support.
No 😞 |
Mike Morton (mikemorton)
commented
Jul 14, 2015
Pretty cool that the atom editor is already integrated with this. Does anyone have any advice for getting visual studio to use the 1.6 compiler? |
Mohamed Hegazy (mhegazy)
commented
Jul 14, 2015
you can enable DevMode and get VS to work on the latest drops from master. |
Mike Morton (mikemorton)
commented
Jul 14, 2015
Thanks Mohamed Hegazy (@mhegazy) - I tried that but I'm finding visual studio is still not doing syntax highlighting on my tsx files and is complaining when I refer to them from .ts files. Would you expect DevMode to resolve that issue? |
Dan Quirk (danquirk)
commented
Jul 14, 2015
Mike Morton (@mikemorton) unfortunately not. DevMode updates the TypeScript portion of the language service but things like how we understand/interpret file type associations live in the part of Visual Studio code that needs to be installed via a published update. You could also try Atom's TypeScript plugin today. |
François REMY (FremyCompany)
commented
Aug 18, 2015
Does anyone working on this have any idea on how I could get this to work with Mithril? |
Dan Quirk (danquirk)
commented
Aug 20, 2015
François REMY (@FremyCompany) I would try StackOverflow, comments on PRs should really be specifically about the change and any implementation issues |
François REMY (FremyCompany)
commented
Aug 21, 2015
Dan Quirk (@danquirk) Thanks I'll wait for 1.6 to be more broadly supported and head towards StackOverflow at that time. I delete my comment feel free to do the same. |
This implements JSX parsing, typechecking, JSX emit, and React emit as specified in #3203, as well as the
asoperator suggested in #296.Each commit between 556cb70 and a5c44a3 contains a disjoint set of files for easier browsing. Commits after the
Baseline-acceptcommit will be touching arbitrary files.