Skip to content

Dead code #1927

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

Merged
merged 10 commits into from
Jul 31, 2020
Merged

Dead code #1927

merged 10 commits into from
Jul 31, 2020

Conversation

code-asher
Copy link
Member

Removes all the code not currently in use.

- dashboard
- app api
A provider can now be registered on multiple endpoints (or potentially
moved if needed).
It can still be used to check for updates but will not apply them.

For now also remove the update check loop in VS Code since it's
currently unused (update check is hardcoded off right now) and won't
work anyway since it also applies the update which now won't work. In
the future we should integrate the check into the browser update
service.
This is for applications like Jupyter that aren't base path agnostic.
@code-asher code-asher requested a review from nhooyr as a code owner July 30, 2020 02:14
const providers = Array.from(this.providers.values())
// Catch so all the errors can be seen rather than just the first one.
const responses = await Promise.all<Error | undefined>(providers.map((p) => p.dispose().catch((e) => e)))
return responses.filter<Error>((r): r is Error => typeof r !== "undefined")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to use typeof here versus !== undefined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Practically no difference, just a stylistic choice. It might be because I'm thinking of it in terms of the type rather than the value. It parallels what I'd do if I wanted to filter strings instead, and I like the consistency. It also works for undeclared variables, further enforcing the consistency.

It might also be partly force of habit from back when you could overwrite undefined on the global object. 😛

But even though the global undefined is read-only now it still feels weird to me that I can do const undefined = "something" and now my checks have a different meaning.

@code-asher code-asher merged commit 5370f78 into master Jul 31, 2020
@code-asher code-asher deleted the dead-code branch July 31, 2020 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants