spiderfire
spiderfire copied to clipboard
Add Typescript Support
I know, I know this is a deno thing but I really think it would improve the project by attracting all the typescript folks. Personally is something node.js needs and I'd use it without doubt. I'm not suggesting get rid of javascript, not at all, what I'm suggesting is let the users use typescript or javascript without too much configuration or boilerplate. I'm still learning rust but I'd like to work/collaborate on this feature.
For this, we should probably use swc to transpile the TypeScript to JavaScript. In order to prevent unnecessary transpilation, the SHA of the TS file and the transpiled JS need to cached somewhere.
And the next logical step would be to provide ts definitions of spiderfire functions.
All modules already have TypeScript (and Flow) definitions created, I think it's mostly a matter of integrating those into IDEs and stuff.
Yes, I totally forgot it.
I can make a PR for this with some guidance, if you would like.
Maybe swc-project/swc for bundling TS compiler within?
That's the plan for the future, it's just that I don't want to deal with caching, which is going to be almost certainly required.
I completely forgot about mentioning this here, but until full support is added, I've moved all TypeScript (and Flow) bindings to a seperate folder (https://github.com/Redfire75369/spiderfire/commit/00c02d41f122f06a2b364ccbaddb8aa0973f9191). This will be published as a zip file in each prerelease.
Bindings: https://github.com/Redfire75369/spiderfire/tree/master/bindings
As of https://github.com/Redfire75369/spiderfire/commit/9e05f8c12da3c1b0d1805cfaa83119ecf2b12b2e, typescript support has been added! You'll still need the global declaration files for your IDE but this is a good step forward. There's also no support for something like tsconfig.json
or .swcrc
for now, that will be added later,
The latest prerelease with support for TypeScript was also released.