zdog icon indicating copy to clipboard operation
zdog copied to clipboard

TypeScript Support

Open FlorianWendelborn opened this issue 6 years ago • 8 comments

EDIT: Please vote for for (👍) or against (👎) TypeScript support via declaration file on this comment. (It’s a "survey" to gauge interest)


I think especially a 3D engine can benefit immensely from typescript support. It reduces the amount of documentation reading that users have to do and prevents a lot of common bugs.

I’d also advocate for converting zdog to typescript internally. I’m sure it’ll be beneficial in this kind of project.

FlorianWendelborn avatar Jun 02 '19 15:06 FlorianWendelborn

Hello! I appreciate this suggestion. I understanding that adopting TypeScript would have several significant benefits to Zdog's source code. That said, TypeScript is not my cup of tea. My flavor is vanilla. I'll have to pass on this one.

desandro avatar Jun 03 '19 00:06 desandro

@desandro is it because you’re not familiar enough with typescript or because you don’t want it to be typescript? In the First case, someone could send a PR.

FlorianWendelborn avatar Jun 03 '19 06:06 FlorianWendelborn

I am not familiar nor do I want to use TypeScript.

desandro avatar Jun 03 '19 20:06 desandro

Thanks for the response! It's totally understandable that TypeScript doesn't fit into your workflow. No need to adopt a stack you're not comfortable with.

Since there are a lot of TypeScript users that could benefit from this, would you be willing to accept a PR that adds a simple declaration file to this package? I have already written one based on the public API (anything documented on zzz.dog) and would be happy to maintain it going forward.

This would be the optimal solution for Zdog/TypeScript users since npm install zdog would include all the necessary files. I would do my best to address any issues opened here with a typescript label.

If this sounds like overhead that you're not comfortable with, no worries—I can publish @types/zdog to DefinitelyTyped.

natemoo-re avatar Jun 04 '19 13:06 natemoo-re

To extend on @natemoo-re, even non-typescript users like yourself would benefit from it as VSCode will use the definition file for auto completion, even in JavaScript projects.

FlorianWendelborn avatar Jun 04 '19 16:06 FlorianWendelborn

Add a 👍 reaction to this issue if you would like to see Zdog get a declaration file. Do not add +1 comments — They will be deleted.


I've re-opened the issue to gauge general interest.

desandro avatar Jun 05 '19 01:06 desandro

personally I created my own declaration file just for my typescript project I am working on and would love to see an official one instead of my hack-together one.

MasterCash avatar Jun 26 '19 17:06 MasterCash

Added.

demensky avatar Jul 15 '19 20:07 demensky