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

Reconcile with pouchdb-express-router #271

Closed
nolanlawson opened this issue Dec 12, 2015 · 3 comments
Closed

Reconcile with pouchdb-express-router #271

nolanlawson opened this issue Dec 12, 2015 · 3 comments

Comments

@nolanlawson
Copy link
Member

After discussing #268 with @gr2m, we came to the conclusion that this repo has grown too complex/heavyweight for folks to figure out how to meaningfully contribute to it. E.g. he would like to rewrite the auth system since it has a fundamental design flaw (storing credentials in a separate database instead of just checking a hash), but he doesn't know where to start.

I think the best approach is to revive the discussion in #122 and try to find a way to refactor express-pouchdb into two parts: a core pouchdb-express-router that just contains the minimum required for PouchDB syncing, and express-pouchdb, which contains pouchdb-express-router as well as auth, list, show, update, etc.

The last time we had this discussion (#122), @marten-de-vries and I hashed out a solution where "modes" (3920710) were used to progressively remove modules (as opposed to progressively adding modules). However, this 1) goes against the whole "small modules" ethos, and 2) doesn't seem very popular with either @gr2m (who is already working on a separate repo) or @daleharvey (who is continuing to work with pouchdb-express-router).

I think it is silly for us to be writing the same code in three different places. So can we please put our heads together and figure out a way to split this repo up?

@gr2m
Copy link
Contributor

gr2m commented Dec 13, 2015

🙏

@marten-de-vries
Copy link
Member

I'd love to split express-pouchdb up, but I don't know how to do so.

The problem is essentially that there are a lot of instances were functionality is added to endpoints in 'full' mode, and it's impossible to just add it in transparently on top without duplicating the code. A few random examples:

  • modifying behaviour based on a /_config setting (e.g. specifying the max length of a json request)
  • adding validation (read & write)
  • adding db_size to /_info

When instead starting with and building on top of @daleharvey's project, you'd encounter the same problem. So, anybody any ideas on how to solve that?

@nolanlawson
Copy link
Member Author

Closing since this probably won't happen. Instead we'll move both projections into the PouchDB monorepo and maintain them both, at least in the long term.

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