Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Update typescript to v4.7 #2408

Merged
merged 3 commits into from
Sep 6, 2022
Merged

Update typescript to v4.7 #2408

merged 3 commits into from
Sep 6, 2022

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented Sep 6, 2022

Description

Update typescript to v4.7.4.

  • Set useUnknownInCatchVariables: false to override strict mode. Enabling this new strict mode option (which would be the case because we set strict:true) causes lots of errors. On order to focus on the update, let's disable it for now and we can go back to fixing this up as part of Enable tsconfig strict mode options #1815.

@BPScott BPScott requested a review from a team as a code owner September 6, 2022 20:49
@BPScott BPScott requested a review from ttemrahcelik September 6, 2022 20:49
@ttemrahcelik ttemrahcelik removed their request for review September 6, 2022 20:50
@@ -1,7 +1,7 @@
import {set} from './utilities';

export interface NavigatorWithConnection extends Navigator {
connection: {
connection: Navigator['connection'] & {
Copy link
Member Author

Choose a reason for hiding this comment

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

As of TS 4.4 the connection key now exists on Navigator, so extend from that and mock out the keys that are required because of this.

// According to the spec the max value timeRemaining can return is 50
const MAX_TIME_REMAINING = 50;

function fallbackQueueingFunction(cb: IdleCallback) {
function fallbackQueueingFunction(cb: IdleRequestCallback) {
Copy link
Member Author

Choose a reason for hiding this comment

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

As of TS 4.4 requestIdleCallback and cancelIdleCallback keys exist on TS's definition of Window so we don't need to augment it here anymore.


extendedWindow.cancelIdleCallback =
extendedWindow.cancelIdleCallback || (window as any).clearImmediate;
export {};
Copy link
Member Author

Choose a reason for hiding this comment

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

This file no longer contains an import so we need something to tell TS/babel "this file is authored in the esmodules style"

@BPScott BPScott merged commit 2094cb3 into main Sep 6, 2022
@BPScott BPScott deleted the ts-update branch September 6, 2022 21:18
@github-actions github-actions bot mentioned this pull request Sep 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants