Skip to content
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 typings request #899

Closed
ImmanuelSamuel opened this issue Apr 3, 2017 · 9 comments · Fixed by #1653
Closed

TypeScript typings request #899

ImmanuelSamuel opened this issue Apr 3, 2017 · 9 comments · Fixed by #1653

Comments

@ImmanuelSamuel
Copy link

ImmanuelSamuel commented Apr 3, 2017

As the title implies. Could you please provide us a typings file?
Thank you

@Maksims
Copy link
Contributor

Maksims commented Apr 3, 2017

Hi @ImmanuelSamuel.
We've been evaluating potential use of TypeScript. From the statistics around popularity of languages, TypeScript still is very niche language, having very small group (below 2-3%) of JavaScript developers using TypeScript.

Another reason why we don't make support of any other languages is that there are many: http://stateofjs.com/2016/flavors/

So how do we pick which one to support, or try to support all?
This most importantly will segregate our user base into groups that wont be able to exchange knowledge easily as they "speak" different languages.

And documentation + reference would need to be available in all those flavors which makes maintenance much harder for very little benefit (user base for those languages is just extremely tiny).

You can check some work from @Nigh7Sh4de that might help to add TS support: https://gist.github.com/Nigh7Sh4de/bb85ca244d21ed5e5441

We have no plans in near future to add support for any other flavors of JS.

@Maksims Maksims closed this as completed Apr 3, 2017
@Maksims Maksims changed the title typescript typings request TypeScript typings request Apr 3, 2017
@ImmanuelSamuel
Copy link
Author

@Maksims thanks for the detailed response. I totally understand. Hope this engine gets even more popular!!!

@MichaelFedora
Copy link

For anyone still looking for typings, I've got a slightly more complete version over here that I'm using in my projects. Should be able to update it as I make more progress, just kinda filling things out as I need them right now.

@netgusto
Copy link

@MichaelFedora hey Michael thanks !
Incredible luck to find this whereas you just posted it yesterday.

We are considering PlayCanvas for a big project of ours. Would you recommend it against other libs (like BabylonJS?) ?

@MichaelFedora
Copy link

Hi @netgusto ! I don't know as I've never used Babylon JS. You should try asking on the PlayCanvas / BablyonJS forums or something similar.

@gprzybylowicz
Copy link

Hey all. Didnt want to open new issue to ask same question so writing here. Since the @Maksims response typescript is getting more and more popular so i'm wondering if you still don't have any plans to release official typings for PC, or maybe sth changed in this matter? :) Thanks in advance.

@kungfooman
Copy link
Collaborator

What I actually want: not just typings, but complete PlayCanvas engine in TypeScript.

That would result in a christmas tree of possibilities. E.g. use AssemblyScript[1] to generate WebAssembly or source-to-source transpiling to C++ for compilation via Emscripten[2]. The performance and load time would increase and the file size would decrease (small .wasm file, which streams into executable memory while it downloads... no JavaScript parse time).

It would also be a great help for the actual developers, because an IDE like Visual Studio Code has powerful auto-complete and shows every little type/syntax error. That kills a lot of potential problems a JavaScript developer can run into. And since TypeScript compiles to clean JavaScript, the "end user" still just could hack around in the ts_to_js_bundle.js.

Since converting a large code base like PlayCanvas to TypeScript takes a lot of time, I simply started myself, named PlayCanvasTS[3]. Currently only /src/math/ and a bit of /src/core is converted into a bundle (and it "works"). When I convert new code to TypeScript, I simply delete the JavaScript code out of the official playcanvas.js, so I can convert all code one-by-one. This is far from complete, but might be a starting point for some people.

[1] https://github.com/AssemblyScript/assemblyscript
[2] https://github.com/kripken/emscripten
[3] https://github.com/KILLTUBE/PlayCanvasTS

@willeastcott willeastcott reopened this Aug 19, 2019
@willeastcott
Copy link
Contributor

Reopening this because Typescript is growing in popularity, and @aidinabedi has requested this feature too.

@willeastcott
Copy link
Contributor

willeastcott commented Aug 19, 2019

OK, done.

Get latest and run:

npm run tsd

This will generate playcanvas.d.ts in the build\output folder. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants