@effect-app/vue 4.0.0-beta.181 → 4.0.0-beta.183
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 +51 -0
- package/dist/commander.d.ts +205 -12
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +336 -24
- package/dist/makeClient.d.ts +66 -14
- package/dist/makeClient.d.ts.map +1 -1
- package/dist/makeClient.js +58 -25
- package/dist/makeUseCommand.d.ts +2 -2
- package/dist/makeUseCommand.d.ts.map +1 -1
- package/dist/makeUseCommand.js +1 -1
- package/dist/mutate.d.ts +13 -8
- package/dist/mutate.d.ts.map +1 -1
- package/dist/mutate.js +32 -12
- package/dist/query.d.ts +14 -2
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +105 -15
- package/examples/streamMutation.ts +8 -4
- package/package.json +2 -2
- package/src/commander.ts +578 -37
- package/src/makeClient.ts +143 -34
- package/src/makeUseCommand.ts +3 -1
- package/src/mutate.ts +55 -12
- package/src/query.ts +148 -24
- package/test/dist/stubs.d.ts +184 -38
- package/test/dist/stubs.d.ts.map +1 -1
- package/test/makeClient.test.ts +2 -2
- package/test/streamFinal.test.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @effect-app/vue
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.183
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8ff0bf9: Add `Command.streamFn` — a stream-backed variant of `Command.fn`.
|
|
8
|
+
|
|
9
|
+
The body generator (or plain function) returns a `Stream` instead of an `Effect`. The command's `waiting` state stays `true` while the stream is running and updates the reactive `result` ref for every emitted value.
|
|
10
|
+
|
|
11
|
+
Three handler shapes are accepted:
|
|
12
|
+
|
|
13
|
+
1. **Generator returning a Stream** (primary):
|
|
14
|
+
```ts
|
|
15
|
+
Command.streamFn("exportData")(function* (arg, ctx) {
|
|
16
|
+
const token = yield* getAuthToken;
|
|
17
|
+
return Stream.fromEffect(startExport(token, arg.id)).pipe(
|
|
18
|
+
Stream.flatMap((job) => pollProgress(job.id))
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
2. Function returning a `Stream` directly.
|
|
23
|
+
3. Function returning `Effect<Stream>` (unwrapped automatically).
|
|
24
|
+
|
|
25
|
+
- 8ff0bf9: - `CommandButton`: add optional `:map-progress` prop to compute progress from `command.result` via a custom mapper function
|
|
26
|
+
- `CommandBase`: add optional `result` field exposing reactive `AsyncResult` state
|
|
27
|
+
- Export `Progress` type from `@effect-app/vue`
|
|
28
|
+
- `streamFn`: pipe operators now receive the initial `Effect<Stream>` (or `Stream`) value unchanged; `Stream.unwrap` is deferred until after all combinators, enabling use of `withDefaultToast` and other Effect-level combinators
|
|
29
|
+
- Add `makeStreamMutation2`: like `makeStreamMutation` but returns `Effect<Stream>` per invocation (with invalidation via `Stream.ensuring`), for use with `streamFn` combinators
|
|
30
|
+
- Expose `streamFn` on `XClient.Y` stream handlers and on the `Command` object
|
|
31
|
+
- Expose `mutateStream2` on `XClient.Y` stream handlers, with a `wrapStream` helper that calls `streamFn` with the handler and provided combinators
|
|
32
|
+
- fc98fb7: Add `streamQuery` support for stream-type Rpc handlers. When an Rpc is of type `"stream"`, the client now exposes a `.streamQuery` property (and `...StreamQuery` in helpers) that uses `streamedQuery` from `@tanstack/query-core` to accumulate chunks reactively as an `AsyncResult<A[], E>`.
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- effect-app@4.0.0-beta.183
|
|
37
|
+
|
|
38
|
+
## 4.0.0-beta.182
|
|
39
|
+
|
|
40
|
+
### Minor Changes
|
|
41
|
+
|
|
42
|
+
- b9586f8: Refine `mutateStream` shape and progress reporting.
|
|
43
|
+
|
|
44
|
+
- `mutateStream(options?)` now returns the `execute` callable directly, with `id`, `running?`, and `progress?` attached as properties. Tuple form `[ref, execute]` is gone — invoke the callable to run the stream, or pass it (or the factory) to `Command.fn` / `Command.wrap` / `Command.wrapStream`.
|
|
45
|
+
- `progress` formatter return type widened from `string | undefined` to `Progress | undefined`, where `Progress = string | { text: string; percentage: number }`.
|
|
46
|
+
- Stream failures now bubble through the execute effect's typed error channel `E` instead of being swallowed. The reactive `AsyncResult` ref still mirrors the failure for live progress UI.
|
|
47
|
+
- `CommandBase.progress?: Progress` replaces `progressText?: string`. `CommandButton` overrides the Vuetify `loader` slot when `progress` is set, rendering a `v-progress-circular` (bound to `model-value` when a `percentage` is supplied, otherwise `indeterminate`) alongside the formatted text.
|
|
48
|
+
- Factories and callables are branded with `_streamFactory` / `_streamCallable` so `Command.fn` / `Command.wrap` can disambiguate them from plain mutate functions.
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- effect-app@4.0.0-beta.182
|
|
53
|
+
|
|
3
54
|
## 4.0.0-beta.181
|
|
4
55
|
|
|
5
56
|
### Minor Changes
|