-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix(network): adjust Listener type params #18642
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.
I'm marking this as "Request changes" because this PR changes types of the public stable Deno APIs that might have big impact on users. We need to carefully check if this will cause any breakages and if so we should line this change for Deno 2.0 release.
@bartlomieju thanks. |
were you able to check this? |
Hey @jodinathan, sorry for a slow response. I haven't had a chance to verify it, I'll try to get someone to check it before the next minor release. |
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
Here's how I checked for breaking changes:
export interface Listener2<T extends Deno.Conn = Deno.Conn> extends AsyncIterable<T> {
accept(): Promise<T>;
close(): void;
readonly addr: Deno.Addr;
readonly rid: number;
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
ref(): void;
unref(): void;
}
export type TlsListener2 = Listener2<Deno.TlsConn>;
let a: Deno.Listener = eval("{}");
let b: Listener2 = eval("{}");
a = b;
b = a;
let c: Deno.TlsListener = eval("{}");
let d: TlsListener2 = eval("{}");
c = d;
d = c;
// No type checking errors on the assignments. Types are equivalent.
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, thanks @jodinathan
was this published? |
Yes, this was published in Deno v1.37 |
fixes #18635