-
Notifications
You must be signed in to change notification settings - Fork 5.6k
feat: update checker #15543
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: update checker #15543
Conversation
You don't want this running under the lsp subcommand, as the output would be missed. I assume there are other subcommands it should be supressed. Also, it seems to check every invocation? |
let client = client_builder.build()?; | ||
|
||
let ver = if version::is_canary() { | ||
let res = client.get("https://version.deno.dev/canary").send().await?; |
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.
hardcoded values "buried" in code feels bad... maybe should be extracted out as a const?
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.
We can just use https://dl.deno.land/release-latest.txt and https://dl.deno.land/canary-latest.txt for this.
let client = client_builder.build()?; | ||
|
||
let ver = if version::is_canary() { | ||
let res = client.get("https://version.deno.dev/canary").send().await?; |
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.
shouldn't we be setting the UA string like with the file fetcher?
yes, it shouldnt run under some subcommands, and yes, it shouldnt run on every invocation; PR is not ready yet |
ok, let me know when you want me to complain |
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.
im concerned about startup time. how bad is it compared to main
? (oh its not ready yet, my bad)
To avoid ruining startup time, I think we should do the check in the background and display update info on the next invocation. |
colors::green_bold(format!( | ||
"Version '{ver}' of Deno is out, update with `deno upgrade`." | ||
)) | ||
); |
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 was just thinking that we should maybe only output this when stderr is a tty (and this outputs to stderr instead). That way we won’t randomly break anyone piping deno process output.
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.
Agree! Good idea.
Closing in favor of #15974 |
No description provided.