@requence/task 0.8.2-edge.1191 → 0.8.3-edge.1197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @requence/task
|
|
2
2
|
|
|
3
|
+
## 0.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 621b48b: A callback that carries no data is now called with no argument:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
await context.input.mail.delete();
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The `null` it used to need was never the caller's to write. It is how the
|
|
14
|
+
**output schema** spells "this position carries nothing": `RequenceCallback<void>`
|
|
15
|
+
compiles to nothing typescript-json-schema has a root type for, and
|
|
16
|
+
`RequenceCallback<undefined>` compiles but silently drops the `callback` marker
|
|
17
|
+
along with the argument — so `RequenceCallback<null>` is the only declaration
|
|
18
|
+
available, and every call site paid for that. A callback that does carry data is
|
|
19
|
+
untouched, and a forgotten argument is still an error.
|
|
20
|
+
|
|
21
|
+
`RequenceCallback<T>` makes the argument optional exactly when `null extends T`,
|
|
22
|
+
through a conditional **tuple**: a conditional on the parameter type alone cannot
|
|
23
|
+
change the ARITY, and the arity is the whole point. Writing the `null` out still
|
|
24
|
+
works and still means the same thing.
|
|
25
|
+
|
|
26
|
+
Optionality at the call site is not enough by itself. The operator validates
|
|
27
|
+
every invocation against the callback's declared argument schema, which for this
|
|
28
|
+
kind of callback is `{ type: 'null' }` — so both reconstruction sites, the
|
|
29
|
+
`deserialize` in `@requence/callbacks` and its Python mirror, default an omitted
|
|
30
|
+
argument to `null` rather than letting `undefined` reach the wire. That default
|
|
31
|
+
is unconditional: a boundary holds a reference, never the emitting node's output
|
|
32
|
+
schema, and a callback that DOES declare data fails the same validation either
|
|
33
|
+
way — turning `undefined` into `null` there only changes which of the two it is
|
|
34
|
+
refused as.
|
|
35
|
+
|
|
36
|
+
The declaration is written out four times — `@requence/helpers` for both SDKs,
|
|
37
|
+
`RequenceTypes.ts` for the logic-node editor, and the two assignability
|
|
38
|
+
harnesses. The fifth copy, in `createJsonSchema.ts`, is deliberately an object
|
|
39
|
+
shape with no call signature and does not move with them. The editor's copy is
|
|
40
|
+
now asserted through the real language service, since it is the one that decides
|
|
41
|
+
whether a script compiles.
|
|
42
|
+
|
|
3
43
|
## 0.8.1
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|