Skip to content

Rewrite in typescript #333

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

Closed
Bigous opened this issue Jan 19, 2016 · 8 comments
Closed

Rewrite in typescript #333

Bigous opened this issue Jan 19, 2016 · 8 comments

Comments

@Bigous
Copy link
Contributor

Bigous commented Jan 19, 2016

Hi @cjbj , I'm working with angular2 for while now and having the typescript definitions is awesome - code completion, hints, etc... I wrote an oracle.d.ts and made a pull to TSD people DefinitelyTyped/DefinitelyTyped#7697 but I was thinking that it would be great to rewrite the javascript part of the driver in typescript and expose the definitions and so on, so we don't need tsd to have the oracledb definitions... and it would be generated automatically by the typescript transpiler...

We have an issue #169 asking for that too...

I could halp with it, what do you think?
[]s

@cjbj
Copy link
Member

cjbj commented Jan 20, 2016

@Bigous Sounds cool, but is there enough JS to merit another layer of abstraction? If it makes development and debugging and maintenance easier, and attracts contributors then we could do it. (BTW, any comments on #321 (comment) ?)

@dmcghan any comments?

@Bigous
Copy link
Contributor Author

Bigous commented Jan 20, 2016

@cjbj Typescript is Javascript with types... When I submitted the issue I was thinking about having just the 2 javascript files written in typescript, so the driver would get easier to use (because the typing and help would be at the script part which would be bundled with the driver... I was not thinking about having it entirely in Typescript... But I liked the idea.

@dmcghan
Copy link

dmcghan commented Jan 20, 2016

Generally speaking, I like TypeScript. I like what it does and what it has to offer. For medium to large projects I can understand why a development group may chose to use it. However, the driver is mostly developed in C. Excluding the tests and examples there's only about 100 lines of JavaScript code so I'm not really sure what, if anything, TypeScript would have to offer at this point.

Also, one of the main motivators of expanding the JavaScript layer is to allow the JavaScript community more opportunity to contribute to the project. There are a lot of people that know JavaScript but TypeScript has not become mainstream, and like CoffeeScript, it may never become the norm.

My vote would be to stick with plain old JavaScript for now. If TypeScript ever becomes the norm or if the project ever gets to an unruly size, then I'd revisit this issue.

In the mean time I do think we should provide and maintain a .d.ts file for the library.

@cjbj
Copy link
Member

cjbj commented Jan 20, 2016

@Bigous a thin driver (either in pure JS or typescript) is a dream but not a plan. Node-oracledb will be based on Oracle Client for the foreseeable future.

@Bigous
Copy link
Contributor Author

Bigous commented Jan 20, 2016

Agreed with both... about .d.ts, I posted one in tsd repository... if you thing we should move it to be here, I can make a pull request here.
About the adoption of Typescript, it is increasing a lot... specially after angular2 adopting it.
But for now, we should stick to the plan. I'll close the issue, when we get more js code ill open another one...

@Bigous Bigous closed this as completed Jan 20, 2016
@bjouhier
Copy link

There is also a lot of activity around flow. Flow has the advantage of being a lot less intrusive than typescript: it can be added incrementally and it does not impose a new language. It also has some very cool features like distinguishing between nullable and non-nullable types. The React and Babel communities are behind it.

So the matter is not settled and it is probably wise to be in wait-and-see mode at this stage.

@Bigous
Copy link
Contributor Author

Bigous commented Jan 20, 2016

Typescript does not impose a new language and it can be added incrementally too... the comunities behind it are Microsoft and Google... but yeap... lets wait more ;)

@bjouhier
Copy link

@Bigous thanks for the correction. I had looked at typescript very early and it was its own language at the time. I had missed the convergence with ES6. Makes it much more attractive.

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