@effect-app/vue 4.0.0-beta.316 → 4.0.0-beta.317

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @effect-app/vue
2
2
 
3
+ ## 4.0.0-beta.317
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [186de3a]
8
+ - Updated dependencies [186de3a]
9
+ - Updated dependencies [186de3a]
10
+ - effect-app@4.0.0-beta.317
11
+
3
12
  ## 4.0.0-beta.316
4
13
 
5
14
  ### Patch Changes
@@ -0,0 +1,40 @@
1
+ # Mutation and command atoms
2
+
3
+ Keep query and cache state atom-native. Keep ordinary mutations Effect-based and wrap them in `Command` when they need UI state. Use an atom-backed mutation only when its state is itself shared application state.
4
+
5
+ ## Why
6
+
7
+ Query state is durable, keyed by handler and input, shared across components, and refreshed by invalidation. Command state usually belongs to one invocation: `waiting`, `blocked`, progress, errors, toasts, and follow-up Effects.
8
+
9
+ `makeMutation` already records invalidation keys and data-dependency writes, then awaits affected atom queries. A mutation does not need to be an atom for cache coherence.
10
+
11
+ `Command.fn` and mutation `.wrap()` add action identity, local reactive state, error handling, confirmation, toasts, and stream progress around an Effect.
12
+
13
+ ## Prefer `Command`
14
+
15
+ Use the existing Effect-based mutation path when:
16
+
17
+ - The mutation returns `void` or a small value.
18
+ - Its shared effect is query invalidation.
19
+ - Only the initiating surface needs `waiting`, `blocked`, progress, or errors.
20
+ - The result is immediately composed with validation, navigation, emitted events, or other Effects.
21
+ - Nothing must observe the invocation after that surface unmounts.
22
+
23
+ ## Prefer an atom
24
+
25
+ Use atom-backed mutation state when:
26
+
27
+ - Distant components observe the same invocation.
28
+ - State is keyed per entity and instances must be tracked independently.
29
+ - Other atoms derive from the mutation state.
30
+ - Long-running progress must survive component remounts.
31
+ - Optimistic state belongs in the same graph as the canonical entity state.
32
+
33
+ Effect provides `Atom.fn`, `AtomRuntime.fn`, and mutation helpers in `AtomRpc` and `AtomHttpApi`. These expose one `AsyncResult` state cell. Before using one as an application command, define its keying, lifetime, reset behavior, concurrency, and how individual callers receive results.
34
+
35
+ ## Recommended split
36
+
37
+ 1. Queries, entities, caches, and live projections: atoms.
38
+ 2. Cache invalidation: the existing atom-query invalidation path.
39
+ 3. Ordinary user actions: Effect-based mutations wrapped with `Command` as needed.
40
+ 4. Shared, keyed, or long-lived action state: an atom-backed command abstraction with explicit concurrency semantics.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-app/vue",
3
- "version": "4.0.0-beta.316",
3
+ "version": "4.0.0-beta.317",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -15,7 +15,7 @@
15
15
  "@vueuse/core": "^14.3.0",
16
16
  "change-case": "^5.4.4",
17
17
  "query-string": "^9.4.0",
18
- "effect-app": "4.0.0-beta.316"
18
+ "effect-app": "4.0.0-beta.317"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@effect/atom-vue": "^4.0.0-beta.107",