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

Deprecations in PouchDB 4.0 #3834

Closed
nolanlawson opened this issue May 12, 2015 · 8 comments
Closed

Deprecations in PouchDB 4.0 #3834

nolanlawson opened this issue May 12, 2015 · 8 comments

Comments

@nolanlawson
Copy link
Member

I think we're all itching to do a major release to get rid of some cruft, just trying to keep track of all the deprecations here:

  • uptodate, outofdate events
  • PouchDB.destroy()
  • update/create/delete events
  • opts.onChange (long deprecated)
  • opts.complete (ditto)

Update: added opts.onChange and opts.complete

@zeroware
Copy link

What should I used in replacement for the update/create/delete events ?

@daleharvey
Copy link
Member

The same logic used to generate the events from the change event could be done in content, some of the semantics of those events may not be possible to strictly adhere to in couchdb 2.0 though (in particular the distinction between create + update)

@calvinmetcalf
Copy link
Member

@zeroware bear in mind that the events were fairly unreliable as couchdb tends to lump them together so even in couchdb 1.0 it's pretty hard to get a create in some instances.

@nolanlawson
Copy link
Member Author

For some concrete examples, check out this blog post which has some code samples.

In general, they should all be easy to replace, but as @calvinmetcalf pointed out, I would avoid trying to distinguish between update/create (and you usually don't need to, notice that I don't in the blog post). There are just too edge cases that don't fit well, e.g. if two people create two documents with the exact same IDs, and thus you receive two revs that each start with 1-, i.e. two separate "creation" events.

@ermouth
Copy link
Contributor

ermouth commented May 13, 2015

I definitely missed something – what is the replacement for PouchDB.destroy()?

@daleharvey
Copy link
Member

new PouchDB('name').destroy()

@nolanlawson
Copy link
Member Author

Related to #4098

daleharvey added a commit that referenced this issue Aug 3, 2015
Sprinkled a few commas here and there. Looks good otherwise; ship it! 👍
@daleharvey
Copy link
Member

And released :) f381b44

assafshp pushed a commit to Knowledge-OTP/pouchdb that referenced this issue Aug 11, 2015
Sprinkled a few commas here and there. Looks good otherwise; ship it! 👍
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

5 participants