-
Notifications
You must be signed in to change notification settings - Fork 33
add optional wrtc support #5
base: master
Are you sure you want to change the base?
Conversation
@fippo any thoughts on this? |
Looking good (the bundle needs to be updated though), but wouldn't that pull wrtc as a dependency even in the browser? |
I don't know what "the bundle" is (newbie here). npm does install optional dependencies by default, but imo that's npm's fault. Let me know if you find a better pattern for optional dependencies. |
Ah I now realize that you meant |
The npm optionalDependencies I believe are most like the debian Suggests, while we want something more similar to Recommends. https://www.debian.org/doc/debian-policy/ch-relationships.html The best option for now is probably to take wrtc out of optionalDependencies and document the relationship elsewhere. |
After some lengthy discussion on #npm isaacs suggested moving this from optionalDependencies to the README, and if necessary, make another package that depends on both. Agree? |
ah... I think @legastero shows us how to do it in https://github.com/henrikjoreteg/getusermedia -- basically the browser and index entries in package json. That means there would be two different versions, one for node and the other for the browser, but as long as they're in the same package maintenance is easy. |
As much as possible I always vote for the simplest solution. Isaac is probably right in this case. A simple other package that just extended this might be cleaner. |
Another option might be to allow the consumer of this library to pass in the wrtc module to webrtcsupport if they have/want it available. The advantage is that there would only be one library for webrtcsupport but the dependency wouldn't have to be baked into the package. |
@fippo I like that change but I don't see how that would help a Node process that wants to use wrtc. To me it looks like if I do |
@fippo Actually I see now. Reading the linked issue I realize that the user can optionally call |
Hey there! I had to this externally in IPFS and although it does work, I would rather just count on this module to tell me the truth. I actually added an extra clause in IPFS to check if the platform is Linux or Windows, so that the user explicitly says they want to use it, as it is typically cumbersome to install it in those runtimes. See: https://github.com/ipfs/js-ipfs/blob/master/src/core/components/init.js#L66-L78 Any hopes of getting this featured added in? |
I wouldn't say wrtc is "easily added to dependencies", but it's entirely possible to build for those that really want it.
I've added it as an optional dependency, and updated the index-node.js to reflect the supported features.