-
Notifications
You must be signed in to change notification settings - Fork 925
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
node: enhance DI allowing overriding of dependencies #290
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let's have a call about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave a comment in the options.go
file that references the issue from uber/fxutil and mention that this code is intended to be deleted upon implementation in upstream.
…rrideSupply option
…de in favour of custom lifecycle funcs
…ke options errorable
f7fc85b
to
1f6dc4a
Compare
… if upstream issue is fixed
About
This is a solution for #285. It is different from the design there, as it's not possible. Finding the other solution took a lot of time, sketching, and learning. The reason why is the limitation of FX described in uber-go/fx#825. This PR solves the problem by extending
fxutil
lib to mimicfx
functionality + newOverrideSupply
option described in uber-go/fx#825. In future, the code offxutil
might be deleted once the describedfx
feature is implemented and merged.This PR might be difficult to understand in detail as it involves reflection + understanding of the DI itself, but also a good opportunity to understand how both worlds work for the implementer and for the reviewers.
Changes
fxutil
mimicingfx
options with more new additionalsOverrideSupply
SupplyAs
ProvideAs
fx.App
from Node