-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
http: align with stream.Writable #36816
Conversation
@nodejs/http |
I've removed the following tests:
They fail and I'm confused as to what they are supposed to test and how they could work. |
From 93f47b1#diff-82c531677b9ab4e260025e0397fb0ac4d4316459fa5d16346324e39584cfce96R170 , it looks like they're trying to check that |
d1a8699
to
60d2417
Compare
b7bdc6a
to
c18b3b4
Compare
ba8188e
to
09f6982
Compare
Would you like to have a go at trying to make those test pass? |
@nodejs/http any chance to get some review on this PR? |
It looks like this needs TSC approvals to land and the TSC ping didn't help - pinging @nodejs/tsc |
My biggest concern here is that this is a pretty "soft" alignment. It's done through explicitly modifying the logic and flows to mirror At the very least, I think some new tests should be introduced that document expected behavior and assumptions that can be made about |
I'm not sure I follow this line of thought? IMHO These changes should make it easier to maintain this and all stream related helpers and interop? |
The closer you get while still having custom logic & duplicate code, the harder it is to not accidentally diverge in some minute way. At least without having equivalent test suites for both. FWIW don't take this as me saying this is a bad change. I think it's great we're moving in this direction, although I would prefer to better align test coverage with |
FWIW my intention here is to eventually implement it fully in terms of Writable (or some form of WritableBase). |
Sorry for not looking at this sooner. The changes themselves look fine to me but I'd like @mcollina to weigh in before signing off. |
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.
LGTM with caution. We might end up to revert this if it will lead to massive ecosystem breakage.
Should we label this as a notable change? |
Yes indeed |
Futher aligns OutgoingMessage with stream.Writable. In particular re-uses the construct/destroy logic from streams. Due to a lot of subtle assumptions this PR unfortunately touches a lot of different parts.
Landed in e2f5bb7 |
Futher aligns OutgoingMessage with stream.Writable. In particular re-uses the construct/destroy logic from streams. Due to a lot of subtle assumptions this PR unfortunately touches a lot of different parts. PR-URL: #36816 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Futher aligns OutgoingMessage with stream.Writable. In particular
re-uses the construct/destroy logic from streams.
Due to a lot of subtle assumptions this PR unfortunately touches
a lot of different parts.