-
Notifications
You must be signed in to change notification settings - Fork 290
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
add WithAnnotated for easily populate annotated values #718
Conversation
Codecov Report
@@ Coverage Diff @@
## master #718 +/- ##
==========================================
+ Coverage 97.66% 97.83% +0.17%
==========================================
Files 19 20 +1
Lines 513 554 +41
==========================================
+ Hits 501 542 +41
Misses 10 10
Partials 2 2
Continue to review full report at Codecov.
|
e38cdce
to
0816a67
Compare
@joesonw Thanks for the PR! Sorry, we are a little busy this week, give us a few days to get back to you with feedback. |
no problem. take your time.
On Thu, Jan 21, 2021 at 3:32 AM Dmitriy Shirchenko ***@***.***> wrote:
@joesonw <https:/joesonw> Thanks for the PR! Sorry, we are a
little busy this week, give us a few days to get back to you with feedback.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#718 (comment)>, or
unsubscribe
<https:/notifications/unsubscribe-auth/AAMPI4JDC4A2XTEQHLNNF7DS24VULANCNFSM4TS2CAHQ>
.
--
Thanks,
Qiaosen Huang.
|
288f695
to
9bf1afb
Compare
c35483e
to
64ff5e3
Compare
Hi, is there anyone who can help to review this PR? |
@zhenzou If you do not mind, you can try https:/joesonw/fxx this library. Since this festure does not need to modify uber/fx core features, It can be done out-of-tree. I have been personally using this approach. |
@joesonw Thanks for your project. It's very helpful. And inspired me that can extend fx in this way, nice work. |
Hi @joesonw! Thanks for the contribution and sorry for taking so long to get to this. Although we've internally wanted and debated a shorthand for consuming annotated values, we hadn't yet come up with an good public API. Let me share some of the things we've discussed and relate them back to the How should we handle annotations when constructors have multiple parameters? In the existing
What is a good but minmal public API? For the current
Given the considerations above, I don't think we want to merge this as is and go with the proposed
isn't very practical or ideal either, so I think we should consider to iterate and come up with an alternative. We could explore extending
The change to the api would look something like:
with either
or
The direction above would make annotations for params have an api more similar to annotations for results, and also has some potential to be extended for a Let me know what you think! |
@robbertvanginkel
I hope these can answer some of your questions. Thank you. |
For 3, conisder the combination of
where I understand how it is syntactic sugar for something that can be achieved today. Pointing out functions can swap argument is a way to address some of considerations of point 1/2, however it doesnt adress the points about non-descriptive naming of two related types and somewhat surprising behavioral difference of applying to one vs all inputs/outputs. For when It isn't that we don't want to merge anything that makes consuming annotated. However we do want to consider the API for when we do. Fx 1.0 has been stable without breaking changes for 3.5+ years, and the API is still pretty consistent as we've put focus on exploring different APIs for new feature requests. Happy to continue that discussion here and explore other possible forms that would fit both our needs. |
hey @joesonw, thanks for the contribution but I'm closing this PR since we've already added this feature as |
This can resolve #715 #691