New features:
- Static method
Array.includes(arr, x)for checking if the arrayarrcontain the valuex
Fixes:
- Print the correct source code line on error messages
- Type annotation fixes in workflowslib
Fixes:
- Blocking calls and assignments were generated in a wrong order in complex expressions
- Don't output undefined arguments in call steps
- Type annotation fixes in workflowslib
Fixes:
- function identifiers (e.g. in call_step and parallel) are included in the
--linkoutput - Improve type annotations of map.* functions
New features:
- New command line option
--linkgenerates self-contained YAML files (all needed subworkflows in one file) - Accepts Typescript's
satisfiesexpression anddebuggerstatement. They do not affect the YAML output.
Fixes:
- Empty body in an
ifstatements generated invalid code - In certain cases nested map literals generated invalid code
- Some expressions with many extractable sub-expressions (map literals, blocking calls) generated invalid code because a temporary variable was re-used incorrectly
- Empty statements are accepted at the top level
- Ignore extra arguments in blocking function calls in all cases. Previously, extra arguments were ignored in some cases but threw errors in other cases.
- Call expressions in optional chaining (
data?.getPerson()?.name) now result in error. Previously, they were incorrectly treated as non-optional in the generated code. - Fixed code generation for an object rest element nested in an array pattern:
const [{...rest}] = data
Breaking changes:
- Requires Node 20 or newer and Typescript 5.4.0 or newer
- retry_policy() must be called inside a try block, not after
- Variable declarations with
varare not supported, onlyletandconst - Step name numbering starts from 1 at the start of each subworkflow
Fixes:
- Type annotation fixes in workflowslib
- Accept binary expressions as properties in assignments:
a[i + 4] = 1(regression in 0.9.0) - Evaluate side-effects only once on the left-hand side in compound assignments:
x[f()] += 1 - Fix calling
call_step()on the right-hand side of a compound assignment:x += call_step(sum, {a: 10, b: 11}) - Output an error if a subworkflow is empty because empty body is not allowed on GCP
Breaking changes:
True,TRUE,FalseandFALSEno longer are synonyms fortrueandfalse
New features:
- Array and object destructuring:
const [a, b] = getArray()
Fixes:
- Fix a deployment error caused by the same temp variable name being used inside and outside of a parallel branch
- Multiple input files can be given on the command line
- Argument
--outdirsets the output directory - Argument
--projectdefines the TSConfig location for the source files --(no-)generated-file-comment: optionally include a comment about the output file being generated--versionprints the correct version number- Accept instantiation expressions
func<TYPE>
typeofoperatornullis allowed as interpolated value in template literal${null}- Accept
undefinedas a function argument default argument:func(a: number | undefined = undefined) - Optional function arguments:
func(a?: number)
Breaking changes:
- retry_policy() takes a plain policy function name instead of a {policy: ...} object
Fixes:
- The try statement supports a finally block
- Support empty body in a catch block
- retry_policy() parameter values can now be expressions in addition to number literals
- 0, "", false and null can now be used as subworkflow parameter default values
- Type annotation fixes
- Move nested map expressions to assign steps where necessary
- Array.isArray() is transformed correcly in nested expressions
- Optional chaining a?.b is converted to map.get(a, "b")
- Non-null assertions person!.name is accepted but ignored to the transpiler
- Merge a next step to a preceeding assign step
- Accept a single-statement body (body without braces {}) in if, while, etc
- Assign the result of call_step() to a member variable: obj.property = call_step()
- parallel() and retry_policy() special functions can only be used as statements
- Better error messages on RegExp, BigInt, spread syntax and other non-supported Javascript features
- Function invocations no longer generate invalid empty variable names
- Include more utility types: ReturnType, Partial, Required, etc.
- Type annotation fixes
- Reduce cases where maps are needlessly split off into assign statements
- Accept (but ignore) "declare function"
- Implemented Array.isArray()
- Fixes to type annotations