@shivaedev/effect-contract 0.7.0 → 0.9.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.
- package/CHANGELOG.md +27 -0
- package/README.md +45 -26
- package/dist/automaticLive.d.ts +3 -0
- package/dist/automaticLive.d.ts.map +1 -1
- package/dist/automaticLive.js.map +1 -1
- package/dist/bind.d.ts.map +1 -1
- package/dist/bind.js +3 -1
- package/dist/bind.js.map +1 -1
- package/dist/contract.d.ts +3 -2
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js.map +1 -1
- package/dist/internal/liveInvalidation.d.ts +12 -0
- package/dist/internal/liveInvalidation.d.ts.map +1 -0
- package/dist/internal/liveInvalidation.js +14 -0
- package/dist/internal/liveInvalidation.js.map +1 -0
- package/dist/internal/makeHintPolicy.d.ts +4 -0
- package/dist/internal/makeHintPolicy.d.ts.map +1 -0
- package/dist/internal/makeHintPolicy.js +25 -0
- package/dist/internal/makeHintPolicy.js.map +1 -0
- package/dist/internal/queryReactivity.d.ts +4 -0
- package/dist/internal/queryReactivity.d.ts.map +1 -0
- package/dist/internal/queryReactivity.js +92 -0
- package/dist/internal/queryReactivity.js.map +1 -0
- package/dist/live.d.ts +3 -1
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +38 -3
- package/dist/live.js.map +1 -1
- package/dist/makeLiveServer.d.ts.map +1 -1
- package/dist/makeLiveServer.js +3 -3
- package/dist/makeLiveServer.js.map +1 -1
- package/dist/queryCoalesceWindow.d.ts +4 -0
- package/dist/queryCoalesceWindow.d.ts.map +1 -0
- package/dist/queryCoalesceWindow.js +11 -0
- package/dist/queryCoalesceWindow.js.map +1 -0
- package/dist/readPolicy.d.ts +5 -4
- package/dist/readPolicy.d.ts.map +1 -1
- package/dist/readPolicy.js +3 -0
- package/dist/readPolicy.js.map +1 -1
- package/package.json +5 -3
- package/src/automaticLive.ts +6 -2
- package/src/bind.ts +3 -1
- package/src/contract.ts +8 -2
- package/src/internal/liveInvalidation.ts +21 -0
- package/src/internal/makeHintPolicy.ts +40 -0
- package/src/internal/queryReactivity.ts +99 -0
- package/src/live.ts +39 -3
- package/src/makeLiveServer.ts +5 -3
- package/src/queryCoalesceWindow.ts +13 -0
- package/src/readPolicy.ts +8 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0 - 2026-10-19
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Contracts include their reserved `<namespace>.$changes` stream in native RPC client types, with the same middleware as declared operations. Subscribe through a client typed from the contract without a cast or a separate Changes group.
|
|
8
|
+
|
|
9
|
+
### Breaking
|
|
10
|
+
|
|
11
|
+
- Native contract handler builders now require the reserved `$changes` handler. When a Platform host supplies it, build application handlers with `contract.omit("<namespace>.$changes").of(...)` and `.toLayer(...)`, while retaining the full contract for the host and client. Standalone servers and test clients must supply a changes stream handler. Remove hand-built Changes groups and use the contract directly.
|
|
12
|
+
|
|
13
|
+
## 0.8.0 - 2026-10-19
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `authorizeReads` accepts typed policy failures and preserves them in the query's error channel. Declare those errors in the native RPC middleware's error schema alongside its denial so clients can distinguish an outage from denied access.
|
|
18
|
+
- `ReadPolicyMemoWindow`, a `Context.Reference<Duration.Input>`, configures per-subscription, per-key memoisation of successful policy results. The default is one second; provide a shorter duration or `0` to disable it. Queries always check afresh, and failures are never memoised.
|
|
19
|
+
- Coalesce live changed hints over a default 20 ms window, with one follow-up read when hints arrive during an in-flight refetch. Configure `live()` with `coalesceWindow`, or set its returned `coalesceWindow` atom; zero retains immediate invalidation. Reconciliation stays immediate.
|
|
20
|
+
- Configure automatic live connections per React `SessionBoundary` with `liveCoalesceWindow`.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Failed live hint checks omit the affected keys and keep the stream open. Scoped rechecks after one second deliver an allowed key after recovery without another change or reconnect; a `false` does not schedule a recheck.
|
|
25
|
+
|
|
26
|
+
### Breaking
|
|
27
|
+
|
|
28
|
+
- Direct readers of `ReadPolicy` now receive `Effect<boolean, unknown>` instead of an infallible Effect. Handle its error channel when invoking the reference directly. Existing infallible policies passed to `authorizeReads` still work; fallible policies should declare their errors in their RPC middleware schema.
|
|
29
|
+
|
|
3
30
|
## 0.7.0 - 2026-10-19
|
|
4
31
|
|
|
5
32
|
### Added
|
package/README.md
CHANGED
|
@@ -105,7 +105,7 @@ const missing = Get.reject.NoteMissing({ id: 9 });
|
|
|
105
105
|
Implement the contract with native `of` and `toLayer`:
|
|
106
106
|
|
|
107
107
|
```ts
|
|
108
|
-
import { Effect, Ref } from "effect";
|
|
108
|
+
import { Effect, Ref, Stream } from "effect";
|
|
109
109
|
import { Create, Get, Note, Notes, Rename } from "./notes.ts";
|
|
110
110
|
|
|
111
111
|
export const NotesHandlers = Notes.toLayer(Effect.gen(function* () {
|
|
@@ -119,6 +119,7 @@ export const NotesHandlers = Notes.toLayer(Effect.gen(function* () {
|
|
|
119
119
|
});
|
|
120
120
|
const save = (note: Note) => Ref.update(stored, (all) => new Map([...all, [note.id, note]])).pipe(Effect.as(note));
|
|
121
121
|
return Notes.of({
|
|
122
|
+
"notes.$changes": () => Stream.never,
|
|
122
123
|
"notes.get": ({ id }) => find(id),
|
|
123
124
|
"notes.list": () => Effect.map(Ref.get(stored), (all) => [...all.values()]),
|
|
124
125
|
"notes.rename": ({ id, title }) => title.trim() === ""
|
|
@@ -131,7 +132,7 @@ export const NotesHandlers = Notes.toLayer(Effect.gen(function* () {
|
|
|
131
132
|
}));
|
|
132
133
|
```
|
|
133
134
|
|
|
134
|
-
Save this module as `handlers.ts`. An application can put repository and service calls in these handlers. The contract checks handler result and rejection types; it does not implement persistence, authorization or transactions.
|
|
135
|
+
Save this module as `handlers.ts`. An application can put repository and service calls in these handlers. The contract checks handler result and rejection types; it does not implement persistence, authorization or transactions. This in-memory server keeps the reserved change stream open without publishing hints. When a Platform host supplies that handler, build application handlers from `Notes.omit("notes.$changes")` and keep `Notes` as the host and client group.
|
|
135
136
|
|
|
136
137
|
Native `.middleware(M)` returns a contract that retains its declarations. For example, a native middleware service can supply request identity:
|
|
137
138
|
|
|
@@ -191,6 +192,8 @@ const readOnce = api.get.run({ id: 1 });
|
|
|
191
192
|
const rename = api.rename.run({ id: 1, title: "Uno" });
|
|
192
193
|
```
|
|
193
194
|
|
|
195
|
+
`queryCoalesceWindow(query)` from `@shivaedev/effect-contract/queryCoalesceWindow.ts` returns a writable native atom for that bound query's live changed-hint window. Set it through the query's registry to a Duration, or `undefined` to use the live connection's default. Changing it does not refetch or reconnect; the next window uses the new value. React consumers can set it with `useQuery(query, { coalesceWindow: "2 seconds" })`.
|
|
196
|
+
|
|
194
197
|
`one` and `list` are native query atoms. `readOnce` and `rename` are Effects for individual calls. A query's Effect requires `NotesClient`; a command's Effect also requires native `Reactivity`. Commands expose `run`, and have no `query` member.
|
|
195
198
|
|
|
196
199
|
Mount the atoms and run commands through the service's atom runtime in the same registry:
|
|
@@ -232,36 +235,37 @@ Client invalidation follows RPC success. Platform database hosts also publish de
|
|
|
232
235
|
|
|
233
236
|
Platform database hosts serve the contract's reserved `<contract>.$changes` stream automatically. With NDJSON transport, `bind` and a React `SessionBoundary` connect query atoms without an application subscribe operation or `live()` call. The boundary finds bound APIs returned directly by `connect` or as properties such as `client.api`. See [automatic changes](https://github.com/ShivaeDev/platform/blob/main/docs/framework/changes.md) for defaults.
|
|
234
237
|
|
|
238
|
+
For a direct subscription, configure the server and `NotesClient` with `RpcSerialization.layerNdjson` and use the client already typed from `Notes`:
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
import { Effect, Stream } from "effect";
|
|
242
|
+
import { NotesClient } from "./client.ts";
|
|
243
|
+
import { notes } from "./notes.ts";
|
|
244
|
+
|
|
245
|
+
const changes = Stream.unwrap(NotesClient.use((client) =>
|
|
246
|
+
Effect.succeed(client("notes.$changes", { keys: [notes.item(1)] })),
|
|
247
|
+
));
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
The contract includes the reserved stream's payload, `LiveHint` elements and middleware failures in its native RPC type. The subscription uses the contract's middleware and needs no separate RPC group or cast. The caller owns stream consumption and interruption.
|
|
251
|
+
|
|
235
252
|
For a custom transport or explicit pause/status controls, the native live APIs remain available:
|
|
236
253
|
|
|
237
254
|
Declare subscriptions with `stream` in the same contract. Its `success` schema describes each element, and its `rejections` become the native stream error schema. `bind` exposes `run(payload)` as a native `Stream`, preserving declared rejections, middleware errors and RPC client errors. Completion and client interruption release the server subscription. The compiler rejects a unary client for a streaming operation.
|
|
238
255
|
|
|
239
|
-
|
|
256
|
+
Each item query reads its own item key, and each list query reads its list key. Commands invalidate the keys they change; an item invalidation also refreshes its collection list. Reuse the feature's `Get`, `List`, `Rename` and `Create` declarations:
|
|
240
257
|
|
|
241
258
|
```ts
|
|
242
|
-
import { Schema } from "effect";
|
|
243
259
|
import { contract } from "@shivaedev/effect-contract/contract.ts";
|
|
244
|
-
import { collection } from "@shivaedev/effect-contract/keys.ts";
|
|
245
260
|
import { LiveHint } from "@shivaedev/effect-contract/live.ts";
|
|
246
|
-
import {
|
|
261
|
+
import { stream } from "@shivaedev/effect-contract/operation.ts";
|
|
247
262
|
import { Create, Get, List, notes, Rename } from "./notes.ts";
|
|
248
263
|
|
|
249
|
-
export const
|
|
250
|
-
const
|
|
251
|
-
payload: Get.payload,
|
|
252
|
-
success: Get.success,
|
|
253
|
-
rejections: Get.rejections,
|
|
254
|
-
reads: ({ id }) => [notes.item(id), workspace.list],
|
|
255
|
-
});
|
|
256
|
-
const LiveList = query("list", {
|
|
257
|
-
success: List.success,
|
|
258
|
-
reads: () => [notes.list, workspace.list],
|
|
259
|
-
});
|
|
260
|
-
export const Subscribe = stream("subscribe", { reads: () => [workspace.list], success: LiveHint });
|
|
261
|
-
export const LiveNotes = contract("notes", { queries: [LiveGet, LiveList], commands: [Rename, Create], streams: [Subscribe] });
|
|
264
|
+
export const Subscribe = stream("subscribe", { reads: () => [notes.list], success: LiveHint });
|
|
265
|
+
export const LiveNotes = contract("notes", { queries: [Get, List], commands: [Rename, Create], streams: [Subscribe] });
|
|
262
266
|
```
|
|
263
267
|
|
|
264
|
-
Save the shared module as `live-notes.ts`.
|
|
268
|
+
Save the shared module as `live-notes.ts`. Keep full reconciliation in the session's explicit `resyncKeys`: enumerate the item keys the session reads and its list keys. A list key alone does not cover separately registered item queries. Having every query read a broad shared key makes every invalidation of that key refetch them all.
|
|
265
269
|
|
|
266
270
|
Use `LiveNotes` as the server group and implement `notes.subscribe` with a native Stream. For streaming HTTP, use `RpcSerialization.layerNdjson` on both sides. This client mounts live coordination alongside its queries:
|
|
267
271
|
|
|
@@ -274,7 +278,8 @@ import { RpcClient, RpcSerialization } from "effect/rpc";
|
|
|
274
278
|
import { bind } from "@shivaedev/effect-contract/bind.ts";
|
|
275
279
|
import { live } from "@shivaedev/effect-contract/live.ts";
|
|
276
280
|
import { resumeSignal } from "@shivaedev/effect-contract/resume.ts";
|
|
277
|
-
import { LiveNotes
|
|
281
|
+
import { LiveNotes } from "./live-notes.ts";
|
|
282
|
+
import { notes } from "./notes.ts";
|
|
278
283
|
|
|
279
284
|
class Client extends AtomRpc.Service<Client>()("app/LiveNotes", {
|
|
280
285
|
group: LiveNotes,
|
|
@@ -286,7 +291,7 @@ const api = bind(LiveNotes, Client);
|
|
|
286
291
|
const registry = AtomRegistry.make();
|
|
287
292
|
const updates = live(Client.runtime, {
|
|
288
293
|
stream: api.subscribe.run(undefined),
|
|
289
|
-
resyncKeys:
|
|
294
|
+
resyncKeys: [notes.item(1), notes.item(2), notes.list],
|
|
290
295
|
resume: resumeSignal({ window }),
|
|
291
296
|
retryDelay: "100 millis",
|
|
292
297
|
});
|
|
@@ -294,7 +299,7 @@ const releaseQuery = registry.mount(api.get.query({ id: 1 }));
|
|
|
294
299
|
const releaseConnection = registry.mount(updates.connection);
|
|
295
300
|
```
|
|
296
301
|
|
|
297
|
-
`LiveNotes` supplies both the declaration for binding and the native RPC group for transport. Stream read keys describe its dependencies; `run` does not mount query atoms or trigger automatic invalidation. Here the caller
|
|
302
|
+
`LiveNotes` supplies both the declaration for binding and the native RPC group for transport. Stream read keys describe its dependencies; `run` does not mount query atoms or trigger automatic invalidation. Here the caller explicitly reconciles two items and their list. `bind` also accepts a larger native client group that preserves the contract RPC types. The [live updates guide](https://github.com/ShivaeDev/platform/blob/main/docs/framework/live-updates.md) shows server and client composition, and the [HTTP fixture](https://github.com/ShivaeDev/platform/tree/main/packages/effect-contract/src/test-support/live) supplies a complete working server.
|
|
298
303
|
|
|
299
304
|
| Observation | Invalidation |
|
|
300
305
|
| --- | --- |
|
|
@@ -302,6 +307,8 @@ const releaseConnection = registry.mount(updates.connection);
|
|
|
302
307
|
| `Resync` | The exact `resyncKeys` read scope. |
|
|
303
308
|
| First hint on a new or reconnected stream | The full explicit scope, even if the hint is targeted. |
|
|
304
309
|
|
|
310
|
+
Changed hints share a fixed 20 ms window by default. Their keys merge, and each affected bound query refetches once per window. A bound query already fetching keeps its request and refetches once more after it settles if further hints arrive. Set `coalesceWindow` in `live()` to a native Duration, or set `SessionBoundary`'s `liveCoalesceWindow` for automatic session connections. Zero restores immediate per-hint invalidation, including interruption of in-flight reads. Full reconciliation on first hint, reconnect, resume and unpause stays immediate. Registry teardown cancels a pending window.
|
|
311
|
+
|
|
305
312
|
`LiveHint` and `Key` are schemas. Decoding rejects unknown hint tags and item keys with an invalid ID type.
|
|
306
313
|
|
|
307
314
|
```ts
|
|
@@ -342,10 +349,22 @@ const guard = Layer.succeed(Guard, (effect, request) =>
|
|
|
342
349
|
);
|
|
343
350
|
```
|
|
344
351
|
|
|
345
|
-
The application supplies `resolveSession`, `canRead` and its middleware's `Denied` failure. Apply this middleware to the contract, including its reserved change stream. The policy returns
|
|
352
|
+
The application supplies `resolveSession`, `canRead` and its middleware's `Denied` failure. Apply this middleware to the contract, including its reserved change stream. The policy returns `Effect<boolean, PolicyError, PolicyServices>` for a key. `authorizeReads` checks every declared query read key before running its handler and supplies the same policy to `makeLiveServer` streams, with the request's Effect context. Queries need no additional authorization declaration. A `false` returns the supplied denial; a failed policy returns its original typed error. Declare policy errors alongside the denial in the native middleware's error schema so they reach the client, for example `error: Schema.Union([Denied, GitHubUnavailable])`.
|
|
346
353
|
|
|
347
354
|
Each changed hint checks its keys against that viewer's policy before delivery and omits denied keys. An empty hint is suppressed. Item and list keys are checked independently: allow a list key when the viewer may read that list, even when a changed item is private to another viewer. The list query still selects its visible rows. Without a supplied `ReadPolicy`, streams keep the default of allowing their subscribed keys; applications own the policy.
|
|
348
355
|
|
|
356
|
+
A failed hint check omits that key without ending the stream. The subscription rechecks failed keys after one second and repeats while checks fail. Once allowed, the key reaches the existing consumer even without another change or a reconnect. A `false` does not schedule a recheck. Interruption of the subscription stops its pending rechecks.
|
|
357
|
+
|
|
358
|
+
Successful boolean results are memoised per subscription stream and key for one second by default, including `false`; failures are never memoised. Queries always run their policy afresh. The memo holds at most the subscription's key count. It can delay filtering a revoked key from hints by at most that window; hints contain keys, and the subsequent query still checks current access before returning data. Set `ReadPolicyMemoWindow` around the request effect to shorten the window or use `0` to turn memoisation off:
|
|
359
|
+
|
|
360
|
+
```ts
|
|
361
|
+
import { ReadPolicyMemoWindow } from "@shivaedev/effect-contract/readPolicy.ts";
|
|
362
|
+
|
|
363
|
+
authorizeReads(effect, request, canRead, Effect.fail(new Denied())).pipe(
|
|
364
|
+
Effect.provideService(ReadPolicyMemoWindow, "100 millis"),
|
|
365
|
+
);
|
|
366
|
+
```
|
|
367
|
+
|
|
349
368
|
### API by module
|
|
350
369
|
|
|
351
370
|
Import the module that defines the name; the package has no root entry.
|
|
@@ -357,9 +376,9 @@ Import the module that defines the name; the package has no root entry.
|
|
|
357
376
|
| `rejection.ts` | `fieldRejection(struct, fields?)`; lower-level `rejectionSet(specs)`, which constructs the rejection classes, union schema and failure helpers used by operations. |
|
|
358
377
|
| `keys.ts` | `collection(name, idSchema)`; `Key` schema; `readKeys(keys)` and `invalidationKeys(keys)`. |
|
|
359
378
|
| `bind.ts` | `bind(contract, atomRpcService)`, exposing `{ query, run }` for queries, `{ run }` Effects for commands and `{ run }` native Streams for streams. |
|
|
360
|
-
| `live.ts` | `LiveHint` schema; `live(runtime, { stream, resyncKeys, resume?, retryDelay? })`, exposing `connection`, `paused` and `status`. |
|
|
379
|
+
| `live.ts` | `LiveHint` schema; `live(runtime, { stream, resyncKeys, coalesceWindow?, resume?, retryDelay? })`, exposing `connection`, `coalesceWindow`, `paused` and `status`. |
|
|
361
380
|
| `makeLiveServer.ts` | `makeLiveServer`, an Effect requiring `Reactivity` that creates scoped server hint streams and a `resync` Effect. |
|
|
362
|
-
| `readPolicy.ts` | `authorizeReads(effect, request, policy, denied)`; `ReadPolicy`, the request-local key policy used by server hint streams. |
|
|
381
|
+
| `readPolicy.ts` | `authorizeReads(effect, request, policy, denied)`; `ReadPolicy`, the request-local fallible key policy used by server hint streams; `ReadPolicyMemoWindow`, a `Context.Reference<Duration.Input>` controlling each stream's memo duration. |
|
|
363
382
|
| `serverMetadata.ts` | `QueryReads`, `CommandInvalidation` and `changesRpc(name)` for server adapters. |
|
|
364
383
|
| `resume.ts` | `resumeSignal({ window?, native? })`, returning a native numeric signal atom. |
|
|
365
384
|
|
package/dist/automaticLive.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Duration } from "effect";
|
|
1
2
|
import type * as Atom from "effect/reactivity/Atom";
|
|
2
3
|
import type * as AtomRpc from "effect/reactivity/AtomRpc";
|
|
3
4
|
import { type Key } from "./keys.ts";
|
|
@@ -6,6 +7,7 @@ import type { changesRpc } from "./serverMetadata.ts";
|
|
|
6
7
|
export declare const LiveConnection: unique symbol;
|
|
7
8
|
export interface LiveBound {
|
|
8
9
|
readonly [LiveConnection]: {
|
|
10
|
+
readonly coalesceWindow: Atom.Writable<Duration.Input>;
|
|
9
11
|
readonly connection: Atom.Atom<unknown>;
|
|
10
12
|
readonly status: Atom.Atom<LiveStatus<unknown>>;
|
|
11
13
|
};
|
|
@@ -13,6 +15,7 @@ export interface LiveBound {
|
|
|
13
15
|
export type ChangesClient = AtomRpc.AtomRpcClient<unknown, string, ReturnType<typeof changesRpc>>;
|
|
14
16
|
export declare function automaticLive(service: ChangesClient, name: string): {
|
|
15
17
|
subscription: {
|
|
18
|
+
coalesceWindow: Atom.Writable<Duration.Input, Duration.Input>;
|
|
16
19
|
connection: Atom.Atom<import("effect/reactivity/AsyncResult").AsyncResult<void, never>>;
|
|
17
20
|
paused: Atom.Writable<boolean, boolean>;
|
|
18
21
|
status: Atom.Writable<LiveStatus<import("effect/rpc/RpcClientError").RpcClientError>, LiveStatus<import("effect/rpc/RpcClientError").RpcClientError>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automaticLive.d.ts","sourceRoot":"","sources":["../src/automaticLive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"automaticLive.d.ts","sourceRoot":"","sources":["../src/automaticLive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAmC,MAAM,QAAQ,CAAC;AACxE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAItD,eAAO,MAAM,cAAc,eAA0D,CAAC;AACtF,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,CAAC,cAAc,CAAC,EAAE;QAC1B,QAAQ,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACvD,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;KAChD,CAAC;CACF;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AAElG,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM;;;;;;;mBAG3C,SAAS,GAAG,EAAE;EAuBpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automaticLive.js","sourceRoot":"","sources":["../src/automaticLive.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"automaticLive.js","sourceRoot":"","sources":["../src/automaticLive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAGxE,OAAO,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAmB,IAAI,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAqB,YAAY,EAAE,MAAM,aAAa,CAAC;AAK9D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;AAWtF,MAAM,UAAU,aAAa,CAAC,OAAsB,EAAE,IAAY;IACjE,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAiB,EAAE,CAAC,CAAC,CAAC;IACtE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,SAAS,KAAK,CAAC,KAAqB;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;YAClC,MAAM,EAAE,GAAG,QAAQ,CAAC,C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EAAE,CAAC;AAChC,CAAC"}
|
package/dist/bind.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../src/bind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAU,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../src/bind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAU,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAiB,KAAK,SAAS,EAAkB,M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S,MAAM,EAClB,WAAW,SAAS,GAAG,CAAC,GAAG,EAC3B,QAAQ,SAAS,SAAS,WAAW,EAAE,EAEvC,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,EAC/D,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,GACnG,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC"}
|
package/dist/bind.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { Effect, Stream } from "effect";
|
|
2
2
|
import * as Reactivity from "effect/reactivity/Reactivity";
|
|
3
|
+
import { queryReactivity } from "#internal/queryReactivity.ts";
|
|
3
4
|
import { automaticLive, LiveConnection } from "./automaticLive.js";
|
|
4
5
|
import { invalidationKeys, readKeys } from "./keys.js";
|
|
5
6
|
const invalidateAfter = Effect.fn("EffectContract.invalidateAfter")(function* (keys) {
|
|
6
7
|
yield* Reactivity.invalidate(invalidationKeys(keys));
|
|
7
8
|
});
|
|
8
9
|
function boundQuery(service, tag, query, track) {
|
|
10
|
+
const reactive = queryReactivity(service.runtime);
|
|
9
11
|
function reads(payload) {
|
|
10
12
|
return readKeys(query.reads(payload));
|
|
11
13
|
}
|
|
12
14
|
return {
|
|
13
15
|
query: (payload, options = {}) => {
|
|
14
16
|
track(query.reads(payload));
|
|
15
|
-
return service.query(tag, payload,
|
|
17
|
+
return reactive(service.query(tag, payload, options), reads(payload));
|
|
16
18
|
},
|
|
17
19
|
run: (payload) => service.use((client) => client(tag, payload)),
|
|
18
20
|
};
|
package/dist/bind.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bind.js","sourceRoot":"","sources":["../src/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,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,YAAY,EAAE,CAC5C,CAAC;AACH,CAAC"}
|
package/dist/contract.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Schema } from "effect";
|
|
2
2
|
import { Rpc, RpcGroup, type RpcMiddleware, type RpcSchema } from "effect/rpc";
|
|
3
3
|
import type { CommandShape, OperationShape, QueryShape, StreamShape } from "./operation.ts";
|
|
4
|
+
import { changesRpc } from "./serverMetadata.ts";
|
|
4
5
|
export type Tag<TContract extends string, TName extends string> = `${TContract}.${TName}`;
|
|
5
6
|
export type OperationRpc<TContract extends string, TOperation> = TOperation extends OperationShape ? TOperation extends StreamShape ? Rpc.Rpc<Tag<TContract, TOperation["name"]>, TOperation["payload"], RpcSchema.Stream<TOperation["success"], TOperation["error"]>, Schema.Never> : Rpc.Rpc<Tag<TContract, TOperation["name"]>, TOperation["payload"], TOperation["success"], TOperation["error"]> : never;
|
|
6
7
|
export interface Declared<TName extends string, TQueries extends readonly QueryShape[], TCommands extends readonly CommandShape[], TStreams extends readonly StreamShape[] = readonly []> {
|
|
@@ -9,7 +10,7 @@ export interface Declared<TName extends string, TQueries extends readonly QueryS
|
|
|
9
10
|
readonly queries: TQueries;
|
|
10
11
|
readonly streams: TStreams;
|
|
11
12
|
}
|
|
12
|
-
export interface Contract<TName extends string, TQueries extends readonly QueryShape[], TCommands extends readonly CommandShape[], TRpcs extends Rpc.Any = OperationRpc<TName, TQueries[number] | TCommands[number]
|
|
13
|
+
export interface Contract<TName extends string, TQueries extends readonly QueryShape[], TCommands extends readonly CommandShape[], TRpcs extends Rpc.Any = OperationRpc<TName, TQueries[number] | TCommands[number]> | ReturnType<typeof changesRpc<TName>>, TStreams extends readonly StreamShape[] = readonly []> extends RpcGroup.RpcGroup<TRpcs> {
|
|
13
14
|
readonly declaration: Declared<TName, TQueries, TCommands, TStreams>;
|
|
14
15
|
middleware: <TM extends RpcMiddleware.AnyService>(middleware: TM) => Contract<TName, TQueries, TCommands, Rpc.AddMiddleware<TRpcs, TM>, TStreams>;
|
|
15
16
|
}
|
|
@@ -22,6 +23,6 @@ export declare function contract<const TName extends string, const TQueries exte
|
|
|
22
23
|
readonly queries?: TQueries & Unique<TQueries>;
|
|
23
24
|
readonly commands?: TCommands & Unique<[...TQueries, ...TCommands]>;
|
|
24
25
|
readonly streams?: TStreams & Unique<[...TQueries, ...TCommands, ...TStreams]>;
|
|
25
|
-
}): Contract<TName, TQueries, TCommands, OperationRpc<TName, TQueries[number] | TCommands[number] | TStreams[number]
|
|
26
|
+
}): Contract<TName, TQueries, TCommands, OperationRpc<TName, TQueries[number] | TCommands[number] | TStreams[number]> | ReturnType<typeof changesRpc<TName>>, TStreams>;
|
|
26
27
|
export {};
|
|
27
28
|
//# sourceMappingURL=contract.d.ts.map
|
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAuB,UAAU,EAAc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AY,EACZ,UAAgJ;IAEhJ,MAAM,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,UAAU,CAAC;IACjE,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,QAAQ,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;IACpD,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,EAAE,GAAG,QAAQ,EAAE,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CACpE,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,SAAS,CAAC,IAAI,EAAE,EAAE;QACrC,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,MAAM,EAAE,SAAS,CAAC,IAAI,KAAK,QAAQ;QACnC,OAAO,EAAE,SAAS,CAAC,OAAO;KAC1B,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CACxC,CAAC;IACF,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AACxG,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Duration } from "effect";
|
|
2
|
+
import type * as Reactivity from "effect/reactivity/Reactivity";
|
|
3
|
+
interface Batch {
|
|
4
|
+
readonly active: () => boolean;
|
|
5
|
+
readonly seen: Set<() => void>;
|
|
6
|
+
readonly window: Duration.Input | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare const liveBatches: WeakMap<Reactivity.Reactivity, Batch>;
|
|
9
|
+
export declare function liveKeys(keys: readonly string[]): string[];
|
|
10
|
+
export declare function invalidateLive(reactivity: Reactivity.Reactivity, keys: readonly string[], active: () => boolean, window?: Duration.Input): void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=liveInvalidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveInvalidation.d.ts","sourceRoot":"","sources":["../../src/internal/liveInvalidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAEhE,UAAU,KAAK;IACd,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC;CAC5C;AACD,eAAO,MAAM,WAAW,uCAA8C,CAAC;AACvE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,YAE/C;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,KAAK,QAOxI"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const liveBatches = new WeakMap();
|
|
2
|
+
export function liveKeys(keys) {
|
|
3
|
+
return keys.map((key) => `@shivaedev/live:${key}`);
|
|
4
|
+
}
|
|
5
|
+
export function invalidateLive(reactivity, keys, active, window) {
|
|
6
|
+
liveBatches.set(reactivity, { active, seen: new Set(), window });
|
|
7
|
+
try {
|
|
8
|
+
reactivity.invalidateUnsafe(window === undefined ? keys : liveKeys(keys));
|
|
9
|
+
}
|
|
10
|
+
finally {
|
|
11
|
+
liveBatches.delete(reactivity);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=liveInvalidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveInvalidation.js","sourceRoot":"","sources":["../../src/internal/liveInvalidation.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,EAAgC,CAAC;AACvE,MAAM,UAAU,QAAQ,CAAC,IAAuB;IAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,mBAAmB,GAAG,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,UAAiC,EAAE,IAAuB,EAAE,MAAqB,EAAE,MAAuB;IACxI,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACjE,IAAI,CAAC;QACJ,UAAU,CAAC,gBAAgB,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3E,CAAC;YAAS,CAAC;QACV,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { Key } from "#keys.ts";
|
|
3
|
+
export declare const makeHintPolicy: (capacity: number, retry: (keys: readonly Key[]) => Effect.Effect<void>) => Effect.Effect<(keys: readonly Key[]) => Effect.Effect<Key[], never, never>, never, import("effect/Scope").Scope>;
|
|
4
|
+
//# sourceMappingURL=makeHintPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makeHintPolicy.d.ts","sourceRoot":"","sources":["../../src/internal/makeHintPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAe,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAGpC,eAAO,MAAM,cAAc,mCAAgE,SAAS,GAAG,EAAE,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,0BAqBlH,SAAS,GAAG,EAAE,6EAc3B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Cache, Data, Effect, Exit, Queue } from "effect";
|
|
2
|
+
import { ReadPolicy, ReadPolicyMemoWindow } from "#readPolicy.ts";
|
|
3
|
+
export const makeHintPolicy = Effect.fnUntraced(function* (capacity, retry) {
|
|
4
|
+
const policy = yield* ReadPolicy;
|
|
5
|
+
const window = yield* ReadPolicyMemoWindow;
|
|
6
|
+
const cache = yield* Cache.makeWith(policy, {
|
|
7
|
+
capacity: Math.max(1, capacity),
|
|
8
|
+
timeToLive: (exit) => (Exit.isSuccess(exit) ? window : 0),
|
|
9
|
+
});
|
|
10
|
+
const failed = new Map();
|
|
11
|
+
const wake = yield* Queue.unbounded();
|
|
12
|
+
yield* Queue.take(wake).pipe(Effect.andThen(Effect.sleep("1 second")), Effect.andThen(Effect.suspend(() => {
|
|
13
|
+
const keys = [...failed.values()];
|
|
14
|
+
failed.clear();
|
|
15
|
+
return retry(keys);
|
|
16
|
+
})), Effect.forever, Effect.forkScoped);
|
|
17
|
+
return (keys) => Effect.filter(keys, (key) => Cache.get(cache, new Data.Class(key)).pipe(Effect.catch(() => Effect.gen(function* () {
|
|
18
|
+
if (failed.size === 0) {
|
|
19
|
+
yield* Queue.offer(wake, undefined);
|
|
20
|
+
}
|
|
21
|
+
failed.set(JSON.stringify(key), key);
|
|
22
|
+
return false;
|
|
23
|
+
}))));
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=makeHintPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makeHintPolicy.js","sourceRoot":"","sources":["../../src/internal/makeHintPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,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,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAC3B,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,IAAI,CAAC,KAAK,CAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAC9C,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CACjB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnB,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACvB,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;QACrC,OAAO,KAAK,CAAC;IACd,CAAC,CAAC,CACF,CACD,CACD,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as AsyncResult from "effect/reactivity/AsyncResult";
|
|
2
|
+
import * as Atom from "effect/reactivity/Atom";
|
|
3
|
+
export declare function queryReactivity<R, E>(runtime: Atom.AtomRuntime<R, E>): (atom: Atom.Atom<AsyncResult.AsyncResult<unknown, unknown>>, keys: readonly string[]) => Atom.Atom<AsyncResult.AsyncResult<unknown, unknown>>;
|
|
4
|
+
//# sourceMappingURL=queryReactivity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryReactivity.d.ts","sourceRoot":"","sources":["../../src/internal/queryReactivity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAK/C,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,sEAIzC,SAAS,MAAM,EAAE,0DAuF5C"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Duration, Effect } from "effect";
|
|
2
|
+
import * as AsyncResult from "effect/reactivity/AsyncResult";
|
|
3
|
+
import * as Atom from "effect/reactivity/Atom";
|
|
4
|
+
import * as Reactivity from "effect/reactivity/Reactivity";
|
|
5
|
+
import { queryCoalesceWindow } from "#queryCoalesceWindow.ts";
|
|
6
|
+
import { liveBatches, liveKeys } from "./liveInvalidation.js";
|
|
7
|
+
export function queryReactivity(runtime) {
|
|
8
|
+
const service = runtime.atom(Effect.service(Reactivity.Reactivity));
|
|
9
|
+
const cached = new WeakMap();
|
|
10
|
+
return (atom, keys) => {
|
|
11
|
+
const existing = cached.get(atom);
|
|
12
|
+
if (existing !== undefined) {
|
|
13
|
+
return existing;
|
|
14
|
+
}
|
|
15
|
+
const source = Atom.setIdleTTL(Atom.readable((get) => atom.read(get), atom.refresh), 0);
|
|
16
|
+
let wrapped = Atom.transform(source, (get) => {
|
|
17
|
+
const context = get(service);
|
|
18
|
+
if (!AsyncResult.isSuccess(context)) {
|
|
19
|
+
return get(source);
|
|
20
|
+
}
|
|
21
|
+
const reactivity = context.value;
|
|
22
|
+
let pending;
|
|
23
|
+
let timer;
|
|
24
|
+
function clear() {
|
|
25
|
+
clearTimeout(timer);
|
|
26
|
+
timer = undefined;
|
|
27
|
+
pending = undefined;
|
|
28
|
+
}
|
|
29
|
+
function refresh(active) {
|
|
30
|
+
if (!active()) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (get.once(source).waiting) {
|
|
34
|
+
pending = active;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
pending = undefined;
|
|
38
|
+
get.refresh(source);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function changed() {
|
|
42
|
+
const batch = liveBatches.get(reactivity);
|
|
43
|
+
if (batch === undefined || batch.seen.has(changed)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
batch.seen.add(changed);
|
|
47
|
+
const delay = Duration.toMillis(Duration.fromInputUnsafe(get.once(queryCoalesceWindow(wrapped)) ?? batch.window ?? 0));
|
|
48
|
+
if (delay === 0) {
|
|
49
|
+
clear();
|
|
50
|
+
get.refresh(source);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
timer ??= setTimeout(() => {
|
|
54
|
+
timer = undefined;
|
|
55
|
+
refresh(batch.active);
|
|
56
|
+
}, delay);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
get.addFinalizer(clear);
|
|
60
|
+
get.addFinalizer(reactivity.registerUnsafe(liveKeys(keys), changed));
|
|
61
|
+
get.addFinalizer(reactivity.registerUnsafe(keys, () => {
|
|
62
|
+
if (!liveBatches.has(reactivity)) {
|
|
63
|
+
clear();
|
|
64
|
+
get.refresh(source);
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
67
|
+
get.subscribe(source, (value) => {
|
|
68
|
+
get.setSelf(value);
|
|
69
|
+
if (pending !== undefined && !value.waiting) {
|
|
70
|
+
const active = pending;
|
|
71
|
+
pending = undefined;
|
|
72
|
+
if (active()) {
|
|
73
|
+
get.refresh(source);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return get.once(source);
|
|
78
|
+
}, { initialValueTarget: source });
|
|
79
|
+
if (atom.keepAlive) {
|
|
80
|
+
wrapped = Atom.keepAlive(wrapped);
|
|
81
|
+
}
|
|
82
|
+
else if (atom.idleTTL !== undefined) {
|
|
83
|
+
wrapped = Atom.setIdleTTL(wrapped, atom.idleTTL);
|
|
84
|
+
}
|
|
85
|
+
if (Atom.isSerializable(atom)) {
|
|
86
|
+
Object.assign(wrapped, { [Atom.SerializableTypeId]: atom[Atom.SerializableTypeId] });
|
|
87
|
+
}
|
|
88
|
+
cached.set(atom, wrapped);
|
|
89
|
+
return wrapped;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=queryReactivity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACtF,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1B,OAAO,OAAO,CAAC;IAChB,CAAC,CAAC;AACH,CAAC"}
|
package/dist/live.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Cause,
|
|
1
|
+
import { type Cause, Duration, Option, Schema, Stream } from "effect";
|
|
2
2
|
import * as Atom from "effect/reactivity/Atom";
|
|
3
3
|
import { Key } from "./keys.ts";
|
|
4
4
|
export declare const LiveHint: Schema.Union<readonly [Schema.Struct<{
|
|
@@ -22,12 +22,14 @@ export interface LiveStatus<E> {
|
|
|
22
22
|
readonly pending: number;
|
|
23
23
|
}
|
|
24
24
|
export interface LiveOptions<E, R> {
|
|
25
|
+
readonly coalesceWindow?: Duration.Input;
|
|
25
26
|
readonly resume?: Atom.Atom<unknown>;
|
|
26
27
|
readonly resyncKeys: readonly Key[] | (() => readonly Key[]);
|
|
27
28
|
readonly retryDelay?: Duration.Input;
|
|
28
29
|
readonly stream: Stream.Stream<LiveHint, E, R>;
|
|
29
30
|
}
|
|
30
31
|
export declare function live<R, E, TRuntimeError>(runtime: Atom.AtomRuntime<R, TRuntimeError>, options: LiveOptions<E, R>): {
|
|
32
|
+
coalesceWindow: Atom.Writable<Duration.Input, Duration.Input>;
|
|
31
33
|
connection: Atom.Atom<import("effect/reactivity/AsyncResult").AsyncResult<void, TRuntimeError>>;
|
|
32
34
|
paused: Atom.Writable<boolean, boolean>;
|
|
33
35
|
status: Atom.Writable<LiveStatus<E>, LiveStatus<E>>;
|
package/dist/live.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,QAAQ,EAAU,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9E,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAG/C,OAAO,EAAoB,GAAG,EAAY,MAAM,WAAW,CAAC;AAE5D,eAAO,MAAM,QAAQ;;;;;;;;;;;;IAGnB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;AAC5C,MAAM,WAAW,UAAU,CAAC,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,YAAY,GAAG,MAAM,GAAG,cAAc,CAAC;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB;AACD,MAAM,WAAW,WAAW,CAAC,CAAC,EAAE,CAAC;IAChC,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,SAAS,GAAG,EAAE,GAAG,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC,CAAC;IAC7D,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;IACrC,QAAQ,CAA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