Skip to content
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

Update TypeScript to v4.4 #795

Merged
merged 2 commits into from
Apr 22, 2022
Merged

Update TypeScript to v4.4 #795

merged 2 commits into from
Apr 22, 2022

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Apr 21, 2022

See the release announcement for more details about v4.4: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-rc/

The main breaking change that affected us was the change in the default type of the catch error parameter from any to unknown. This was resolved in some places by changing the expected type to unknown. In cases where we need it to be an Error or where we use an Error property, the type is now checked at runtime.

A minor change was needed in BaseControlelrV2 as well, because TypeScript wasn't happy with the fact that it was never initialized for some reason, even though it wasn't supposed to be initialized (it was set to never). But initializing it as undefined serves the exact same purpose and resolved the error.

@Gudahtt
Copy link
Member Author

Gudahtt commented Apr 21, 2022

This is blocked by test coverage improvements, which are blocked by the various test related PRs that are currently open.

@Gudahtt Gudahtt force-pushed the update-typescript-4.4 branch 2 times, most recently from a540035 to 5e7c753 Compare April 22, 2022 17:44
See the release announcement for more details about v4.4:
https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-rc/

The main breaking change that affected us was the change in the default
type of the `catch` error parameter from `any` to `unknown`. This was
resolved in some places by changing the expected type to `unknown`. In
cases where we need it to be an `Error` or where we use an `Error`
property, the type is now checked at runtime.

A minor change was needed in `BaseControlelrV2` as well, because
TypeScript wasn't happy with the fact that it was never initialized
for some reason, even though it wasn't supposed to be initialized
(it was set to `never`). But initializing it as `undefined` serves the
exact same purpose and resolved the error.
@Gudahtt Gudahtt force-pushed the update-typescript-4.4 branch from 5e7c753 to 25bd13f Compare April 22, 2022 18:03
@Gudahtt Gudahtt marked this pull request as ready for review April 22, 2022 18:04
@Gudahtt Gudahtt requested a review from a team as a code owner April 22, 2022 18:04
mcmire
mcmire previously approved these changes Apr 22, 2022
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

One minor comment, but otherwise makes sense to me!

src/permissions/PermissionController.ts Outdated Show resolved Hide resolved
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
@Gudahtt Gudahtt requested a review from mcmire April 22, 2022 18:39
@Gudahtt Gudahtt merged commit 6abbc5d into main Apr 22, 2022
@Gudahtt Gudahtt deleted the update-typescript-4.4 branch April 22, 2022 19:10
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
See the release announcement for more details about v4.4:
https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-rc/

The main breaking change that affected us was the change in the default
type of the `catch` error parameter from `any` to `unknown`. This was
resolved in some places by changing the expected type to `unknown`. In
cases where we need it to be an `Error` or where we use an `Error`
property, the type is now checked at runtime.

A minor change was needed in `BaseControllerV2` as well, because
TypeScript wasn't happy with the fact that it was never initialized
for some reason, even though it wasn't supposed to be initialized
(it was set to `never`). But initializing it as `undefined` serves the
exact same purpose and resolved the error.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
See the release announcement for more details about v4.4:
https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-rc/

The main breaking change that affected us was the change in the default
type of the `catch` error parameter from `any` to `unknown`. This was
resolved in some places by changing the expected type to `unknown`. In
cases where we need it to be an `Error` or where we use an `Error`
property, the type is now checked at runtime.

A minor change was needed in `BaseControllerV2` as well, because
TypeScript wasn't happy with the fact that it was never initialized
for some reason, even though it wasn't supposed to be initialized
(it was set to `never`). But initializing it as `undefined` serves the
exact same purpose and resolved the error.
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