feat: relax dependency on Momento SDK #22
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While investigating this issue:
#18
I found that given our current example code it's fairly easy for
a user to get into a situation where they end up with two different
versions of our SDK dependency, and they get weird type errors and
can't compile.
The primary reason for this is that you need to construct a CacheClient
from the SDK in order to pass to the constructor for the Redis client
from this library. If you have typical eslint rules enabled, you
will be warned that you can't reference classes from the SDK such as
CacheClient
without having an explicit dependency on the SDK inyour package.json. If, in attempting to resolve that problem, the user
does
npm install @gomomento/sdk
, and the version that gets installedis not the exact same version that the momento-ioredis-client is pinned
to, then they will get build errors.
I think we should do two things to remedy this:
versions but when you have to pass objects across API boundaries it
becomes problematic.
sdk that users of this momento-ioredis library will need to pass to the redis
client constructor; that way they can avoid having to add an explicit
dependency on the momento sdk at all.
This commit does the first of those 2 items. In a subsequent PR we'll address
the second one.