4 ms·
Thanks for trying that out the jQuery example. They look to be making the compiler (or the playground site) more permissive lately. This didn't work in May when
by c0achmcguirk 13y ago
Thanks for trying that out the jQuery example. They look to be making the compiler (or the playground site) more permissive lately. This didn't work in May when I last tried it out.
I've used the typescript compiler on a randomly-chosen JS library (typeface.js http://typeface.neocracy.org/typeface-0.15.js http://typeface.neocracy.org/typeface-0.15.js ) and it had dozens of compiler errors for me to fix before it would compile. The playground is now accepting them for some odd reason. This seems to be recent behavior or perhaps the node.js version of the compiler behaves differently?
- seanmcdirmid 13y agoThe title of the article is "...the Road to 1.0", you can imagine that they are continuously improving it to get there.
- rictic 13y agoOne thing that threw me off initially is the fact that typescript will complain about errors, but still do the translation of TS -> JS. For example: var s = 'hello'; s.toExponential(); Typescript tells you about the obvious error that there's no property 'toExponential' on strings, but it also merrily produces yourfilename.js. In my experience so long as you don't have any syntax errors, tsc will give you back javascript. This is partly because the translation from typescript to javascript is incredibly straightforwards and ignores the types completely. Writing a nonvalidating, dumb but super fast ts -> js transpiler is about an afternoon's worth of work, especially if you bootstrapped from the typescript parser and tests.