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

Add Typescript Support #13

Open
Gers2017 opened this issue Oct 7, 2021 · 9 comments
Open

Add Typescript Support #13

Gers2017 opened this issue Oct 7, 2021 · 9 comments
Assignees

Comments

@Gers2017
Copy link
Contributor

Gers2017 commented Oct 7, 2021

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.

@Redfire75369
Copy link
Owner

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.

@sagudev
Copy link
Contributor

sagudev commented Oct 7, 2021

And the next logical step would be to provide ts definitions of spiderfire functions.

@Redfire75369
Copy link
Owner

All modules already have TypeScript (and Flow) definitions created, I think it's mostly a matter of integrating those into IDEs and stuff.

@sagudev
Copy link
Contributor

sagudev commented Oct 9, 2021

Yes, I totally forgot it.

@gimbling-away
Copy link

I can make a PR for this with some guidance, if you would like.

@sagudev
Copy link
Contributor

sagudev commented Jan 2, 2022

Maybe swc-project/swc for bundling TS compiler within?

@Redfire75369
Copy link
Owner

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.

@Redfire75369
Copy link
Owner

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 (00c02d4). This will be published as a zip file in each prerelease.

Bindings: https://github.com/Redfire75369/spiderfire/tree/master/bindings

@Redfire75369
Copy link
Owner

Redfire75369 commented Aug 4, 2022

As of 9e05f8c, 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.

@Redfire75369 Redfire75369 self-assigned this Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants