You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: Update CHANGELOG.md file in prep for 1.8.0 and make last minute API changes (#1148)
## What changed
- Updated CHANGELOG.md file in prep for 1.8.0.
- [Update core to get local activity start-to-close
fix](e920da3)
- [Fix flake in
test-isolation](7153d4d)
- [Rename activity context logger to log, moar changelog
edits](8379ca4)
- [Add versioning changelog and minor API
changes](7999b73)
---------
Co-authored-by: Roey Berman <roey.berman@gmail.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+163Lines changed: 163 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,169 @@ All notable changes to this project will be documented in this file.
4
4
5
5
Breaking changes marked with a :boom:
6
6
7
+
## [1.8.0] - 2023-06-22
8
+
9
+
### Features
10
+
11
+
- [`worker`] Add support for [worker versioning](https://docs.temporal.io/workers#worker-versioning) ([#1146](https://github.com/temporalio/sdk-typescript/pull/1146)).
12
+
13
+
Worker versioning is available from server version 1.21 (if enabled in dynamic configuration).
14
+
15
+
:warning: Experimental - While the feature is well tested and is considered functionally stable, the SDK APIs are
16
+
considered experimental.
17
+
18
+
To use worker versioning with the TypeScript SDK, use the following steps:
The number of pollers for each type can be controlled through the `WorkerOptions.maxConcurrentWorkflowTaskPolls`
74
+
and `WorkerOptions.maxConcurrentActivityTaskPolls` properties. Properly adjusting these values should allow better
75
+
filling of the corresponding execution slots, which may signficiantly improve a Worker's throughput. Defaults are
76
+
10 Workflow Task Pollers and 2 Activity Task Pollers; we however strongly recommend tuning these values
77
+
based on workload specific performance tests.
78
+
79
+
Default value for `maxConcurrentWorkflowTaskExecutions` has also been reduced to 40 (it was previously 100), as recent
80
+
performance tests demonstrate that higher values increase the risk of Workflow Task Timeouts unless other options are
81
+
also tuned. This was not problem previously because the single poller was unlikely to fill all execution slots, so
82
+
maximum would rarely be reached.
83
+
84
+
- [`workflow`] The `reuseV8Context` worker option is no longer marked as experimental ([#1132](https://github.com/temporalio/sdk-typescript/pull/1132)).
85
+
This is a major optimization of the Workflow sandboxing runtime; it allows the worker to reuse a single execution
86
+
context across Workflow instances, without compromising the safety of the deterministic sandbox. It significantly
87
+
reduces RAM and CPU usage. The formula used to auto-configure `maxCachedWorkflows` has also been reviewed to reflect a
88
+
lower memory usage requirement when `reuseV8Context` is enabled.
89
+
90
+
At this point, you still need to opt-in to this feature by adding `reuseV8Context: true` to your `WorkerOptions`, as
91
+
we believe most teams should reconsider their workers's performance settings after enabling this option.
92
+
93
+
:boom: Note that we are planing enabling this option by default starting with 1.9.0. If for some reason, you prefer to
94
+
delay enabling this optimization, then we recommend that you explicitly add `reuseV8Context: false` to your worker
95
+
options.
96
+
97
+
- We now provide out-of-the-box log support from both Workflows and Activity contexts ([#1117](https://github.com/temporalio/sdk-typescript/pull/1117), [#1138](https://github.com/temporalio/sdk-typescript/pull/1138))).
98
+
99
+
For Workflows, the logger funnels messages through the `defaultWorkerLogger` sink, which itself defaults to forwarding
100
+
messages to `Runtime.instance().logger`.
101
+
102
+
Example usage:
103
+
104
+
```ts
105
+
import * as workflow from '@temporalio/workflow';
106
+
107
+
export async function myWorkflow(): Promise<void> {
108
+
workflow.log.info('hello from my workflow', { key: 'value' });
109
+
}
110
+
```
111
+
112
+
For Activities, the logger can be accessed as `Context.logger`. It defaults to `Runtime.instance().logger`, but may be
113
+
overriden by interceptors (ie. to set a custom logger). `ActivityInboundLogInterceptor` is still installed by default,
114
+
adding enriched metadata from activity context on each log entry.
115
+
116
+
Example usage:
117
+
118
+
```ts
119
+
import * as activity from '@temporalio/activity';
120
+
121
+
export async function myActivity(): Promise<void> {
122
+
const context = activity.Context.current();
123
+
context.log.info('hello from my activity', { key: 'value' });
124
+
}
125
+
```
126
+
127
+
- :boom: Protect against 'ms' durations errors ([#1136](https://github.com/temporalio/sdk-typescript/pull/1136)).
128
+
There have been several reports of situations where invalid durations resulted in unexpected and hard to diagnose
129
+
issues (e.g. can you can predict what `const bool = condition(fn, '1 month')` will do?). We now provide type
130
+
definitions for "ms-formated strings" through the newly introduced `Duration` type, which is either a well formed
131
+
`ms`-formated string or a number of milliseconds. Invalid ms-formated-strings will also throw at runtime.
132
+
133
+
Note: this might cause build errors in situations where a non-const string value is passed somewhere we expect a
134
+
`Duration`. Consider either validating and converting these strings _before_ passing them as `Duration`, or simply
135
+
cast them to `Duration` and deal with runtime exception that might be thrown if an invalid value is provided.
136
+
137
+
- [`workflow`] Clone sink args at call time on Node 17+
138
+
([#1118](https://github.com/temporalio/sdk-typescript/pull/1118)). A subtle aspect of Workflow Sinks is that calls
139
+
are actually buffered and get executed only once the current Workflow activation completes. That sometime caused
140
+
unexpected behavior where an object passed as argument to a sink function is mutated after the invocation.
141
+
142
+
On Node.js 17+, we now clone sink arguments at call time, using `structuredClone`. While this adds some runtime
143
+
overhead, it leads to more predictable experience, as well as better exceptions when passing non-transferrable objects
144
+
to a sink.
145
+
146
+
- [`core`] Add the `sticky_cache_total_forced_eviction` metric ([Core #569](https://github.com/temporalio/sdk-core/pull/569))
147
+
148
+
- [`client`] Throw more specific errors from Client APIs ([#1147](https://github.com/temporalio/sdk-typescript/pull/1147))
149
+
150
+
### Bug Fixes
151
+
152
+
- [`core`] Metrics that should be produced by the SDK Core's internal Client would previously not
153
+
get emited. This has been fixed. ([#1119](https://github.com/temporalio/sdk-typescript/pull/1119))
154
+
- [`client`] Fix incorrect schedule spec boundaries checks on hour and day of month ([#1120](https://github.com/temporalio/sdk-typescript/pull/1120))
155
+
- [`workflow`] We know throw more meaningful errors when Workflow-only APIs are used from
156
+
non-Workflow context, and some other situations. ([#1126](https://github.com/temporalio/sdk-typescript/pull/1126))
157
+
- Removed most `instanceof` checks from SDK, and remplaced them by `XxxError.is(...)` checks, based on the presence of
158
+
a symbol property. We believe this should help resolve most of the problems that previously been observed when
159
+
multiple copies or different versions of SDK packages are installed in a same project (([#1128](https://github.com/temporalio/sdk-typescript/pull/1128))).
160
+
- [`workflow`] Make Local Activily timeouts in `ActivityInfo` match those of non-Local Activities ([#1133](https://github.com/temporalio/sdk-typescript/pull/1133), [Core #569](https://github.com/temporalio/sdk-core/pull/569)).
161
+
- [`workflow`] Ensure payload converters keep Uint8Array type equality ([#1143](https://github.com/temporalio/sdk-typescript/pull/1133))
162
+
- Fail workflow task if local activity not registered with worker ([#1152](https://github.com/temporalio/sdk-typescript/pull/1152))
- [`core`] Fix start-to-close local activity timeouts not being retryable like they should be ([#Core 576](https://github.com/temporalio/sdk-core/pull/576))
165
+
166
+
### Documentation
167
+
168
+
- Improve documentation for activity heartbeat and cancellationSignal ([#1151](https://github.com/temporalio/sdk-typescript/pull/1151))
0 commit comments