Noteworthy Changes
-
Normalize construction of user facing enums (#1534)
All user-facing enums have been revisited to be more in line with usual TypeScript conventions, rather than sticking to Temporal's Protobuf enum definitions.
In short, that means:
- No more redundant prefixes on enum values;
- No more
UNSPECIFIED
values — TypeScript'sundefined
already means that; - Enum types are now string unions, and users may choose to provide the string value directly.
For example:
await startChild(sleep, { - parentClosePolicy: ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON, + parentClosePolicy: ParentClosePolicy.ABANDON, /* or even */ + parentClosePolicy: 'ABANDON', });
Built-time compatibility is preserved for enum values that existed before. For example, code using
ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON
will still compile, but a deprecation will be reported.💥 Compile-time backward compatibility is only preserved for enums that were imported from user facing packages, such as
@temporalio/common
,@temporalio/client
and@temporalio/workflow
. Enum definitions imported directly from the@temporalio/proto
package may no longer compile.
Features
-
Add experimental support for user-implementable Slot Supplier. (#1553, temporalio/sdk-core#838, temporalio/sdk-core#842)
-
Add support for Workflow ID conflict policy. (#1490)
-
Expose classes
TextEncoder
andTextDecoder
inside of the Workflow sandbox. (#1562, kudo to @lukeramsden) -
The OpenTelemetry Interceptor now adds correlation metadata on emitted logs from Workflow and Activity context loggers. (#1565)
-
The OpenTelemetry Interceptor now passes the tracing metadata on signals. (#1449, kudo to @iravid)
-
[
client
] Add utility functionsisGrpcDeadlineError
andisGrpcCancelledError
. (#1548)
Bug Fixes
-
[
worker
] Fix memory leak on non-existant activity (#1563) -
[
activity
] Abort reason is now an instance ofCancellationFailure
(#1561, kudo to @ikonst) -
[
worker
] Ensure Resource Tuner always hand out a minimum of one slot for sticky and not sticky Workflow Task pollers (temporalio/sdk-core#835)