BlackDice / scent

NOT MAINTAINED anymore, let me know if you are interested.
MIT License
10 stars 3 forks source link

Here's a simple TypeScript definition file for Scent. #27

Open martikaljuve opened 8 years ago

martikaljuve commented 8 years ago

https://github.com/martikaljuve/typed-scent

I've been using VSCode for a few months now, which has pretty nice IntelliSense for ES6 projects by using TypeScript definitions. I thought it would be nice to have auto-complete for Scent as well.

scent-intellisense

You can get it using typings (npm install typings -g) with:

typings install github:martikaljuve/typed-scent --ambient --save

This definition file was done pretty quickly and I have never used TypeScript, so expect a few issues. I don't know if I can get auto-complete to work for the dependency injections inside function-based systems and for dynamically created component properties and nodes, but at least there's completion for the engine and entities. :P

danielkcz commented 8 years ago

I see, that looks really nice. I heard mostly good things about TypeScript, but I am not planning to go in that direction personally. My mind is not ready yet I suppose :) I have abandoned CoffeeScript on other hand so eventually I would like to do some rewrite to ES6, but that's still a long road ahead.

I am not sure if I can help you here with something or you just wanted to show me how nice it is? Would be great to have feedback from some other people if they use it too, but obviously you are only one who cares so it's not even worth mentioned in docs.

Having IntelliSense for components would be definitely amazing. I suppose it would require some tooling that would generate typescript file based on your component definition.

martikaljuve commented 8 years ago

Yeah, no help needed, just wanted to post it here in case potential new users find it useful. I learned a bit more about your framework during this as well, it was nice to read well-organized code.

I'm actually using this only for JavaScript (using ES6). VSCode has pretty good support for using TypeScript definition files in JavaScript projects, and it will get better in a few months: https://github.com/Microsoft/TypeScript/issues/4789

I managed just fine with Sublime Text for a few years, but VSCode made me realize how much I missed IntelliSense from writing C#. :)

danielkcz commented 8 years ago

Ok I tried VSCode out of curiosity, but it's terribly slow compared to Sublime. I hit Ctrl+P and it takes like 2-3 seconds before it finds the file and it's not even possible to peek into these files, you have to confirm and open it. Also I did not found any clear information how to support Babel in there, so my ES6 code is kinda white mostly. Nah, IntelliSense might be better, but that's hardly everything. Perhaps one day when TypeScript gets my attention enough, this might be good IDE, but for now I am sticking to Sublime. Thanks for your contribution either way.