At the moment, the worker completion payload is a Partial. However, this erases type safety for required parameters.
If a programmer really has a Partial, they can put that in the signature.
Changing this will break the compilation of any code that uses type parameters on createWorker, if it relies on the existing implicit Partial<T>.
I don't think many people are using that at the moment - I'll check in Slack.
The benefit of making this change for type safety is significant, and the refactoring to fix the breaking change in users' code is T -> Partial<T> which is minimal and deterministic.
At the moment, the worker completion payload is a Partial. However, this erases type safety for required parameters.
If a programmer really has a Partial, they can put that in the signature.
Changing this will break the compilation of any code that uses type parameters on
createWorker
, if it relies on the existing implicitPartial<T>
.I don't think many people are using that at the moment - I'll check in Slack.
The benefit of making this change for type safety is significant, and the refactoring to fix the breaking change in users' code is
T
->Partial<T>
which is minimal and deterministic.For example:
if the worker really returns only part of the
IndividualResult
type, it will need to be refactored to:The change needs to be made here: https://github.com/zeebe-io/zeebe-client-node-js/blob/master/src/lib/ZBWorkerBase.ts#L275