@systemfsoftware/effect-atom-react 0.5.0 → 0.7.0

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.
Files changed (2) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/package.json +6 -6
package/CHANGELOG.md ADDED
@@ -0,0 +1,133 @@
1
+ # @systemfsoftware/effect-atom-react
2
+
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Harden the v4 fork: Effect-native hydration, zero `as any` casts, browser-mode tests.
8
+
9
+ Breaking changes:
10
+
11
+ - `Hydration.DehydratedAtomValue.resultPromise?: Promise<unknown>` is now `result?: Deferred<unknown>` — the pending-value channel is Effect-native, and `hydrate` returns a `Fiber<void, never>` that completes once every pending result has been applied (join it for deterministic SSR flushes and tests).
12
+ - `Hydration.dehydrate`'s `encodeInitialAs: 'promise'` is now `'deferred'`, `dehydrate` returns `Array<DehydratedAtomValue>` directly, and `Hydration.toValues` is removed.
13
+ - `Registry.setSerializable` now applies to an already-materialized node as well as preloading absent ones.
14
+ - `ScopedAtom.Context` is typed `React.Context<A | undefined>` to match runtime.
15
+ - `useAtom`/`useAtomSet` `mode: 'promise'` and `mode: 'promiseExit'` are gone; the single `mode: 'effect'` returns a lazy `(value) => Effect<A, E>` instead of an eager `Promise`, so callers run the result with `Effect.runPromise`/`yield*` and no raw `Promise` remains on the public surface.
16
+
17
+ Additions:
18
+
19
+ - `Registry.setInitialValue(atom, value)` — typed initial-value seeding (also used by `useAtomInitialValues`).
20
+ - `Result.Schema` now carries a `toArbitrary` hook, so `Schema.toArbitrary` works for property tests; its generated space is the wire-representable subset (no `undefined` defects, which the JSON codec cannot carry).
21
+
22
+ Internal:
23
+
24
+ - Every `as any` / `as unknown as` cast removed from both packages' `src` (Registry, Result, Atom, AtomRef, AtomRpc, AtomHttpApi, Hooks, RegistryContext, ScopedAtom); oxlint `correctness` and `perf` categories now gate as errors.
25
+ - `atom-react` tests run in Vitest browser mode (playwright chromium) with `expect.element` assertions; jest-dom and jsdom are gone. Consumers running these tests need `playwright install chromium`.
26
+ - Fixed a zombie-notification defect: an item removed from an `AtomRef.collection` no longer notifies the collection when mutated.
27
+
28
+ - Port both packages onto the effect v4 release candidate (`effect@4.0.0-rc.108`,
29
+ resolved from the `effect4` catalog). The `src/` is now the v4 reactivity API:
30
+ absorbed packages (`@effect/experimental`, `@effect/platform`, `@effect/rpc`)
31
+ are gone — their modules now live under `effect/unstable/*` and the core `effect`
32
+ barrel — and every removed/renamed v3 symbol is replaced (`Effect.async`→
33
+ `callback`, `Context.Tag`→`Context.Service`, `Runtime<R>`→`Runtime`, `Cause`
34
+ error renames, `Schema.decodeEither`→`decodeExit`, the `Mailbox`/`Subscribable`/
35
+ `GlobalValue`/`FiberId` modules). **Breaking:** the `effect` peer dependency is
36
+ now `4.0.0-rc.x`; consumers must move to effect v4.
37
+
38
+ Breaking changes:
39
+
40
+ - `Registry.isRegistry` is renamed `isAtomRegistry`.
41
+ - The read-context type `Atom.Context` is renamed `Atom.AtomContext`; `defaultMemoMap` and `KvsError` are removed.
42
+ - `Result.toExitAsEffect`, `Result.schemaFromSelf`, `Result.PartialEncoded`, and `Result.Encoded` are removed (use `Result.toExit` + `Effect.exit` and `Result.Schema`).
43
+ - `Atom.make(stream)`/`Atom.fn(stream)` widen the atom's error channel with `Cause.NoSuchElementError`.
44
+ - `Registry.make`/`Registry.layerOptions` and `RegistryProvider` take a changed `scheduleTask` option signature.
45
+ - `@systemfsoftware/effect-atom-react` no longer re-exports the atom package's namespaces (`Atom`, `Registry`, `Result`, `AtomRef`, `AtomHttpApi`, `AtomRpc`, `Hydration`, `ScopedAtom`) from its root — those modules are not browser-safe, and the react entry is browser-tested. Import them from `@systemfsoftware/effect-atom` directly.
46
+ - Runtime type markers `Atom.TypeId`/`WritableTypeId`/`AtomRef.TypeId` moved to `~effect/reactivity/*`; the wire `SerializableTypeId` (`~effect-atom/atom/Atom/Serializable`) is unchanged, so `Hydration` payload keys are stable.
47
+
48
+ - cut over to effect v4 (4.0.0-rc.108): public surface derives from effect types; peers flip effect ^3→^4
49
+
50
+ ### Patch Changes
51
+
52
+ - Array types are spelled one way. `Array<T>` and `ReadonlyArray<T>` in emitted
53
+ declarations become `T[]` and `readonly T[]`, which the type checker cannot tell
54
+ apart: no exported type changes, only how it is written.
55
+
56
+ - New version is published through npm trusted publishing, so it carries a provenance attestation you can verify.
57
+
58
+ - The `atom` packages publish their own author rather than crediting an upstream they are not downstream of, and `stryker-plugins` no longer pulls Node's ambient types into a package that has no runtime dependency on them.
59
+
60
+ - Each of these packages now has a README, so its registry page says what the package is, how
61
+ to install it, and what to import or register — previously the page was blank. The lint
62
+ plugins show the configuration line that enables what they recommend.
63
+
64
+ `@systemfsoftware/stryker-js-mutation-report` also carries its licence text
65
+
66
+ - Updated dependencies:
67
+ - @systemfsoftware/effect-atom@2.0.0
68
+
69
+ ## 0.6.0
70
+
71
+ ### Minor Changes
72
+
73
+ - Harden the v4 fork: Effect-native hydration, zero `as any` casts, browser-mode tests.
74
+
75
+ Breaking changes:
76
+
77
+ - `Hydration.DehydratedAtomValue.resultPromise?: Promise<unknown>` is now `result?: Deferred<unknown>` — the pending-value channel is Effect-native, and `hydrate` returns a `Fiber<void, never>` that completes once every pending result has been applied (join it for deterministic SSR flushes and tests).
78
+ - `Hydration.dehydrate`'s `encodeInitialAs: 'promise'` is now `'deferred'`, `dehydrate` returns `Array<DehydratedAtomValue>` directly, and `Hydration.toValues` is removed.
79
+ - `Registry.setSerializable` now applies to an already-materialized node as well as preloading absent ones.
80
+ - `ScopedAtom.Context` is typed `React.Context<A | undefined>` to match runtime.
81
+ - `useAtom`/`useAtomSet` `mode: 'promise'` and `mode: 'promiseExit'` are gone; the single `mode: 'effect'` returns a lazy `(value) => Effect<A, E>` instead of an eager `Promise`, so callers run the result with `Effect.runPromise`/`yield*` and no raw `Promise` remains on the public surface.
82
+
83
+ Additions:
84
+
85
+ - `Registry.setInitialValue(atom, value)` — typed initial-value seeding (also used by `useAtomInitialValues`).
86
+ - `Result.Schema` now carries a `toArbitrary` hook, so `Schema.toArbitrary` works for property tests; its generated space is the wire-representable subset (no `undefined` defects, which the JSON codec cannot carry).
87
+
88
+ Internal:
89
+
90
+ - Every `as any` / `as unknown as` cast removed from both packages' `src` (Registry, Result, Atom, AtomRef, AtomRpc, AtomHttpApi, Hooks, RegistryContext, ScopedAtom); oxlint `correctness` and `perf` categories now gate as errors.
91
+ - `atom-react` tests run in Vitest browser mode (playwright chromium) with `expect.element` assertions; jest-dom and jsdom are gone. Consumers running these tests need `playwright install chromium`.
92
+ - Fixed a zombie-notification defect: an item removed from an `AtomRef.collection` no longer notifies the collection when mutated.
93
+
94
+ - Port both packages onto the effect v4 release candidate (`effect@4.0.0-rc.108`,
95
+ resolved from the `effect4` catalog). The `src/` is now the v4 reactivity API:
96
+ absorbed packages (`@effect/experimental`, `@effect/platform`, `@effect/rpc`)
97
+ are gone — their modules now live under `effect/unstable/*` and the core `effect`
98
+ barrel — and every removed/renamed v3 symbol is replaced (`Effect.async`→
99
+ `callback`, `Context.Tag`→`Context.Service`, `Runtime<R>`→`Runtime`, `Cause`
100
+ error renames, `Schema.decodeEither`→`decodeExit`, the `Mailbox`/`Subscribable`/
101
+ `GlobalValue`/`FiberId` modules). **Breaking:** the `effect` peer dependency is
102
+ now `4.0.0-rc.x`; consumers must move to effect v4.
103
+
104
+ Breaking changes:
105
+
106
+ - `Registry.isRegistry` is renamed `isAtomRegistry`.
107
+ - The read-context type `Atom.Context` is renamed `Atom.AtomContext`; `defaultMemoMap` and `KvsError` are removed.
108
+ - `Result.toExitAsEffect`, `Result.schemaFromSelf`, `Result.PartialEncoded`, and `Result.Encoded` are removed (use `Result.toExit` + `Effect.exit` and `Result.Schema`).
109
+ - `Atom.make(stream)`/`Atom.fn(stream)` widen the atom's error channel with `Cause.NoSuchElementError`.
110
+ - `Registry.make`/`Registry.layerOptions` and `RegistryProvider` take a changed `scheduleTask` option signature.
111
+ - `@systemfsoftware/effect-atom-react` no longer re-exports the atom package's namespaces (`Atom`, `Registry`, `Result`, `AtomRef`, `AtomHttpApi`, `AtomRpc`, `Hydration`, `ScopedAtom`) from its root — those modules are not browser-safe, and the react entry is browser-tested. Import them from `@systemfsoftware/effect-atom` directly.
112
+ - Runtime type markers `Atom.TypeId`/`WritableTypeId`/`AtomRef.TypeId` moved to `~effect/reactivity/*`; the wire `SerializableTypeId` (`~effect-atom/atom/Atom/Serializable`) is unchanged, so `Hydration` payload keys are stable.
113
+
114
+ - cut over to effect v4 (4.0.0-rc.108): public surface derives from effect types; peers flip effect ^3→^4
115
+
116
+ ### Patch Changes
117
+
118
+ - Array types are spelled one way. `Array<T>` and `ReadonlyArray<T>` in emitted
119
+ declarations become `T[]` and `readonly T[]`, which the type checker cannot tell
120
+ apart: no exported type changes, only how it is written.
121
+
122
+ - New version is published through npm trusted publishing, so it carries a provenance attestation you can verify.
123
+
124
+ - The `atom` packages publish their own author rather than crediting an upstream they are not downstream of, and `stryker-plugins` no longer pulls Node's ambient types into a package that has no runtime dependency on them.
125
+
126
+ - Each of these packages now has a README, so its registry page says what the package is, how
127
+ to install it, and what to import or register — previously the page was blank. The lint
128
+ plugins show the configuration line that enables what they recommend.
129
+
130
+ `@systemfsoftware/stryker-js-mutation-report` also carries its licence text
131
+
132
+ - Updated dependencies:
133
+ - @systemfsoftware/effect-atom@1.0.0
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@systemfsoftware/effect-atom-react",
3
3
  "license": "Apache-2.0",
