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
chore: extract Request
and Response
into its own module
#5861
chore: extract Request
and Response
into its own module
#5861
Conversation
28745e6
to
f88fd0c
Compare
f88fd0c
to
f7691e7
Compare
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.
Nice, thank you!
@@ -274,8 +275,7 @@ export class NetworkManager extends EventEmitter { | |||
const response = new Response(this._client, request, responsePayload); | |||
request._response = response; | |||
request._redirectChain.push(request); | |||
response._bodyLoadedPromiseFulfill.call( | |||
null, | |||
response._resolveBody( |
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.
@christian-bromann is this change deliberate? Looks like we lost a call to ._bodyLoadedPromiseFulfill
.
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.
@jackfranklin when making _bodyLoadedPromiseFulfill
a private field we can't access it from NetworkManager
anymore. I created a method in the Response class to allow access to it.
_resolveBody(err: Error | null): void {
return this._bodyLoadedPromiseFulfill(err);
}
Alternatively I could just keep _bodyLoadedPromiseFulfill
as non private field.
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.
Ah got you, thanks for explaining. As a general rule I think we should just do the easy privatisation work and leave any others as non private when initially splitting classes out (just to keep changes per PR down) but in this case this all looks fine to me and CI is green so no need to undo any of it 👍
Continuing with the effort of #5856 splitting classes into their own modules.