Skip to content

feat(pubsub): split GAPIC from the pubsub handwritten package#8854

Draft
feywind wants to merge 6 commits into
mainfrom
feywind-pubsub-split
Draft

feat(pubsub): split GAPIC from the pubsub handwritten package#8854
feywind wants to merge 6 commits into
mainfrom
feywind-pubsub-split

Conversation

@feywind

@feywind feywind commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This will split out the GAPIC classes into their own package (-api) and change the main handwritten library to use them instead of a built-in copy.

We're waiting on a release next week to link -api - please don't merge.

@feywind feywind added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 10, 2026
@product-auto-label product-auto-label Bot added the api: pubsub Issues related to the Pub/Sub API. label Jul 10, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request removes the auto-generated GAPIC client files and configuration JSONs, delegating them to the newly added external dependency @google-cloud/pubsub-api. However, two critical runtime issues were identified in the review: first, requiring a configuration JSON directly from the src/ directory of @google-cloud/pubsub-api in message-stream.ts will fail when published; second, using a namespace import for p-defer in subscriber.ts will cause a runtime TypeError when invoked.

Comment thread handwritten/pubsub/src/message-stream.ts Outdated
import {replaceProjectIdToken} from '@google-cloud/projectify';
import {promisify} from '@google-cloud/promisify';
import defer = require('p-defer');
import * as defer from 'p-defer';

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.

medium

p-defer exports its main functionality as a default export. Importing it using import * as defer binds defer to a namespace object (e.g., { default: [Function] }), which will cause a runtime TypeError: defer is not a function when called as defer(). Use a default import instead.

Suggested change
import * as defer from 'p-defer';
import defer from 'p-defer';

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.

The default import version causes other issues. It might be simplest to just revert this to a require if we don't like the new * version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API. do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant