Skip to content

Drop Node 6 / Replace grpc w/ @grpc/grpc-js #2856

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
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@types/chai-as-promised": "7.1.2",
"@types/long": "4.0.1",
"@types/mocha": "7.0.2",
"@types/node": "13.11.0",
"@types/node": "12.12.34",
"@types/sinon": "7.5.2",
"@types/sinon-chai": "3.2.3",
"@typescript-eslint/eslint-plugin": "2.24.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/firestore/src/platform_node/grpc_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import {
import firebase from '@firebase/app';
const SDK_VERSION = firebase.SDK_VERSION;

// eslint-disable-next-line @typescript-eslint/no-require-imports
const grpcVersion = require('@grpc/grpc-js/package.json').version;
const grpcVersion = import('@grpc/grpc-js/package.json').version;
Copy link
Member

@Feiyang1 Feiyang1 Apr 6, 2020

Choose a reason for hiding this comment

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

You could also use a normal import, then add a plugin in the rollup.config.js.

import { version } from '@grpc/grpc-js/package.json'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already use this build setting, but since we don't use rollup for our unit tests, this breaks the unit test.


import { Token } from '../api/credentials';
import { DatabaseInfo } from '../core/database_info';
Expand Down
22 changes: 1 addition & 21 deletions packages/firestore/src/util/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,7 @@ export interface Rejecter {
(reason?: Error): void;
}

export interface CancelablePromise<T> {
// We are not extending Promise, since Node's Promise API require us to
// implement 'finally', which is not fully supported on Web.
then<TResult1 = T, TResult2 = never>(
onfulfilled?:
| ((value: T) => TResult1 | PromiseLike<TResult1>)
| undefined
| null,
onrejected?:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
| ((reason: any) => TResult2 | PromiseLike<TResult2>)
| undefined
| null
): Promise<TResult1 | TResult2>;
catch<TResult = never>(
onrejected?:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
| ((reason: any) => TResult | PromiseLike<TResult>)
| undefined
| null
): Promise<T | TResult>;
export interface CancelablePromise<T> extends Promise<T> {
cancel(): void;
}

Expand Down
1 change: 0 additions & 1 deletion packages/testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@firebase/logger": "0.2.1",
"@firebase/util": "0.2.44",
"@types/request": "2.48.4",
"firebase": "7.13.1",
"request": "2.88.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright 2018 Google Inc.
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading