kentpham88

Using typescript in playground

Recommended Posts

Hello and welcome,

The playground is for writing Javascript. the typescript must be compiled and the playground is not currently designed for that.

Share this post


Link to post
Share on other sites
1 hour ago, Nabroski said:

basically microsoft don't want you to

I don't know if that's the reason, after all Microsoft developed TypeScript!  CodePen added support for TypeScript over 3 years ago, so if somebody had the initiative then I'm sure a pull request would be well received. it's the Monaco editor - also from our friends at Microsoft :), which easily supports TypeScript, so I think just adding a preprocessor...

Share this post


Link to post
Share on other sites

Hi guys.  I just wanted to welcome kentpham88 to the forum, on behalf of ALL of us.

I'm learning WITH you, K.  Good comments!  Ok, I think Dad72 was a bit curt (short-worded) ... but we roll-on.

I love hearing about Typescript, and think it is a cool idea/system.  I just dislike the needed tools and complexity (so far), and so, I don't use it.  It will evolve, I'm sure.

No matter the dev environment (the ratchet), I just turn bolts/nuts.  If the ratchet gets in the way of the bolts/nuts-turning, I use a different/simpler ratchet.  :)

Share this post


Link to post
Share on other sites

with all respect for all member who care about Microsoft in here ? 

for answer i guess we can write it like service (web api ) to get JavaScript before we run playground source 

*** a lot idea have for do that in my mind 

*** we can attach c# too 

but for start is that we need know how many member need it now

https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API

Share this post


Link to post
Share on other sites
10 hours ago, Wingnut said:

Ok, I think Dad72 was a bit curt (short-worded)

Sorry for that. I did not know how to say it differently.

In fact with typescript, the code must be compiled later to be executed on the web. the playground is not a compiler. quite simply.

Babylon is for Javascript, it is only compile from typescript.

Share this post


Link to post
Share on other sites

interesting discussion, a much simpler answer - 

typescript requires compilation (or transpilation , if that word even exists). This will require further components or even server-side compiling. We think keeping things simpler would be great for everyone, hence - no typescript.

Microsoft has nothing to do with that. Why would that even come up?...

Share this post


Link to post
Share on other sites

not quite. He said they actually did everything they could to enable US to do it, but we didn't. so it seems like it is us, not microsoft. no? Why are you trying to find conspiracies where they obviously don't exist...

Anyhow - it has nothing to do with microsoft. 

Share this post


Link to post
Share on other sites

Oh... we're on the subject of blame for something, and you are defending something, somehow.  Ahh, I didn't view it from that aspect.  I was viewing from the facts that Monaco is MS, TS is MS, the BrianZinn viewpoint.

In THAT way, MS is very involved.  In your way, no.  I understand now.

Share this post


Link to post
Share on other sites

yeah, my mistake, not well chosen words. the proposal for embedded .ts in html was rejected especially on the github by owners of the typescript repository, who are representatives of microsoft corp. no need to cry.

Share this post


Link to post
Share on other sites
4 hours ago, Wingnut said:

I'll give my opinion on this... in The Wingnut Chronicles.  We have discussed forum-helper tact, there, before, so we might as well use that thread again.

I would give my opinion too. I answered a simple question with a simple answer, no need to make tons and see the bad everywhere.

Share this post


Link to post
Share on other sites

@NasimiAsl lots of confusion here. When Wingnut says 

5 hours ago, Wingnut said:

Yep, I'll delete the issue from TWC  Done.

he is not deleting the issue of Typescript in the Playground. It is another issue (about how to reply in posts) he is deleting from TWC = The Wingnut Chronicles.

The issue of typescript in the playground is still an open issue with the main question as you asked 

16 hours ago, NasimiAsl said:

we need know how many member need it now

 

Share this post


Link to post
Share on other sites

I would also appreciate some typescript in Babylonjs playground, since I often have to convert my typescript into javascript to put into the playground myself which can make diagnosing my problem a bit more difficult(since coding differences between the languages.....)

 

I do not truly understand what this means for you guys, sounds like a lot of work,  il understand if won't happen, or if it is not plausible.

Just saying it would be nice.

Please do not eat me alive.  I would love to help

But I'm not that smart :D , and have limited time :( 

Share this post


Link to post
Share on other sites
18 minutes ago, DylanD said:

since I often have to convert my typescript into javascript to put into the playground myself which can make diagnosing my problem a bit more difficult(since coding differences between the languages

I do see that not having to do this step would make life easier for Typescript users but have a naive question from a non typescript user that would like clarification.

I thought that if you used, for example Visual Studio Code, and wrote Typescript code then it would convert it to Javascript for you. So I think that would mean if your Javascript worked the original Typscript would be correct. Is this not true?

 

Share this post


Link to post
Share on other sites
12 minutes ago, JohnK said:

I do see that not having to do this step would make life easier for Typescript users but have a naive question from a non typescript user that would like clarification.

I thought that if you used, for example Visual Studio Code, and wrote Typescript code then it would convert it to Javascript for you. So I think that would mean if your Javascript worked the original Typscript would be correct. Is this not true?

 

Yes VS code will translate Typescript to java script. Without any real loss (as far as I know.. which is not far...).  But even when I use that auto converted code when I fix the code there is no javascript to typescript and typescript is seemingly radically different with BabylonJS(I'm not a pro maybe don't quote me on this).  So the problem is not with the step of converting, but with the steps of fixing converted code that I can no longer explain easily(assuming I don't fully understand javascript.. which I dont, but for this lets say I know none.) since I didn't create it, the converter did, then fixing it in a language I don't know, which I then have to convert back to typescript on my own since you cant use Visual studio code to convert javascript into typescript (as far as I know I actually don't think I have looked for this, but it wouldn't make sense, because you cant just add information to a system....).  I also understand learning javascript is not that hard and if you know typescript you probably know javascript....

 

Basically my point is that yea I could convert it into javascript ezpz but my problem might not be in javascript, not everyone knows javascript so even if we fixed the problem in javascript converting it back into typescript would be not as easy.

 

Lastly no, if the original javascript worked it is provable that it might not work in typescript, not only that but you would still have to convert javascript into typescript which is a much more strict language.  I could provide at least one example(as in I had to over come this once or twice already, I won't actually provide one since that was a month or so ago).

 

Again I don't mind it being in JS, but it would be nice to have it in typescript.  :D 

thanks have a good weekend guys!

Share this post


Link to post
Share on other sites
25 minutes ago, JohnK said:

I do see that not having to do this step would make life easier for Typescript users but have a naive question from a non typescript user that would like clarification.

 

I aslo didnt understand what you meant here... :D 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.