Open mgroth0 opened 1 year ago
Thanks for your suggestion. Maintaining two modules outweighs the benefits in terms of complexity and maintenance. We support many optional dependencies, such as HdrHistogram, native transports and many more. What would make sense is having a Wiki page outlining what dependencies are required to simplify the getting started experience. Paging @sokomishalov for visibility.
I want to start by saying this is an incredibly useful library. It is helping me learn how to use Redis and implement it in an asynchronous way, and I'm very grateful for it.
Feature Request
I have checked the wiki and searched the issues here, and I did not find any discussion on why there are optional dependencies in the pom.xml. My understanding is that optional dependencies reduce stability because they allow the possibility of a
java.lang.NoClassDefFoundError
to be thrown if the user did not manually include the depednencies they require.Is your feature request related to a problem? Please describe
This comes up for me in the following way:
I can solve this by manually adding a dependency on
org.jetbrains.kotlinx:kotlinx-coroutines-reactive:1.7.0-Beta
.Describe the solution you'd like
According to the Maven Docs, optional dependencies are not ideal and not the cleanest solution. Ideally, the project would be split into multiple modules. If we want to keep Lettuce-Core minimal, we don't need to make it depend on
kotlinx-coroutines-reactive
. But then all features that rely on that dependency should be in a separate module. I want to know that if my code compiles, that all classes can be found at runtime. I generally assume that all of the libraries I use follow this contract, and it is abnormal that lettuce does not.Describe alternatives you've considered
Lettuce-core could have a normal dependency on
org.jetbrains.kotlinx:kotlinx-coroutines-reactive
. However, I can understand the drawbacks of this since it could increase the size of lettuce-core with bloated sub-dependencies that many users may not need.Teachability, Documentation, Adoption, Migration Strategy
Looking at maven, it seems there is currently only one lettuce module. It would be nice to see
lettuce-core
alongsidelettuce-coroutines
(which could itself depend on the core module).