Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

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

Open
martikaljuve opened this issue Feb 1, 2016 · 3 comments
Open

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

martikaljuve opened this issue Feb 1, 2016 · 3 comments

Comments

@martikaljuve
Copy link
Collaborator

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
Copy link
Contributor

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
Copy link
Collaborator Author

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: microsoft/TypeScript#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
Copy link
Contributor

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.

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

No branches or pull requests

2 participants