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

Open a PR on DefinitelyTyped? #41

Closed
nolanlawson opened this issue Jun 22, 2016 · 4 comments
Closed

Open a PR on DefinitelyTyped? #41

nolanlawson opened this issue Jun 22, 2016 · 4 comments

Comments

@nolanlawson
Copy link

Apparently the DefinitelyTyped definitions are really out of date. At least, that's what I keep hearing from PouchDB+Angular users. (I've never used TypeScript.)

Could you open a PR on DT to merge your stuff into theirs? Otherwise it seems like PouchDB users are perpetually confused. Unless you think there's a better solution (really I have no idea, just offering suggestions here 🙂). Thanks!

@AGBrown
Copy link
Owner

AGBrown commented Jun 22, 2016

@nolanlawson, no - I have no better idea.

When I first looked at this the DT definitions were already really out of date. I put out a request for contributions (see DefinitelyTyped/DefinitelyTyped#4328), but there was little interest at that time. My first solo dev effort probably did the 80 of the 80/20 rule to get to v3.4.0, but by the point that was done you were already moving on with versions, then you were v4 and now v5!

I think the consensus is that we ignore anything pre v5 (now v5.4.4) and just get it working. I'm not sure what needs to be done to achieve that.

The other issue is that I'm on totally different projects now. I rarely if ever touch pouchdb and typescript, and since I have both of these things have changed so I'm not an up to date authority on either. I'm happy to coordinate efforts to bring pouchdb.d.ts up to date and submit a PR to DT, but someone else needs to do the lion's share of the work. I don't think we're at the stage where we submit yet and it be useful to anyone. The good news is that I think pouchdb.d.ts is still a better starting point that starting from scratch.

Would you be happy for me to close this as a duplicate of #14 ?

@nolanlawson
Copy link
Author

Yep, looks like a dup to me. Happy to close!

As for your work on the issue, I’m sorry that it’s been hard to keep up with us. I would love to make things easier for the TypeScript community but unfortunately it’s just a lot of work to match our pace, even if our API is relatively stable.

@fredgalvao
Copy link
Contributor

I'd never ask you to apologize for having such a fast-paced project like PouchDB. Please, by all means, keep doing the awesome job you're doing as fast as you can!

However, I do think what we have here is not far from what we need to be a final version for 5.x.y as a base for future typings. The code is complex right now only because of the two-face life PouchDB had up until v4. If we could ever ditch the callback side and stick with promise based api, it would be quite easy to simplify everything and make it easy to update.

Other than that, the only other high point I remember seeing on the way to polishing this was finding a way to define the map/reduce/query functions for couch, which have a special scope with special things available to it, for example the emit() function. As far as I remember, TS doesn't offer a solution to beautifully implement that without having the user do something manually.

@AGBrown
Copy link
Owner

AGBrown commented Jun 23, 2016

@nolanlawson - your pace would not be an issue if I had time to spend on this. The issue is more (as @fredgalvao touched on) the impedance mismatch between a highly flexible javascript based project, and trying to specify a useful, highly typed, api for it. So really its a javascript vs typescript issue.

We had fun with supporting both the promise and callback apis, but I think we did an ok job with that. It does make the api a little more complex, but that's just the way of it.

I'll try and move things on, we'll see where we get to.

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

No branches or pull requests

3 participants