-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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(cli): use rid getter for stdio #8014
fix(cli): use rid getter for stdio #8014
Conversation
This changes the rid of Deno.stdin, Deno.stdout, Deno.stderr from a mutable property into a getter to match the rid semantics of Deno.File.
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.
Can you update the typings to reflect this?
export const stdin: Reader & ReaderSync & Closer & { readonly rid: number }; | ||
/** A handle for `stdout`. */ | ||
export const stdout: Writer & WriterSync & Closer & { rid: number }; | ||
export const stdout: Writer & WriterSync & Closer & { readonly rid: number }; | ||
/** A handle for `stderr`. */ | ||
export const stderr: Writer & WriterSync & Closer & { rid: number }; | ||
export const stderr: Writer & WriterSync & Closer & { readonly rid: number }; |
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.
This is breaking change 😬
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.
Technically, yes but I don't think we ever intended for them to actually be mutable.
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.
@caspervonb that's true, I'm only afraid it's gonna cause type checking havoc, hopefully not many users access rid
of stdio objects.
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.
Access should be fine - it should only break if someone tries to update it.
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
This changes the rid of Deno.stdin, Deno.stdout, Deno.stderr from a mutable property into a getter to match the rid semantics of Deno.File.