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

Separate server functionality and its heavy dependencies (express-pouchdb) #884

Closed
bkniffler opened this issue Jan 16, 2019 · 5 comments · May be fixed by hixio-mh/rxdb#85, hixio-mh/rxdb#93 or TeslowMusic/rxdb#127

Comments

@bkniffler
Copy link

Hey there,
I guess most people will use rxdb without using the server functionallity (could be wrong though). But express-pouchdb is quite heavy and leaving it in dependencies will, for example, cause electron-builder to compile fsevents on each build, since it is used by express-pouchdb or one of its dependencies.

Wouldn't it make sense to allow to opt-out of express-pouchdb/express for rxdb by moving it to to a separate package? Unfortunately I don't see any other way to make installing express-pouchdb optional.

@pubkey
Copy link
Owner

pubkey commented Jan 16, 2019

Good arguments. Do you think it would be an option to add pouch-server as peer dependency?
We currently do not use lerna so publishing multiple packages would create more complexity.

@bkniffler
Copy link
Author

bkniffler commented Jan 16, 2019

I thought about having a peerDependency, but I wasn't too sure about the effects that'd have on npm/yarn/pnpm. After a quick research, yarn/npm(3+) will just warn you about the absence while npm 1+2 will actually install the dependency. In my opinion, this is acceptable. It will break existing installs though since people with yarn/npm(3+) will need to include it in their dependencies.

We should just be aware that we're actually abusing the peerDependencies, and there might be some side effects we do not currently know of. Btw I've seen some discussion about optionalPeerDependencies, but they are unlikely to ever happen.

I say, lets go for peerDependencies.

@pubkey
Copy link
Owner

pubkey commented Jan 16, 2019

Let's me think about this some time.
Atm I would prefer abusing peerDependency over having a multi-module. Splitting the server-plugin into it's own module would also create a breaking change.

Other opinions would be welcomed.

pubkey added a commit that referenced this issue Feb 1, 2019
@pubkey
Copy link
Owner

pubkey commented Feb 1, 2019

Hi @bkniffler
I added this todo to the list for the next major release, because it will we a breaking change.
I think next major publish will be done with the next pouchdb-version. I hope you can wait for this.

@pubkey pubkey closed this as completed Feb 1, 2019
@hubgit
Copy link
Contributor

hubgit commented Jun 27, 2019

I found another reason to do this: at the end of the dependency chain rxdb -> express-pouchdb -> pouchdb-replicator -> random-uuid-v4 is an outdated version of random-uuid-v4 which has jest as a dependency, which was conflicting with the version of jest/jest-environment-jsdom installed as a real dependency of my project. This took a while to debug, and adds to the feeling that rxdb is installing dependencies that shouldn't really be there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants