A new major version for the Node client library for Pub/Sub
5.0.0 is here.
The big story for this library is that we’re moving to a minimum engine version of Node 18 and upgrading a ton of dependencies in accordance. But there are a few things that aren’t fully covered by the changelog, and these are worth calling out here:
- ECMA compliance. We are now linting for dangling Promises (ones with no catch handler). Where possible, the cases this found were fixed to do something useful, and where that fix would’ve been non-trivial, we have added the void keyword for now.
- Upgraded TypeScript compiler. (5.8.3)
- Newly auto-generated gRPC classes. These underlie the higher level wrapper functionality that most users use. A really notable change here is support for request/response debug logging, for which I should probably write a whole separate blog.
Some changes are considered breaking, and may cause users to need to update their code. We always try to keep these to a minimum, but sometimes they just make sense:
- We had an old and somewhat broken implementation of OpenTelemetry tracing, implemented well before most of the other libraries (and well before we really knew exactly how we wanted to handle this important functionality). The legacy OpenTelemetry support was supported for quite a while, but that has now been removed. The new support uses the current standards with propagators as Pub/Sub message attributes.
- Legacy ack deadline options were removed. In the past, users could set ackDeadline by itself to fix the deadline at a number of seconds. This has been replaced by two knobs in the SubscriberOptions: minAckDeadline and maxAckDeadline. These have been used for a while with exactly-once delivery, but now they are the standard for all ack deadline limiting. These use our extremely lightweight polyfill for tc39’s Temporal Duration class, which will eventually be removed in favour of the real implementation.
- The FlowControlOptions setting maxExtension was renamed to maxExtensionMinutes for clarity, and maxExtension remained a compatibility shim. With a major, we are removing both of these and adding a new setting to SubscriberOptions (next to the *AckDeadline settings) called maxExtensionTime. This is also a modern Duration value to remove ambiguity about the time units.
As usual, if you have problems with the library itself, please post an issue or a discussion topic on the GitHub repo.