-
Notifications
You must be signed in to change notification settings - Fork 114
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
ALL-2835 - Extension Ecosystem enabler #933
Conversation
# Conflicts: # src/service/tatum/tatum.ts
Task linked: ALL-2835 SDK Extension Ecosystem architecture |
Good job @Smrecz. |
# Conflicts: # CHANGELOG.md # package.json
What do you think about sending the config options when call the extension() method and not when creating tatum core class? For instance like this: |
@Hathoriel we've been discussing it with Alex and we would like to preserve this fluent interface for users to use like it is for other modules, eg. each time they want to get the fee they can just |
@Smrecz It is possible to add some simple test to check if extension enabler functionality is working? |
And why it is not possible or problematic do just following?
|
It's not problematic at all, users have this option in both cases now. I don't see any benefit of moving config from SDK init to method call, won't make dealing with config types any more strict and will still require calling somewhere async init of the extension. We've been considering this approach but we've settled on nest.js like experience :) |
@Smrecz Ok makes sense. Thank you for the clarification! |
Part of the Extension Ecosystem that doesn't introduce any breaking changes
Usage will look as follows:
With this approach we don't enforce any dependencies on the extensions, we are encapsulating
typedi
functionalities in ourTatumSdkContainer
.Extensions have to be explicitly registered via configuration and users can pass their own config depending on the extension.
Async init() is being called for each extension.
This is the basic extension code - just extend TatumSdkExtension.
All other registered sub-services or extensions can be grabbed from TatumSdkContainer.