Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

build!: convert to typescript - #923

Merged
summer-ji-eng merged 139 commits into
masterfrom
summer_convert
Apr 9, 2020
Merged

summer-ji-eng merged 139 commits into
masterfrom
summer_convert

Conversation

@summer-ji-eng

@summer-ji-eng summer-ji-eng commented Mar 23, 2020 •

Copy link
Copy Markdown
Contributor

BREAKING CHANGE: topicPath has been changed to projectTopicPath

Some synthtool hack will be removed once pubsub upgrade to gts:2.0.0

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 23, 2020
@codecov

codecov Bot commented Mar 24, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #923 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #923   +/-   ##
=======================================
  Coverage   94.06%   94.06%           
=======================================
  Files          23       23           
  Lines       10662    10662           
  Branches      503      503           
=======================================
  Hits        10029    10029           
  Misses        630      630           
  Partials        3        3           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4acc3e9...4acc3e9. Read the comment docs.

@googlebot googlebot added cla: no This human has *not* signed the Contributor License Agreement. cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Apr 7, 2020
@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

Comment thread .mocharc.json
Comment thread package.json Outdated

async function publishWithRetrySettings() {
const formattedTopic = publisherClient.topicPath(projectId, topicName);
const formattedTopic = publisherClient.projectTopicPath(projectId, topicName);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am worried this breaking change will get lost in the shuffle for folks. Can we make this super clear in the breaking changes section of the change log?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Make sense. But not very clear here, should I update change log in this PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bcoe what's the recommended way to do this? I've done longer form "before / after" descriptions for breaking changes that were meaningful in the past. Is the process here to manually update the CHANGELOG in a followup PR?

Comment thread synth.py
clients = ['publisher', 'subscriber']
for client_name in clients:
client_file = f'src/v1/{client_name}_client.ts'
s.replace(client_file,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh hey, this is great!

Comment thread synth.py
r"https://\1)")
# fix tslint issue due to mismatch gts version with gapic-generator-typescript
# it should be removed once pubsub upgrade gts 2.0.0
s.replace(client_file, '\/\/ eslint\-disable\-next\-line\ \@typescript\-eslint\/no\-explicit\-any',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The TODO above says we need to upgrade to [email protected]. That happens here right? Can we get rid of this synth change?

Comment thread synth.py Outdated
Comment thread tsconfig.json Outdated
"outDir": "build",
"resolveJsonModule": true,
"lib": [
"es2016",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still says 2016 :)

Comment thread src/iam.ts

import {google} from '../proto/iam';
import {google} from '../protos/protos';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what does this iam.tsdo? some exported type like SetPolicyResponse can be found in protos.google.iam.v1.IAMPolicy. Thanks!

@xiaozhenliu-gg5 xiaozhenliu-gg5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall LGTM! Thank you Summer!


async function publishWithRetrySettings() {
const formattedTopic = publisherClient.topicPath(projectId, topicName);
const formattedTopic = publisherClient.projectTopicPath(projectId, topicName);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bcoe what's the recommended way to do this? I've done longer form "before / after" descriptions for breaking changes that were meaningful in the past. Is the process here to manually update the CHANGELOG in a followup PR?

@feywind feywind left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

On re-review, this looks pretty nice! I would take another look down the remaining comments, but even as it is, it's fine. We can always tweak it a bit before 2.0.0 if something comes up.

Comment thread package.json
"sinon": "^9.0.0",
"source-map-support": "^0.5.9",
"ts-loader": "^6.2.1",
"typescript": "3.6.4",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use "typescript": "^3.8.3" as we do for other libraries?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As discussion with @feywind, upgrade typescript ^3.8.3 will happen when pubsub is ready for deprecate Node 8 and upgrade [email protected].

@alexander-fenster alexander-fenster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@summer-ji-eng
summer-ji-eng merged commit 2fc68ba into master Apr 9, 2020
@summer-ji-eng
summer-ji-eng deleted the summer_convert branch April 9, 2020 18:19
@release-please release-please Bot mentioned this pull request Apr 9, 2020
@JustinBeckwith

Copy link
Copy Markdown
Contributor

👏 👏 👏

This was referenced Apr 29, 2020
This was referenced May 19, 2020
@release-please release-please Bot mentioned this pull request May 20, 2020
feywind pushed a commit to feywind/nodejs-pubsub that referenced this pull request Nov 12, 2024
* docs: fix families typo

* docs: fix initial typo
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants