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

Converted lib/ to TypeScript #123

Closed
wants to merge 1 commit into from

Conversation

SamuelMarks
Copy link

Only converted lib/ for now, as I don't know if anyone actually wants this!

My project is in TypeScript, as that allows for type annotations and targeting multiple JavaScript versions with the one code base.

Considering using js-git for one of my projects, so begun converting its source.

@creationix
Copy link
Owner

I'm not sure I want to change the official js-git to typescript, but I think you're doing something cool. I can certainly see the benefits you derive from this.

@themightychris
Copy link

I'm not too familiar with typescript in practice, but isn't there a way to create the type definitions alongside the javascript sources so you can get the benefits of typescript when using js-git from typescript without converting js-git to typescript?

@SamuelMarks
Copy link
Author

SamuelMarks commented Dec 20, 2017

Yeah you can do it that way, but then you only get some of the advantages.

Converting everything to TypeScript and you get all the advantages. So you'll find all those bugs related to misuse of variables and functions (that can be statically figured out by the TypeScript compiler). And you'll get proper code-completion as you develop.

And you'll be able to better restrict the input/output of each part of your program using interfaces.

Finally it's nice to be able to use all the latest ES* features that aren't supported by many browsers. Then TypeScript can just compile it down to an older JavaScript version.

But yes, obviously it's up to you. I'm not planning on maintaining a TypeScript fork of your project.

@TheKnarf
Copy link
Collaborator

I'm going to close this PR as we're not changing everything over to TypeScript.

However @SamuelMarks you might be interested in looking at issue #132 as there's been some work to establish a TypeScript fork of this project called es-git. If you're not already involved I'm sure they'd love to have you onboard!

@TheKnarf TheKnarf closed this May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants