Skip to content

Commit 9c010b2

Browse files
committed
Remove undici from firestore
1 parent 97eb7a3 commit 9c010b2

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

packages/firestore/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
"@firebase/webchannel-wrapper": "1.0.1",
104104
"@grpc/grpc-js": "~1.9.0",
105105
"@grpc/proto-loader": "^0.7.8",
106-
"undici": "6.19.7",
107106
"tslib": "^2.1.0"
108107
},
109108
"peerDependencies": {

packages/firestore/src/platform/browser_lite/connection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ export { newConnectivityMonitor } from '../browser/connection';
2424

2525
/** Initializes the HTTP connection for the REST API. */
2626
export function newConnection(databaseInfo: DatabaseInfo): Connection {
27-
return new FetchConnection(databaseInfo, fetch.bind(null));
27+
return new FetchConnection(databaseInfo);
2828
}

packages/firestore/src/platform/browser_lite/fetch_connection.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ import { StringMap } from '../../util/types';
3030
export class FetchConnection extends RestConnection {
3131
/**
3232
* @param databaseInfo - The connection info.
33-
* @param fetchImpl - `fetch` or a Polyfill that implements the fetch API.
3433
*/
3534
constructor(
36-
databaseInfo: DatabaseInfo,
37-
private readonly fetchImpl: typeof fetch
35+
databaseInfo: DatabaseInfo
3836
) {
3937
super(databaseInfo);
4038
}
@@ -56,7 +54,7 @@ export class FetchConnection extends RestConnection {
5654
let response: Response;
5755

5856
try {
59-
response = await this.fetchImpl(url, {
57+
response = await fetch(url, {
6058
method: 'POST',
6159
headers,
6260
body: requestJson

packages/firestore/src/platform/node_lite/connection.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { fetch as undiciFetch } from 'undici';
19-
2018
import { DatabaseInfo } from '../../core/database_info';
2119
import { Connection } from '../../remote/connection';
2220
import { FetchConnection } from '../browser_lite/fetch_connection';
@@ -25,8 +23,6 @@ export { newConnectivityMonitor } from '../browser/connection';
2523

2624
/** Initializes the HTTP connection for the REST API. */
2725
export function newConnection(databaseInfo: DatabaseInfo): Connection {
28-
// undici is meant to be API compatible with `fetch`, but its type doesn't
29-
// match 100%.
3026
// eslint-disable-next-line @typescript-eslint/no-explicit-any
31-
return new FetchConnection(databaseInfo, undiciFetch as any);
27+
return new FetchConnection(databaseInfo);
3228
}

0 commit comments

Comments
 (0)