Skip to content

Upgrade to TypeScript 5 #8561

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 26 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
42ab67f
Updgrade to TS5
dlarocque Oct 8, 2024
7aa5fa2
Remove passes of decorators to TS factory functions
dlarocque Oct 9, 2024
df4da35
Format
dlarocque Oct 9, 2024
d93358a
Update TS in packages that used older TS versions
dlarocque Oct 9, 2024
c58e63b
Convert `EmulatorConfig`'s `HostAndPort` to be an optional property
dlarocque Oct 10, 2024
195c230
Update API reports
dlarocque Oct 16, 2024
353229b
Update yarn.lock
dlarocque Oct 16, 2024
a96166d
Cleanup
dlarocque Oct 16, 2024
40b0930
Upgrade ts-essentials to latest
dlarocque Oct 16, 2024
f1116fa
Format and move prune-dts test folder
dlarocque Oct 16, 2024
6d3fe14
Fix unknown comparison with number
dlarocque Oct 17, 2024
1fb70f2
Fix remote-config timeoutStub types
dlarocque Oct 17, 2024
6bda4e2
Make Auth Recaptcha request extend object
dlarocque Oct 18, 2024
9628d69
Declare Firestore Data Converter test type `MyModelType` as PartialWi…
dlarocque Oct 18, 2024
9d2fd68
Revert firestore lite typings test fix
dlarocque Oct 18, 2024
b82f2b6
Disable import/no-extraneous-dependencies for auth recaptcha tests
dlarocque Oct 21, 2024
b19aebd
Explicitly type Firestore data converter in type tests
dlarocque Oct 21, 2024
7aa755a
Downgrade `@types/node` to 18.19.57
dlarocque Oct 21, 2024
aa51e66
Revert "Convert `EmulatorConfig`'s `HostAndPort` to be an optional pr…
dlarocque Oct 21, 2024
db3b0d5
Don't throw an error in case where only one of host or port are defines
dlarocque Oct 21, 2024
2b830aa
Merge branch 'main' into dl/ts5
dlarocque Oct 22, 2024
e7b9b12
Throw error if only one of host or port are defined
dlarocque Oct 22, 2024
c27254f
Update API reports
dlarocque Oct 22, 2024
e27616b
Add outer host and port check, and move tests back
dlarocque Oct 23, 2024
fcc03ad
Merge branch 'main' into dl/ts5
dlarocque Oct 23, 2024
d693bfd
Update devsite docs
dlarocque Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Prune .d.ts",
"program": "${workspaceRoot}/repo-scripts/prune-dts/node_modules/.bin/_mocha",
"cwd": "${workspaceRoot}/repo-scripts/prune-dts",
"args": [
"--require",
"ts-node/register",
"--timeout",
"5000",
"${workspaceFolder}/repo-scripts/prune-dts/*.test.ts"
],
"env": {
"TS_NODE_COMPILER_OPTIONS" : "{\"module\":\"commonjs\"}"
},
"sourceMaps": true,
},
{
"type": "node",
"request": "launch",
Expand Down
8 changes: 4 additions & 4 deletions docs-devsite/analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ Whether a particular consent type has been granted or denied.
<b>Signature:</b>

```typescript
export declare type ConsentStatusString = 'granted' | 'denied';
export type ConsentStatusString = 'granted' | 'denied';
```

## Currency
Expand All @@ -1000,7 +1000,7 @@ Standard Google Analytics currency type.
<b>Signature:</b>

```typescript
export declare type Currency = string | number;
export type Currency = string | number;
```

## CustomEventName
Expand All @@ -1010,7 +1010,7 @@ Any custom event name string not in the standard list of recommended event names
<b>Signature:</b>

```typescript
export declare type CustomEventName<T> = T extends EventNameString ? never : T;
export type CustomEventName<T> = T extends EventNameString ? never : T;
```

## EventNameString
Expand All @@ -1020,5 +1020,5 @@ Type for standard Google Analytics event names. `logEvent` also accepts any cust
<b>Signature:</b>

```typescript
export declare type EventNameString = 'add_payment_info' | 'add_shipping_info' | 'add_to_cart' | 'add_to_wishlist' | 'begin_checkout' | 'checkout_progress' | 'exception' | 'generate_lead' | 'login' | 'page_view' | 'purchase' | 'refund' | 'remove_from_cart' | 'screen_view' | 'search' | 'select_content' | 'select_item' | 'select_promotion' | 'set_checkout_option' | 'share' | 'sign_up' | 'timing_complete' | 'view_cart' | 'view_item' | 'view_item_list' | 'view_promotion' | 'view_search_results';
export type EventNameString = 'add_payment_info' | 'add_shipping_info' | 'add_to_cart' | 'add_to_wishlist' | 'begin_checkout' | 'checkout_progress' | 'exception' | 'generate_lead' | 'login' | 'page_view' | 'purchase' | 'refund' | 'remove_from_cart' | 'screen_view' | 'search' | 'select_content' | 'select_item' | 'select_promotion' | 'set_checkout_option' | 'share' | 'sign_up' | 'timing_complete' | 'view_cart' | 'view_item' | 'view_item_list' | 'view_promotion' | 'view_search_results';
```
2 changes: 1 addition & 1 deletion docs-devsite/app-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,5 +197,5 @@ A listener that is called whenever the App Check token changes.
<b>Signature:</b>

```typescript
export declare type AppCheckTokenListener = (token: AppCheckTokenResult) => void;
export type AppCheckTokenListener = (token: AppCheckTokenResult) => void;
```
8 changes: 4 additions & 4 deletions docs-devsite/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -2114,7 +2114,7 @@ Map of OAuth Custom Parameters.
<b>Signature:</b>

```typescript
export declare type CustomParameters = Record<string, string>;
export type CustomParameters = Record<string, string>;
```

## NextOrObserver
Expand All @@ -2124,7 +2124,7 @@ Type definition for an event callback.
<b>Signature:</b>

```typescript
export declare type NextOrObserver<T> = NextFn<T | null> | Observer<T | null>;
export type NextOrObserver<T> = NextFn<T | null> | Observer<T | null>;
```

## PhoneInfoOptions
Expand All @@ -2136,7 +2136,7 @@ The information that's required depends on whether you are doing single-factor s
<b>Signature:</b>

```typescript
export declare type PhoneInfoOptions = PhoneSingleFactorInfoOptions | PhoneMultiFactorEnrollInfoOptions | PhoneMultiFactorSignInInfoOptions;
export type PhoneInfoOptions = PhoneSingleFactorInfoOptions | PhoneMultiFactorEnrollInfoOptions | PhoneMultiFactorSignInInfoOptions;
```

## UserProfile
Expand All @@ -2146,5 +2146,5 @@ User profile used in [AdditionalUserInfo](./auth.additionaluserinfo.md#additiona
<b>Signature:</b>

```typescript
export declare type UserProfile = Record<string, unknown>;
export type UserProfile = Record<string, unknown>;
```
6 changes: 3 additions & 3 deletions docs-devsite/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Possible values: - 'cancelled': The operation was cancelled (typically by the ca
<b>Signature:</b>

```typescript
export declare type FunctionsErrorCode = `functions/${FunctionsErrorCodeCore}`;
export type FunctionsErrorCode = `functions/${FunctionsErrorCodeCore}`;
```

## FunctionsErrorCodeCore
Expand All @@ -157,7 +157,7 @@ Functions error code string appended after "functions/" product prefix. See [Fun
<b>Signature:</b>

```typescript
export declare type FunctionsErrorCodeCore = 'ok' | 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated';
export type FunctionsErrorCodeCore = 'ok' | 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated';
```

## HttpsCallable
Expand All @@ -167,5 +167,5 @@ A reference to a "callable" HTTP trigger in Google Cloud Functions.
<b>Signature:</b>

```typescript
export declare type HttpsCallable<RequestData = unknown, ResponseData = unknown> = (data?: RequestData | null) => Promise<HttpsCallableResult<ResponseData>>;
export type HttpsCallable<RequestData = unknown, ResponseData = unknown> = (data?: RequestData | null) => Promise<HttpsCallableResult<ResponseData>>;
```
4 changes: 2 additions & 2 deletions docs-devsite/installations.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ An user defined callback function that gets called when Installations ID changes
<b>Signature:</b>

```typescript
export declare type IdChangeCallbackFn = (installationId: string) => void;
export type IdChangeCallbackFn = (installationId: string) => void;
```

## IdChangeUnsubscribeFn
Expand All @@ -162,5 +162,5 @@ Unsubscribe a callback function previously added via [IdChangeCallbackFn](./inst
<b>Signature:</b>

```typescript
export declare type IdChangeUnsubscribeFn = () => void;
export type IdChangeUnsubscribeFn = () => void;
```
6 changes: 3 additions & 3 deletions docs-devsite/remote-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Summarizes the outcome of the last attempt to fetch config from the Firebase Rem
<b>Signature:</b>

```typescript
export declare type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle';
export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle';
```

## LogLevel
Expand All @@ -335,7 +335,7 @@ Defines levels of Remote Config logging.
<b>Signature:</b>

```typescript
export declare type LogLevel = 'debug' | 'error' | 'silent';
export type LogLevel = 'debug' | 'error' | 'silent';
```

## ValueSource
Expand All @@ -347,5 +347,5 @@ Indicates the source of a value.
<b>Signature:</b>

```typescript
export declare type ValueSource = 'static' | 'default' | 'remote';
export type ValueSource = 'static' | 'default' | 'remote';
```
6 changes: 3 additions & 3 deletions docs-devsite/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ An enumeration of the possible string formats for upload.
<b>Signature:</b>

```typescript
export declare type StringFormat = (typeof StringFormat)[keyof typeof StringFormat];
export type StringFormat = (typeof StringFormat)[keyof typeof StringFormat];
```

## TaskEvent
Expand All @@ -503,7 +503,7 @@ An event that is triggered on a task.
<b>Signature:</b>

```typescript
export declare type TaskEvent = 'state_changed';
export type TaskEvent = 'state_changed';
```

## TaskState
Expand All @@ -513,7 +513,7 @@ Represents the current state of a running upload.
<b>Signature:</b>

```typescript
export declare type TaskState = 'running' | 'paused' | 'success' | 'canceled' | 'error';
export type TaskState = 'running' | 'paused' | 'success' | 'canceled' | 'error';
```

## StorageErrorCode
Expand Down
6 changes: 3 additions & 3 deletions docs-devsite/vertexai.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Content part - includes text, image/video, or function call/response part types.
<b>Signature:</b>

```typescript
export declare type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart;
export type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart;
```

## Role
Expand All @@ -194,7 +194,7 @@ Role is the producer of the content.
<b>Signature:</b>

```typescript
export declare type Role = (typeof POSSIBLE_ROLES)[number];
export type Role = (typeof POSSIBLE_ROLES)[number];
```

## Tool
Expand All @@ -214,7 +214,7 @@ A type that includes all specific Schema types.
<b>Signature:</b>

```typescript
export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema;
export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema;
```

## BlockReason
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"karma-typescript": "5.5.4",
"karma-typescript-es6-transform": "5.5.4",
"mocha": "9.2.2",
"typescript": "4.7.4",
"typescript": "5.5.4",
"webpack": "5.76.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.11.1"
Expand Down
2 changes: 1 addition & 1 deletion integration/compat-interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@firebase/remote-config-compat": "0.2.10"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion integration/compat-typings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"firebase": "*"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion integration/firebase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"karma-typescript": "5.5.4",
"mocha": "9.2.2",
"npm-run-all": "4.1.5",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion integration/firestore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"karma-spec-reporter": "0.0.36",
"mocha": "9.2.2",
"ts-loader": "9.5.1",
"typescript": "4.2.2",
"typescript": "5.5.4",
"webpack": "5.76.0",
"webpack-stream": "7.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@types/long": "4.0.2",
"@types/mocha": "9.1.1",
"@types/mz": "2.7.8",
"@types/node": "16.18.68",
"@types/node": "18.19.57",
"@types/request": "2.48.12",
"@types/sinon": "9.0.11",
"@types/sinon-chai": "3.2.12",
Expand Down Expand Up @@ -156,7 +156,7 @@
"tsec": "0.2.8",
"tslint": "6.1.3",
"typedoc": "0.16.11",
"typescript": "4.7.4",
"typescript": "5.5.4",
"watch": "1.0.2",
"webpack": "5.76.0",
"yargs": "17.7.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"rollup": "2.79.1",
"@rollup/plugin-json": "4.1.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/analytics-compat",
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-interop-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/analytics-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/analytics",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-check-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/app-check",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-check-interop-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/app-check-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/app-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/app-check",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@rollup/plugin-json": "4.1.0",
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-typescript2": "0.31.2",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/app-compat",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"@firebase/logger": "0.2.6"
},
"devDependencies": {
"typescript": "4.7.4"
"typescript": "5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-typescript2": "0.31.2",
"rollup-plugin-dts": "5.3.1",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/app",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-compat/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-typescript2": "0.31.2",
"rollup-plugin-uglify": "6.0.4",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/auth-compat/demo",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-typescript2": "0.31.2",
"selenium-webdriver": "4.8.0",
"typescript": "4.7.4"
"typescript": "5.5.4"
},
"repository": {
"directory": "packages/auth-compat",
Expand Down
Loading
Loading