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

fix!: mark v1beta1 client as deprecated #937

Merged
merged 3 commits into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions dev/src/v1beta1/firestore_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import {Transform} from 'stream';
import * as protosTypes from '../../protos/firestore_v1beta1_proto_api';
import * as gapicConfig from './firestore_client_config.json';

// tslint:disable deprecation

const version = require('../../../package.json').version;

/**
Expand All @@ -52,6 +54,7 @@ const version = require('../../../package.json').version;
* committed. Any read with an equal or greater `read_time` is guaranteed
* to see the effects of the transaction.
* @class
* @deprecated Use v1/firestore_client instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know specifically which tools/situations where this will be surfaced? I think the TypeScript compiler, and eslint will do stuff. Should we consider emitting runtime warnings for users not using these kinds of tools though?

Copy link
Contributor Author

@schmidt-sebastian schmidt-sebastian Feb 20, 2020

Choose a reason for hiding this comment

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

It shows up in the generated docs (barely legible) and as a warning in VSCode/IntelliJ.

* @memberof v1beta1
*/
export class FirestoreClient {
Expand Down
2 changes: 2 additions & 0 deletions dev/src/v1beta1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

// tslint:disable deprecation

import {FirestoreClient} from './firestore_client';
export {FirestoreClient};

Expand Down
107 changes: 11 additions & 96 deletions dev/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
{
"updateTime": "2020-02-07T18:50:00.377881Z",
"updateTime": "2020-02-20T22:37:26.236453Z",
"sources": [
{
"git": {
"name": ".",
"remote": "[email protected]:googleapis/nodejs-firestore.git",
"sha": "a2c941c3c14fe509d1ca245e07e4c1487c6861c0"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585",
"internalRef": "293710856"
"sha": "3eaaaf8626ce5b0c0bc7eee05e143beffa373b01",
"internalRef": "296274723"
}
},
{
"template": {
"name": "node_library",
"origin": "synthtool.gcp",
"version": "2019.10.17"
"version": "2020.2.4"
}
}
],
Expand Down Expand Up @@ -45,97 +52,5 @@
"generator": "gapic-generator-typescript"
}
}
],
"newFiles": [
{
"path": ".gitignore"
},
{
"path": ".mocharc.json"
},
{
"path": "protos/google/firestore/admin/v1/field.proto"
},
{
"path": "protos/google/firestore/admin/v1/firestore_admin.proto"
},
{
"path": "protos/google/firestore/admin/v1/index.proto"
},
{
"path": "protos/google/firestore/admin/v1/location.proto"
},
{
"path": "protos/google/firestore/admin/v1/operation.proto"
},
{
"path": "protos/google/firestore/v1/common.proto"
},
{
"path": "protos/google/firestore/v1/document.proto"
},
{
"path": "protos/google/firestore/v1/firestore.proto"
},
{
"path": "protos/google/firestore/v1/query.proto"
},
{
"path": "protos/google/firestore/v1/write.proto"
},
{
"path": "protos/google/firestore/v1beta1/common.proto"
},
{
"path": "protos/google/firestore/v1beta1/document.proto"
},
{
"path": "protos/google/firestore/v1beta1/firestore.proto"
},
{
"path": "protos/google/firestore/v1beta1/query.proto"
},
{
"path": "protos/google/firestore/v1beta1/write.proto"
},
{
"path": "protos/protos.json"
},
{
"path": "src/v1/firestore_admin_client.ts"
},
{
"path": "src/v1/firestore_admin_client_config.json"
},
{
"path": "src/v1/firestore_admin_proto_list.json"
},
{
"path": "src/v1/firestore_client.ts"
},
{
"path": "src/v1/firestore_client_config.json"
},
{
"path": "src/v1/firestore_proto_list.json"
},
{
"path": "src/v1beta1/firestore_client.ts"
},
{
"path": "src/v1beta1/firestore_client_config.json"
},
{
"path": "src/v1beta1/firestore_proto_list.json"
},
{
"path": "test/gapic-firestore-v1.ts"
},
{
"path": "test/gapic-firestore-v1beta1.ts"
},
{
"path": "test/gapic-firestore_admin-v1.ts"
}
]
}
15 changes: 14 additions & 1 deletion synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,26 @@
"dev/src/v1beta1/firestore_client.ts",
"/protos/protos'",
"/protos/firestore_v1beta1_proto_api'"
)
)
s.replace(
"dev/test/gapic-firestore-v1beta1.ts",
"/protos/protos'",
"/protos/firestore_v1beta1_proto_api'"
)

# Mark v1beta1 as deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

@AlanGasperini @alexander-fenster so this is a funny use for synthtool :) For cases where a specific API version itself is deprecated, how do we let customers know?

Copy link
Contributor

Choose a reason for hiding this comment

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

@lukesneeringer Is there any annotation that might help mark the whole API version as deprecated?

s.replace(
"dev/src/v1beta1/firestore_client.ts",
"@class",
"@class\n * @deprecated Use v1/firestore_client instead."
)
s.replace(
"dev/src/v1beta1/firestore_client.ts",
"const version",
"// tslint:disable deprecation\n\nconst version",
1
)

# Remove auto-generated packaging tests
os.system('rm -rf dev/system-test/fixtures dev/system-test/install.ts')

Expand Down
1 change: 1 addition & 0 deletions types/firestore.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,7 @@ declare namespace FirebaseFirestore {
/**
* The v1beta1 Veneer client. This client provides access to to the underlying
* Firestore v1beta1 RPCs.
* @deprecated Use v1 instead.
*/
export const v1beta1 : any;

Expand Down