-
Notifications
You must be signed in to change notification settings - Fork 26
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
Reduce library dependencies #949
Comments
I'm awaiting confirmation from the customer as to their build and distribution process for their SDK. |
Some more information from the customer in respect of how they are distributing their SDK to their customers:
In terms of linking choices (e.g. static vs dynamic) the customer has put it very succinctly for us:
Furthermore, when they build an app against their SDK (via CocoaPods), they are getting the following on launching the app:
With their succinct analysis being:
|
About removing dependencies:
|
Thanks, @ricardopereira ... We may have to take a slightly more pragmatic approach in the short term in respect of SocketRocket - perhaps bringing it in as a Git submodule. Same perhaps even for KSCrash. To make this play with downstream linkers (app developers) there should be an opportunity hide 'transitively built' symbols in our build output or something like that but that'll need R&D and plenty of testing (i.e. |
It sounds like, if our immediate goal is to reduce the number of dependencies that are forced upon users of our library, then we could continue to use SocketRocket by compiling it directly into the SDK. Is this perhaps what you mean when you talk about "bringing it in as a Git submodule", @QuintinWillison? I think that for me the path of least friction looks like:
The net result of this will be that:
We'd need to make sure that all of the existing code in SocketRocket is properly namespaced, but at a glance it looks like it is. We'd also need to make sure that we satisfy the conditions of SocketRocket’s My vague memory of the But I guess the other question is whether we do have a broader interest in replacing SocketRocket? #805 suggests that we do, but it seems like it's served us well until now. Might it be something that we can live with until we're eventually able to just rely on iOS 13+'s built-in support? As far as I can tell, the alternatives to SocketRocket right now would be either a different Objective-C library (which, as you've said there, all seem to be unsupported now), or to pick a lightweight C library and integrate that ourselves. At a brief look of the C WS client lib scene there seem to be a few options, but I'm not sure about Darwin support. Ideally we'd want a library that allows us to plug in to some native API for initiating a TLS connection, instead of having to bundle something like OpenSSL. |
Thanks @lawrence-forooghian ... for the moment I've taken this discussion internal. |
We remove it as a dependency in Carthage and CocoaPods, and deal with the fallout. There is some further work needed to fix the CocoaPod, which I’ll do in a separate commit. For future reference, we are doing this as part of a wider effort to reduce the number of transitive dependencies that we impose on users of the SDK. See issue #949 for more details. I manually removed the framework copy steps. I don’t _think_ there is a more official Carthage-provided way of doing this, but I could be quite wrong; I don’t know much about Carthage.
Since nobody among our clients is going to use |
Didn't this require users to install these dependencies via |
I was inspired by |
And nothing prevents us to use the same trick for |
The customer complaint started off with 5 dependencies, but with msgpack and AblyDeltaCodec, this shouldn't be a problem, should it? I think we should not use submodules and keep those 2 dependencies, they are core functionality for Ably: msgpack for message structure, and AblyDeltaCodec for delta compression. A bit more detail: After using submodules, the dependency is still there. Using submodules, we are using less common ways of integrating dependencies (submodules are known to be a pain, and their integration with other tools will need to be tested, such as Cocoapods, Carthage and SPM). Now we will have recursive submodules 😅 . What is the point of hiding a dependency? I think this is different to reducing the number of dependencies. Some dependencies are still good :). Hiding dependencies makes it more complicated to evaluate the number of dependencies, and doesn't bring actual benefits to the size. If AblyDeltaCodec and Msgpack are used, they should be kept as dependencies. |
BTW, @ben-xD @lukasz-szyszkowski we can use |
I agree with @ben-xD . Let's keep these two dependencies as they are. |
@QuintinWillison could you please give us your refreshed opinion on this? |
Which version of the Ably SDK are you using?
1.1.14
On which platform does the issue happen?
iOS13
Are you using Cocoapods?
1.8.4
Which version of Xcode are you using?
11.3
Problem
We have a customer who is integrating our SDK within their own SDK which is then offered out to their customers. The problem they have is that the five dependencies of our CocoaPod are proving to be a big concern to their customers. They would like to make their own SDK as lightweight as possible. Our transitive dependencies don't help!
┆Issue is synchronized with this Jira Story by Unito
The text was updated successfully, but these errors were encountered: