NasimiAsl Posted July 8, 2018 Share Posted July 8, 2018 SvenFrankson, inteja, adam and 4 others 2 5 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 9, 2018 Share Posted July 9, 2018 Good job (as usual :D) Working on some polish and I will merge NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted July 9, 2018 Author Share Posted July 9, 2018 that is good and don't be fast we most check it before we make it because that is foundation and if we finish that a lot people dont work with js for webgl actually i am one of them Quote Link to comment Share on other sites More sharing options...
Guest Posted July 9, 2018 Share Posted July 9, 2018 Ok Folks here we are: https://www.babylonjs-playground.com/ts.html Let me know how you feel about it NasimiAsl, inteja and jerome 3 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 9, 2018 Share Posted July 9, 2018 @JohnK I will need your help to document this new way of dealing with the PG ;D Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 10, 2018 Share Posted July 10, 2018 8 hours ago, Deltakosh said: @JohnK I will need your help to document this new way of dealing with the PG ;D Will do, though I am on holiday for a week or more and so there will be a delay. As a non Typescript user I may have some questions. For example 1. When in JS playground how do you switch to TS playground 2. Would it be possible to have some more examples of TS PGs, such as showing how simple functions would be written and show how new BABYLON methods would be achieved in TS PG. In other words what would these PGs look like with TS http://www.babylonjs-playground.com/#1ENDNT https://www.babylonjs-playground.com/#KT9EE7#1 (this type of example could also be useful to show additions work before a PR.) Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted July 10, 2018 Author Share Posted July 10, 2018 https://www.babylonjs-playground.com/ts.html#QW2BUJ#12 yum yum Quote Link to comment Share on other sites More sharing options...
Guest Posted July 10, 2018 Share Posted July 10, 2018 1. You just go to the ts.html page to get the TypeScript playground: https://www.babylonjs-playground.com/ts.html#QW2BUJ#12 2. http://www.babylonjs-playground.com/#1ENDNT => https://www.babylonjs-playground.com/ts.html#NS23BT https://www.babylonjs-playground.com/#KT9EE7#1 =>https://www.babylonjs-playground.com/ts.html#H3AF26#1 (This one is a perfect example of why TS is great :)) Thanks a lot @JohnK! And no rush at all JohnK 1 Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted July 10, 2018 Share Posted July 10, 2018 That's really great, thanks a lot ! NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 11, 2018 Share Posted July 11, 2018 17 hours ago, Deltakosh said: You just go to the ts.html page to get the TypeScript playground Understand that but was looking for a lazy way. Something like at the top of examples always have Basic Scene TS and Basic Scene JS underneath that the examples ( when available) grouped by JS and TS. That way there would always be quick access to TS or JS PGs. Also would encourage lazy people like me to check out how to use TS. Do not know how much a problem this would be or where the list of TS playgrounds would come from. NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 11, 2018 Share Posted July 11, 2018 This is a pretty good idea and we can easily do that We can just create a new TypeSCript group here in the examples list: https://github.com/BabylonJS/Documentation/blob/master/examples/list.json JohnK and NasimiAsl 2 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted July 12, 2018 Author Share Posted July 12, 2018 i am thinking about support import too (from path + url) Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted July 13, 2018 Share Posted July 13, 2018 I dont know how to feel about this... Why? This is kinda reminds me of my fear I posted over a year ago, about confusing users as to the basis of the system especially newbies... They are going to get conflicting information and references now and slowly Babylon.js becomes Babylon.ts! Dad72 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 13, 2018 Share Posted July 13, 2018 I can personally assure you this will never happen. But as we have a lot of TS users, it is a fancy tool for them so why not helping them as well NasimiAsl, DylanD, brianzinn and 1 other 4 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 13, 2018 Share Posted July 13, 2018 I think pryme raises a question that I understand The engine is develop with TS and users use JS. If we find examples ts and js, beginners can be confused or even say that it is too complicated to see this language TS. Leave TS to the engine developer, and leave JS to the engine users. Otherwise it means that the future examples we will have on the forum when we ask for help will be in TS because those who are more experienced will want to use TS and it will be a real hassle. Others will continue to use JS, but we will find help written in TS and written in JS. After that, you will also have to open a forum for TS users. I do not even understand the interest of having a PG for TS since Babylon is for JS for the end users, so examples in JS is sufficient. I'm afraid that in the end we find with full TS example for users and it will be a disaster for sure with requests to convert TS => JS. Pryme8 1 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted July 14, 2018 Share Posted July 14, 2018 I have been coding nearly 3 years almost entirely in TypeScript, so am biased. Once a project reaches a certain size, I feel that JS slows me down a lot. I do agree that there is perhaps not a lot gained in TS playgrounds as they are essentially snippets and I feel that TS doesn't really shine until a project is medium sized. At the same time I feel this is a REALLY great addition, so thank-you @NasimiAsl - I would really like at some point to post my BabylonJS TypeScript code that does not compile without some trickery (ie: try converting http://www.babylonjs-playground.com/#1K0NSN#1) - and now we finally have a way to share!! This was not possible before in a PG, so there is something tangible gained by TS playgrounds. Why not let people choose making playgrounds where they are comfortable and happy --- providing the opportunity for both seems like the right thing. I have a feeling anybody hanging out in the forum will learn TypeScript by osmosis, so that's a good thing too!! Also, the TypeScript playground is missing examples, so maybe that's a good teaching tool as well to see the same examples side-by-side. 6 hours ago, Dad72 said: it will be a disaster for sure with requests to convert TS => JS I hope not a disaster! You will find that it's really trivial to convert from TS to JS - just remove some syntactic sugar from variable/function/argument declarations. TS is just a superset of JS with optional typings adam, sable, DylanD and 1 other 4 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted July 14, 2018 Author Share Posted July 14, 2018 ts vs js why we need think about it we support Both better than support just js or just ts Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 14, 2018 Share Posted July 14, 2018 10 hours ago, Dad72 said: requests to convert TS => JS Answer with - Remember browsers cannot interpret TS directly and the software running the playground compiles the TS code into JS before rendering. So the easiest way to convert the TS code to JS is to use the from the Playground menu. This will give you a complete HTML file with the TS code compiled to JS. Should you wish to learn to code in TS then you will also need to learn the methods used to compile TS to JS for you code to run in a browser. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 14, 2018 Share Posted July 14, 2018 I do not like TS programming, I prefer JS directly by using ES6 with "class". I find the JS ES6 programming clearer and more interesting, even for big projects. TS for the big projects is a perfect illusion. I do not even want to learn TS, if I have to learn a compiler language I'm going to C#, Java, C ++. I choose programming on the internet to avoid compiling language, so TS does not interest me at all. After, I understand that some people feel more comfortable with this language compiled. But remember that this is not the case for everyone. When I search for a game engine, I search for a engine written in JS, not TS. Babylon is for JS. Oh and Babylon exists also in C# (whith XNA) for those interested, you have a real language compiled. I have always seen TS as a necessary language compile useless. Javascript ES6 is better now for big project. It remains that my point of view, I know that some people will not agree and say that TS is great, but do not denigrate the javascript for as much. Babylon was originally written in Javascript for the sake of Javascript. I'm not against TS but do not incite the peoples to learn TS because you find it better. There is no language "better "and the JS ES6 is interesting enough for development on the internet. NasimiAsl and Pryme8 2 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted July 14, 2018 Share Posted July 14, 2018 5 hours ago, Dad72 said: There is no language "better " I agree with you 100%. I certainly never intended to say that TS was "better" or to incite people to learn TS. I try to learn as many languages as I can, so I like to share my excitement around different languages - computer and human languages. Sounds like you are a big fan of ES6. What you would have said to somebody 2 years ago programming in ES5 for browser compatibility reasons? I probably would have gently encouraged them to use ES6 and compile the javascript with babeljs, because the classes and arrow functions make programming more fun. If somebody is happy in ES5 then I respect that choice, too. Programming in CoffeeScript 6 years ago I was using most of the useful ES6 features, so that was what I used to try to share with people. I think we are all looking for ways to make programming more fun and have cleaner code and I think that sometimes a compiler can help there Nothing more than that... When somebody asks me which wine is the best - I just say it's the one you like the most! Same with languages. DylanD 1 Quote Link to comment Share on other sites More sharing options...
adam Posted July 14, 2018 Share Posted July 14, 2018 5 hours ago, Dad72 said: but do not denigrate the javascript for as much. who was denigrating javascript? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 14, 2018 Share Posted July 14, 2018 7 hours ago, adam said: who was denigrating javascript? It was just to say that we should not do it. I understand your point of view Brianzinn. As they say, the tastes and the colors ... Quote Link to comment Share on other sites More sharing options...
Guest Posted July 15, 2018 Share Posted July 15, 2018 That's why I think it is good to have both in order to try to make everyone happy JS or TS: Pick the one you like. Babylon.js community is for everyone NasimiAsl and DylanD 2 Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 19, 2018 Share Posted July 19, 2018 On 7/14/2018 at 12:14 PM, brianzinn said: I agree with you 100%. I certainly never intended to say that TS was "better" or to incite people to learn TS. I try to learn as many languages as I can, so I like to share my excitement around different languages - computer and human languages. Sounds like you are a big fan of ES6. What you would have said to somebody 2 years ago programming in ES5 for browser compatibility reasons? I probably would have gently encouraged them to use ES6 and compile the javascript with babeljs, because the classes and arrow functions make programming more fun. If somebody is happy in ES5 then I respect that choice, too. Programming in CoffeeScript 6 years ago I was using most of the useful ES6 features, so that was what I used to try to share with people. I think we are all looking for ways to make programming more fun and have cleaner code and I think that sometimes a compiler can help there Nothing more than that... When somebody asks me which wine is the best - I just say it's the one you like the most! Same with languages. no. the list goes: 1:free 2:cold 3: wine of choice Haha just kidding thats just a saying around here. brianzinn 1 Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 19, 2018 Share Posted July 19, 2018 On 7/13/2018 at 1:28 PM, Pryme8 said: I dont know how to feel about this... Why? This is kinda reminds me of my fear I posted over a year ago, about confusing users as to the basis of the system especially newbies... They are going to get conflicting information and references now and slowly Babylon.js becomes Babylon.ts! Out with the old in with the new (evil laugh*)!!! Yea well typescripts the way to go anyway I hear. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.