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

Overriding default implementations with plugin not working #8737

Closed
louwers opened this issue Aug 27, 2023 · 4 comments
Closed

Overriding default implementations with plugin not working #8737

louwers opened this issue Aug 27, 2023 · 4 comments

Comments

@louwers
Copy link
Contributor

louwers commented Aug 27, 2023

Issue

It doesn't seem to be possible to override default PouchDB implementations anymore.

Maybe related #8450

This example in the docs doesn't work because of this: https://pouchdb.com/api.html#plugins:~:text=Example%20Plugin%3A%20Intercept%20Updates (also there is a typo, doc is undefined).

Info

  • Environment: (Node.js/browser/hybrid app/etc.) Browser
  • Platform: (Chrome/FF/Safari/Edge/iOS/Android/etc.) Firefox
  • Adapter: (idb/indexeddb/memory/leveldb/etc.) N/A
  • Server: (CouchDB/Cloudant/PouchDB Server/etc.) N/A

Reproduce

  PouchDB.plugin({
    bulkDocs : function () {
      console.log("Hello!");
    }
  });


const localDb = new PouchDB('db')
localDb.bulkDocs() // does not call above method
@garethbowen
Copy link
Member

@louwers Is this a duplicate of this issue?

If you think so, could you try the fix in this PR?

If that works then we can dust of the PR and get it merged...

@louwers
Copy link
Contributor Author

louwers commented Aug 27, 2023

@garethbowen Looks like it. I think it would work.

I don't know how to try it out though.

@louwers louwers closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2023
@garethbowen
Copy link
Member

@louwers Well it depends how you're depending on pouchdb. If you use npm you can just go into your node_modules and manually apply the fix. Or you can depend on the branch instead of a released version.

@louwers
Copy link
Contributor Author

louwers commented Aug 28, 2023

When I depend on the branch I get a pouchdb-monorepo dependency.

I will try your other suggestion. 👍

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

2 participants