4
- "version": "0.5.0",
4
+ "version": "0.7.0",
5
5
  "author": "Ryan Lee <drdgvhbh@gmail.com>",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/systemfsoftware/systemfsoftware.git",
9
- "directory": "packages/effect-atom/atom-react"
9
+ "directory": "packages/core/effect/atom/atom-react"
10
10
  },
11
- "homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/effect-atom/atom-react#readme",
11
+ "homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/core/effect/atom/atom-react#readme",
12
12
  "bugs": "https://github.com/systemfsoftware/systemfsoftware/issues",
13
13
  "description": "React bindings for effect-atom — forked under systemfsoftware from tim-smart/effect-atom.",
14
14
  "keywords": [
@@ -31,7 +31,7 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@systemfsoftware/effect-atom": "^0.5.3"
34
+ "@systemfsoftware/effect-atom": "^2.0.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "effect": "4.0.0-rc.108",
@@ -62,10 +62,10 @@
62
62
  "tsdown": "^0.22.14",
63
63
  "typescript": "^7",
64
64
  "vitest": "^4.1.10",
65
+ "@systemfsoftware/effect-gherkin-spec": "^2.0.0",
65
66
  "@systemfsoftware/oxlint-config": "^0.1.0",
66
- "@systemfsoftware/tsconfig": "^1.3.1",
67
67
  "@systemfsoftware/vitest-config": "^0.1.0",
68
- "@systemfsoftware/effect-gherkin-spec": "^0.5.1"
68
+ "@systemfsoftware/tsconfig": "^1.3.3"
69
69
  },
70
70
  "publishConfig": {
71
71
  "provenance": true