-
Notifications
You must be signed in to change notification settings - Fork 529
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
feat: redirect #603
feat: redirect #603
Conversation
b782ebe
to
1036b2c
Compare
Codecov Report
@@ Coverage Diff @@
## main #603 +/- ##
==========================================
- Coverage 99.10% 98.10% -1.00%
==========================================
Files 17 18 +1
Lines 1446 1529 +83
==========================================
+ Hits 1433 1500 +67
- Misses 13 29 +16
Continue to review full report at Codecov.
|
We are not in agreement. Using an Agent will make adding redirect being transparent for |
Hm. I agree it would be nicer to implement this just as another client and/or agent. I just don’t see how to implement this in a way that makes sense in that way. I have some more ideas here regarding developer experience so I’ll continue working on this and see if we can reach an agreement. |
Agent would have to return a redirect client which would have to have a reference to the agent. Then the client needs to correctly implement all the client APIs. Many of which would not make much sense. Especially with cross origin in mind. Would have to give that more thought but it start to feel like code smell if it’s that complicated to add something this simple. |
@mcollina PTAL. Has a change to the Agent API to enable better composition. |
@ronag I like the API. Nice work. |
Yes, I was hoping we could collaborate on the tests. I'll port them over from your PR once we know whether @mcollina agrees on the approach. |
Wonderful! ^^ |
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.
The approach looks good to me, I've left a comment.
99df977
to
25a1ab3
Compare
I think this is as much as I can do at the moment. @ShogunPanda do you think you could help out with test coverage and docs? @Ethan-Arrowood maybe you could also help with docs? Basically what we now have architecture wise is:
So basically we have two traits |
9406311
to
8620702
Compare
Should we merge @mcollina @dnlup @ShogunPanda wdyt? |
I agree. Also, I have to agree since it was similar to my original proposal in #553 (comment). Just joking. Lol. |
Good for me! |
Done! |
This is starting to feel pretty solid. Just waiting for docs + test coverage. @Ethan-Arrowood @ShogunPanda. |
Also, final note. Once this get merged, I'll start working on #615. |
* fix: Allow to connect to IPv6 addresses. * fix: Removed alleged dead code. * test: Brought back test coverage to 100%. * fix: Readded needed hooks. * test: Removed unneeded ignores.
* feat: redirect * fixup: docs * fixup: docs * fixup: docs * fixup * fixup * fixup * fixup * fixup-n * fixup * fixup * fixup * fixp * fixup * Update lib/core/client.js Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com> * Update lib/client-pool.js Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com> * fixup: redirectpool fetch global agent on every dispatch call * fixup: reduce Agent api * fixup * fixup * Update lib/agent-redirect.js * test: Added tests for RedirectAgent. (nodejs#614) * fixup * fixup * fixup * fixuP * fixup * fixup * fixuP * fixuP * fixuP * fixuP * fixuP * fixuP * fixuP * fixup * Bring test coverage above 95% (nodejs#621) * fix: Allow to connect to IPv6 addresses. * fix: Removed alleged dead code. * test: Brought back test coverage to 100%. * fix: Readded needed hooks. * test: Removed unneeded ignores. Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com> Co-authored-by: Shogun <ShogunPanda@users.noreply.github.com>
Continuing on from: #600
Trying to figure out the API. Doing this through
Agent
orPool
doesn't quite make sense IMO.