@shivaedev/effect-react 0.4.0 → 0.5.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 +13 -0
- package/README.md +29 -27
- package/dist/client/create.d.ts +2 -2
- package/dist/client/create.d.ts.map +1 -1
- package/dist/client/create.js +1 -1
- package/dist/client/create.js.map +1 -1
- package/dist/client/editor.d.ts +2 -2
- package/dist/client/editor.d.ts.map +1 -1
- package/dist/client/editor.js +1 -1
- package/dist/client/editor.js.map +1 -1
- package/dist/client/sessionBoundary.js +1 -1
- package/dist/client/sessionBoundary.js.map +1 -1
- package/dist/{field-rejection.d.ts → fieldRejection.d.ts} +1 -1
- package/dist/fieldRejection.d.ts.map +1 -0
- package/dist/{field-rejection.js → fieldRejection.js} +1 -1
- package/dist/fieldRejection.js.map +1 -0
- package/dist/{resume-signal.d.ts → resumeSignal.d.ts} +1 -1
- package/dist/resumeSignal.d.ts.map +1 -0
- package/dist/{resume-signal.js → resumeSignal.js} +1 -1
- package/dist/resumeSignal.js.map +1 -0
- package/dist/submission.d.ts +1 -1
- package/dist/submission.d.ts.map +1 -1
- package/dist/submission.js +1 -1
- package/dist/submission.js.map +1 -1
- package/docs/roadmap.md +4 -3
- package/package.json +20 -106
- package/src/client/create.ts +2 -2
- package/src/client/editor.ts +2 -2
- package/src/client/sessionBoundary.ts +1 -1
- package/src/submission.ts +1 -1
- package/dist/field-rejection.d.ts.map +0 -1
- package/dist/field-rejection.js.map +0 -1
- package/dist/resume-signal.d.ts.map +0 -1
- package/dist/resume-signal.js.map +0 -1
- /package/src/{field-rejection.ts → fieldRejection.ts} +0 -0
- /package/src/{resume-signal.ts → resumeSignal.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0 - 2026-10-18
|
|
4
|
+
|
|
5
|
+
### Breaking
|
|
6
|
+
|
|
7
|
+
- Modules are named in camelCase: `field-rejection.ts` becomes `fieldRejection.ts`, and `resume-signal.ts` becomes `resumeSignal.ts`.
|
|
8
|
+
- Every module's import path is now its path under `src/`. `router.ts` becomes `loadQuery.ts`; `create.ts`, `editor.ts` and `testing.ts` move under `client/`; `result-state.ts`, `save-state.ts` and `session-boundary.ts` become `client/resultState.ts`, `client/saveState.ts` and `client/sessionBoundary.ts`.
|
|
9
|
+
|
|
10
|
+
## 0.4.1 - 2026-10-17
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Align the published contract dependency with the current framework release.
|
|
15
|
+
|
|
3
16
|
## 0.4.0 - 2026-10-13
|
|
4
17
|
|
|
5
18
|
### Breaking
|
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ export function App() {
|
|
|
47
47
|
`Orders` is the application's feature component. For authenticated screens, use `SessionBoundary` at the authenticated root instead:
|
|
48
48
|
|
|
49
49
|
```tsx
|
|
50
|
-
import { SessionBoundary } from "@shivaedev/effect-react/
|
|
50
|
+
import { SessionBoundary } from "@shivaedev/effect-react/client/sessionBoundary.ts";
|
|
51
51
|
import { makeOrderClient, OrderScreens } from "./orders.tsx";
|
|
52
52
|
|
|
53
53
|
interface Session {
|
|
@@ -76,7 +76,7 @@ export function App({ session, recheck }: {
|
|
|
76
76
|
|
|
77
77
|
`makeOrderClient` and `OrderScreens` belong to the application. A changed generation creates a new client and registry, remounts the screens and disposes the outgoing registry. `undefined` renders `signedOut`. Updating the session object with the same generation keeps the existing client: `connect` does not receive a rotated token until the identity changes. Include the credential generation when the client captures its token, as above.
|
|
78
78
|
|
|
79
|
-
A query that fails with a tagged `Unauthorized` asks `recheck` to run and keeps its retained data. The auth owner can retry the same session or remove it; the hook does not sign the user out. The boundary also handles React StrictMode's effect replay and preserves component state across hiding and revealing an `<Activity>` subtree, supplying a live registry when revealed.
|
|
79
|
+
A query that fails with a tagged `Unauthorized` asks `recheck` to run and keeps its retained data. An action does the same once per failed result, retaining its last successful `data` and the typed failure in `cause`; rerendering that result does not repeat the recheck. The auth owner can retry the same session or remove it; the hook does not sign the user out. The boundary also handles React StrictMode's effect replay and preserves component state across hiding and revealing an `<Activity>` subtree, supplying a live registry when revealed.
|
|
80
80
|
|
|
81
81
|
### 2. Once per feature: native queries and actions
|
|
82
82
|
|
|
@@ -84,7 +84,7 @@ The hooks accept native atoms directly. This complete component module shows que
|
|
|
84
84
|
|
|
85
85
|
```tsx
|
|
86
86
|
import { RegistryProvider } from "@effect/atom-react";
|
|
87
|
-
import { useAction, useQuery } from "@shivaedev/effect-react/
|
|
87
|
+
import { useAction, useQuery } from "@shivaedev/effect-react/client/resultState.ts";
|
|
88
88
|
import { Effect, Option } from "effect";
|
|
89
89
|
import * as Atom from "effect/reactivity/Atom";
|
|
90
90
|
|
|
@@ -121,6 +121,8 @@ export function App() {
|
|
|
121
121
|
}
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
+
For both queries and actions, a successful `undefined` is `Option.some(undefined)` in `data`, with `pending` and `refreshing` false. A defect or interruption is available as `Option.some(cause)` in `cause`; `isUnauthorized` returns false for those causes and they do not request a session recheck, even when the defect has an `Unauthorized` tag.
|
|
125
|
+
|
|
124
126
|
The example's action returns a value; it does not persist the report or invalidate its query. In an application, use the native RPC query and mutation atoms instead:
|
|
125
127
|
|
|
126
128
|
```ts
|
|
@@ -141,7 +143,7 @@ An action's `dispatch(input)` returns `void`. Read the atom's latest result from
|
|
|
141
143
|
|
|
142
144
|
### Route loaders with TanStack Router
|
|
143
145
|
|
|
144
|
-
TanStack Router owns routes, navigation, loader data and error components. `@shivaedev/effect-react/
|
|
146
|
+
TanStack Router owns routes, navigation, loader data and error components. `@shivaedev/effect-react/loadQuery.ts` supplies `loadQuery(registry, atom, loaderContext)` to read a contract query atom in the same registry as React. The atom runs through its native RPC runtime; the loader does not create another runtime or query cache.
|
|
145
147
|
|
|
146
148
|
This example assumes an application-owned `api.get.query({ id })` returning `{ id, title }`, with a declared `NoteMissing` rejection:
|
|
147
149
|
|
|
@@ -151,7 +153,7 @@ import { createRootRouteWithContext, createRoute, createRouter, Outlet, RouterPr
|
|
|
151
153
|
import type { ErrorComponentProps } from "@tanstack/react-router";
|
|
152
154
|
import { Predicate } from "effect";
|
|
153
155
|
import * as AtomRegistry from "effect/reactivity/AtomRegistry";
|
|
154
|
-
import { loadQuery } from "@shivaedev/effect-react/
|
|
156
|
+
import { loadQuery } from "@shivaedev/effect-react/loadQuery.ts";
|
|
155
157
|
import { api } from "./notes-client.ts";
|
|
156
158
|
|
|
157
159
|
const registry = AtomRegistry.make();
|
|
@@ -208,9 +210,9 @@ pnpm add @tanstack/react-router
|
|
|
208
210
|
The next module assumes `./invoice-lines-client.ts` exports a contract-bound `api` with `get`, `save` and `create`, and its native `InvoiceLinesClient`. `get` returns `{ id, name, quantity }`; both commands return the saved row. The [contract guide](https://github.com/ShivaeDev/platform/blob/main/packages/effect-contract/README.md) describes that binding.
|
|
209
211
|
|
|
210
212
|
```tsx
|
|
211
|
-
import { useCreate } from "@shivaedev/effect-react/create.ts";
|
|
212
|
-
import { useEditor } from "@shivaedev/effect-react/editor.ts";
|
|
213
|
-
import { useField } from "@shivaedev/effect-form/react.ts";
|
|
213
|
+
import { useCreate } from "@shivaedev/effect-react/client/create.ts";
|
|
214
|
+
import { useEditor } from "@shivaedev/effect-react/client/editor.ts";
|
|
215
|
+
import { useField } from "@shivaedev/effect-form/client/react.ts";
|
|
214
216
|
import type { Form } from "@shivaedev/effect-form/shape.ts";
|
|
215
217
|
import { Option, Schema } from "effect";
|
|
216
218
|
import { api, InvoiceLinesClient } from "./invoice-lines-client.ts";
|
|
@@ -318,7 +320,7 @@ Here `save` has a tagged `SubtitleRejected` failure referring to the server's `s
|
|
|
318
320
|
Keep the signal and query identities stable:
|
|
319
321
|
|
|
320
322
|
```ts
|
|
321
|
-
import { resumeSignal } from "@shivaedev/effect-react/
|
|
323
|
+
import { resumeSignal } from "@shivaedev/effect-react/resumeSignal.ts";
|
|
322
324
|
import { Effect } from "effect";
|
|
323
325
|
import * as Atom from "effect/reactivity/Atom";
|
|
324
326
|
|
|
@@ -356,28 +358,28 @@ const query = Atom.swr(atom, {
|
|
|
356
358
|
|
|
357
359
|
| Defining module | Exports |
|
|
358
360
|
| --- | --- |
|
|
359
|
-
| `
|
|
360
|
-
| `
|
|
361
|
-
| `editor.ts` | `useEditor`; `Editor`, `EditorConfig`. |
|
|
362
|
-
| `create.ts` | `useCreate`; `Create`, `CreateConfig`. |
|
|
363
|
-
| `
|
|
364
|
-
| `
|
|
365
|
-
| `
|
|
366
|
-
| `
|
|
367
|
-
| `testing.ts` | `render`, `eventually`, `expectNoReactWarnings`; `Rendered`. |
|
|
361
|
+
| `client/resultState.ts` | `useQuery`, `useAction`, `isUnauthorized`; `ResultState`, `QueryOptions`, `QueryState`, `ActionState`. |
|
|
362
|
+
| `client/sessionBoundary.ts` | `SessionBoundary`, `useSessionRecheck`; `SessionBoundaryProps`. |
|
|
363
|
+
| `client/editor.ts` | `useEditor`; `Editor`, `EditorConfig`. |
|
|
364
|
+
| `client/create.ts` | `useCreate`; `Create`, `CreateConfig`. |
|
|
365
|
+
| `resumeSignal.ts` | `resumeSignal`; `ResumeSource`, `ResumeWindow`, `ResumeOptions`. |
|
|
366
|
+
| `loadQuery.ts` | `loadQuery`. |
|
|
367
|
+
| `client/saveState.ts` | `useSaveState`; `SaveState`. |
|
|
368
|
+
| `fieldRejection.ts` | `fieldRejectionOf`, `rejecting`; `FieldRejection`, `RejectField`, `FieldRejectionMapping`, `AtomServices`. |
|
|
369
|
+
| `client/testing.ts` | `render`, `eventually`, `expectNoReactWarnings`; `Rendered`. |
|
|
368
370
|
| `submission.ts` | `submission`; `Submission`, `SubmissionConfig`. |
|
|
369
371
|
|
|
370
|
-
Import the defining `.ts` module, such as `@shivaedev/effect-react/editor.ts`. There is no root import. `SessionBoundaryProps` supplies `session`, `identify`, `connect`, `recheck`, a client-to-children function and optional `signedOut`; `useSessionRecheck()` reads that boundary's callback.
|
|
372
|
+
Import the defining `.ts` module, such as `@shivaedev/effect-react/client/editor.ts`. There is no root import. `SessionBoundaryProps` supplies `session`, `identify`, `connect`, `recheck`, a client-to-children function and optional `signedOut`; `useSessionRecheck()` reads that boundary's callback.
|
|
371
373
|
|
|
372
374
|
`Editor` exposes `query`, optional `form` and `SaveState`; `Create` exposes `form`, `created` and `SaveState`. `SaveState` has `save`, `saving`, `dirty`, `failure` and `revert`. Prefer the two complete hooks when binding a form to a command. The lower-level form modules expose the same composition pieces: `submission` makes a form and its submission snapshot reader, `rejecting` maps save failures through a submitter, and `useSaveState` observes submission and invokes a success callback.
|
|
373
375
|
|
|
374
376
|
### Render tests in happy-dom
|
|
375
377
|
|
|
376
|
-
Use `@shivaedev/effect-react/testing.ts` with Vitest's `happy-dom` environment. Install effect-contract for the example's query and command declarations, and the testing peers and environment in your app's dev dependencies:
|
|
378
|
+
Use `@shivaedev/effect-react/client/testing.ts` with Vitest's `happy-dom` environment. Install effect-contract for the example's query and command declarations, and the testing peers and environment in your app's dev dependencies:
|
|
377
379
|
|
|
378
380
|
```sh
|
|
379
381
|
pnpm add @shivaedev/effect-contract
|
|
380
|
-
pnpm add -D vitest happy-dom react-dom@19.
|
|
382
|
+
pnpm add -D vitest happy-dom react-dom@19.3.0 @types/react-dom
|
|
381
383
|
```
|
|
382
384
|
|
|
383
385
|
Configure Vitest with `test: { environment: "happy-dom" }`, or select that environment for your DOM test project. This complete `notes.dom.test.tsx` renders a component that runs a declared query and command against native RPC test handlers:
|
|
@@ -392,8 +394,8 @@ import { bind } from "@shivaedev/effect-contract/bind.ts";
|
|
|
392
394
|
import { contract } from "@shivaedev/effect-contract/contract.ts";
|
|
393
395
|
import { collection } from "@shivaedev/effect-contract/keys.ts";
|
|
394
396
|
import { command, query } from "@shivaedev/effect-contract/operation.ts";
|
|
395
|
-
import { useAction, useQuery } from "@shivaedev/effect-react/
|
|
396
|
-
import { eventually, expectNoReactWarnings, render } from "@shivaedev/effect-react/testing.ts";
|
|
397
|
+
import { useAction, useQuery } from "@shivaedev/effect-react/client/resultState.ts";
|
|
398
|
+
import { eventually, expectNoReactWarnings, render } from "@shivaedev/effect-react/client/testing.ts";
|
|
397
399
|
|
|
398
400
|
Object.assign(globalThis, { "IS_REACT_ACT_ENVIRONMENT": true });
|
|
399
401
|
expectNoReactWarnings();
|
|
@@ -462,10 +464,12 @@ The RPC layer stays application-owned: replace these in-memory handlers with the
|
|
|
462
464
|
|
|
463
465
|
The [order feature’s application-owned kit](https://github.com/ShivaeDev/platform/tree/main/packages/effect-react/src/test-support/order-example) uses `test-story` above `effect-test` to compose real PostgreSQL, HTTP RPC and the actual React components. Its screen traits mount fresh native atom registries and scoped roots; its verbs dispatch DOM events and wait for rendered output. The [stories](https://github.com/ShivaeDev/platform/blob/main/packages/effect-react/src/orderStory.dom.spec.tsx) verify list refresh through `useAction` and rejected-input retention and retry through `useEditor`, with persistence read from a separate PostgreSQL pool. These tests require `PLATFORM_EFFECT_SQL_TEST_DATABASE_URL`; DOM and loopback HTTP establish no physical browser, SSR or mobile behavior.
|
|
464
466
|
|
|
467
|
+
The [reference PostgreSQL feature](https://github.com/ShivaeDev/platform/blob/main/docs/framework/composed-example.md) uses the same leased database infrastructure and a scoped story verb for its real server and rendered clients. Its stories verify commit visibility, live refresh of a second editor, retained local edits and rollback without publication. To start an application, use the [copyable starter](https://github.com/ShivaeDev/platform/tree/main/examples/starter) with `pnpm create @shivaedev/app my-app`.
|
|
468
|
+
|
|
465
469
|
### Install, setup and limits
|
|
466
470
|
|
|
467
471
|
```sh
|
|
468
|
-
pnpm add @shivaedev/effect-react @effect/atom-react@4.0.4 effect@4.0.4 react@19.
|
|
472
|
+
pnpm add @shivaedev/effect-react @effect/atom-react@4.0.4 effect@4.0.4 react@19.3.0
|
|
469
473
|
```
|
|
470
474
|
|
|
471
475
|
For editor, create or lower-level form modules, also install the optional form peer:
|
|
@@ -474,7 +478,7 @@ For editor, create or lower-level form modules, also install the optional form p
|
|
|
474
478
|
pnpm add @shivaedev/effect-form
|
|
475
479
|
```
|
|
476
480
|
|
|
477
|
-
Query, action, session and resume modules do not require effect-form. The package declares Node 24 or newer and peers on Effect, atom-react and React; this repository checks Effect and atom-react `4.0.4` with React `19.
|
|
481
|
+
Query, action, session and resume modules do not require effect-form. The package declares Node 24 or newer and peers on Effect, atom-react and React; this repository checks Effect and atom-react `4.0.4` with React `19.3.0`.
|
|
478
482
|
|
|
479
483
|
- Query identity, TTL, invalidation and action concurrency remain native atom policies. Put the registry at the lifetime boundary those policies need.
|
|
480
484
|
- Action state describes the atom's latest result. A `dispatch` is not a Promise or a separate result handle.
|
|
@@ -483,5 +487,3 @@ Query, action, session and resume modules do not require effect-form. The packag
|
|
|
483
487
|
- DOM tests and an injected resume source do not prove real-browser or mobile lifecycle behavior. The real HTTP order fixture proves its local composition, not a deployed host's auth, cancellation or rendering policy.
|
|
484
488
|
|
|
485
489
|
The full design is in [the north star](https://github.com/ShivaeDev/platform/blob/main/packages/effect-react/docs/north-star.md). Implementation status and unresolved choices are in [the roadmap](https://github.com/ShivaeDev/platform/blob/main/packages/effect-react/docs/roadmap.md).
|
|
486
|
-
|
|
487
|
-
The [reference PostgreSQL feature](https://github.com/ShivaeDev/platform/blob/main/docs/framework/composed-example.md) uses the same leased database infrastructure and a scoped story verb for its real server and rendered clients. It is a test fixture, not a copyable app; an app template is still needed. Its stories verify commit visibility, live refresh of a second editor, retained local edits and rollback without publication.
|
package/dist/client/create.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Effect, Option, type Schema } from "effect";
|
|
2
2
|
import type * as Atom from "effect/reactivity/Atom";
|
|
3
|
-
import { type BrowserDraftConfig } from "@shivaedev/effect-form/react.ts";
|
|
3
|
+
import { type BrowserDraftConfig } from "@shivaedev/effect-form/client/react.ts";
|
|
4
4
|
import type { Decoded, Encoded, FieldFailure, Fields, Form, Services } from "@shivaedev/effect-form/shape.ts";
|
|
5
|
-
import type { AtomServices, FieldRejectionMapping } from "#
|
|
5
|
+
import type { AtomServices, FieldRejectionMapping } from "#fieldRejection.ts";
|
|
6
6
|
import { type SaveState } from "./saveState.ts";
|
|
7
7
|
export type CreateConfig<TFields extends Fields, TCreated, TSaveError, R, TRuntimeError> = {
|
|
8
8
|
readonly persistedDraft?: BrowserDraftConfig | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/client/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAS,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AACjE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,KAAK,kBAAkB,EAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/client/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAS,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AACjE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,KAAK,kBAAkB,EAAqB,MAAM,wCAAwC,CAAC;AACpG,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC9G,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,gBAAgB,CAAC;AAC9D,MAAM,MAAM,YAAY,CAAC,OAAO,SAAS,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,IAAI;IAC1F,QAAQ,CAAC,cAAc,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACpG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;CACxE,GAAG,qBAAqB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC/C,MAAM,WAAW,MAAM,CAAC,OAAO,SAAS,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAE,SAAQ,SAAS,CAAC,UAAU,GAAG,aAAa,CAAC;IACjI,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,GAAG,YAAY,EAAE,aAAa,CAAC,CAAC;CACjF;AAKD,wBAAgB,SAAS,CAAC,OAAO,SAAS,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EACvF,MAAM,EAAE,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,CAAC,GACnE,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAC,CAkBtD"}
|
package/dist/client/create.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Equal, Option } from "effect";
|
|
2
2
|
import { useCallback, useState } from "react";
|
|
3
|
-
import { usePersistedDraft } from "@shivaedev/effect-form/react.ts";
|
|
3
|
+
import { usePersistedDraft } from "@shivaedev/effect-form/client/react.ts";
|
|
4
4
|
import { submission } from "#submission.ts";
|
|
5
5
|
import { useSaveState } from "./saveState.js";
|
|
6
6
|
function editedSince(current, submitted) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/client/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAA2B,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/client/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAA2B,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAGpG,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAkB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAY9D,SAAS,WAAW,CAAoB,OAAW,EAAE,SAAyB;IAC7E,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACtH,CAAC;AACD,MAAM,UAAU,SAAS,CACxB,MAAqE;IAErE,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAChE,MAAM,CAAC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
|
|
1
1
|
import { type Effect, type Schema } from "effect";
|
|
2
2
|
import type * as AsyncResult from "effect/reactivity/AsyncResult";
|
|
3
3
|
import type * as Atom from "effect/reactivity/Atom";
|
|
4
|
-
import { type BrowserDraftConfig } from "@shivaedev/effect-form/react.ts";
|
|
4
|
+
import { type BrowserDraftConfig } from "@shivaedev/effect-form/client/react.ts";
|
|
5
5
|
import type { Decoded, Encoded, FieldFailure, Fields, Form, Services } from "@shivaedev/effect-form/shape.ts";
|
|
6
|
-
import type { AtomServices, FieldRejectionMapping } from "#
|
|
6
|
+
import type { AtomServices, FieldRejectionMapping } from "#fieldRejection.ts";
|
|
7
7
|
import { type QueryState } from "./resultState.ts";
|
|
8
8
|
import { type SaveState } from "./saveState.ts";
|
|
9
9
|
export type EditorConfig<TFields extends Fields, TRow, TQueryError, TSaveError, R, TRuntimeError> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/client/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,KAAK,kBAAkB,EAAqB,MAAM,
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/client/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,KAAK,kBAAkB,EAAqB,MAAM,wCAAwC,CAAC;AACpG,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,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AC,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,YAAY,EAAE,aAAa,CAAC,GAAG,SAAS,CAAC;IACzF,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;CAC9C;AAMD,wBAAgB,SAAS,CAAC,OAAO,SAAS,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAChG,MAAM,EAAE,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,CAAC,GAC5E,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC,CA8B/D"}
|
package/dist/client/editor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Option } from "effect";
|
|
2
2
|
import { useCallback, useEffect, useState } from "react";
|
|
3
|
-
import { usePersistedDraft } from "@shivaedev/effect-form/react.ts";
|
|
3
|
+
import { usePersistedDraft } from "@shivaedev/effect-form/client/react.ts";
|
|
4
4
|
import { submission } from "#submission.ts";
|
|
5
5
|
import { useQuery } from "./resultState.js";
|
|
6
6
|
import { useSaveState } from "./saveState.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../src/client/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAe,MAAM,QAAQ,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAA2B,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../src/client/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAe,MAAM,QAAQ,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,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,MAAM,CAAC;IAC/B,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,IAAI,IAAI,MAAM,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACzC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACxB,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,KAAW,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACzH,OAAO,EAAE,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RegistryContext } from "@effect/atom-react";
|
|
2
2
|
import * as AtomRegistry from "effect/reactivity/AtomRegistry";
|
|
3
3
|
import { createContext, createElement, Fragment, useContext, useEffect, useState } from "react";
|
|
4
|
-
import { DraftSessionContext } from "@shivaedev/effect-form/react.ts";
|
|
4
|
+
import { DraftSessionContext } from "@shivaedev/effect-form/client/react.ts";
|
|
5
5
|
import { useDraftOwner } from "./useDraftOwner.js";
|
|
6
6
|
const RecheckContext = createContext(() => undefined);
|
|
7
7
|
export function useSessionRecheck() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionBoundary.js","sourceRoot":"","sources":["../../src/client/sessionBoundary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,E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,EACT,QAAQ,GACiC;IACzC,MAAM,EAAE,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAClC,OAAO,OAAO,KAAK,SAAS;QAC3B,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC;QAC1C,CAAC,CAAC,aAAa,CACb,mBAAmB,CAAC,QAAQ,EAC5B,EAAE,KAAK,EAAE,OAAO,EAAE,EAClB,aAAa,CAAC,UAA6B,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAC9F,CAAC;AACL,CAAC"}
|
|
@@ -20,4 +20,4 @@ export type FieldRejectionMapping<F extends Fields, E> = {
|
|
|
20
20
|
export declare const fieldRejectionOf: <F extends Fields>(schema: Schema.Struct<F>) => (error: unknown) => FieldRejection<Name<F>> | undefined;
|
|
21
21
|
export declare const rejecting: <F extends Fields, V, A, E, R>(schema: Schema.Struct<F>, save: (values: V) => Effect.Effect<A, E, R>, reject: RejectField<F, E> | undefined) => (values: V, submitter: Submitter<Name<F>>) => Effect.Effect<A, E | FieldFailure, R>;
|
|
22
22
|
export {};
|
|
23
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=fieldRejection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldRejection.d.ts","sourceRoot":"","sources":["../src/fieldRejection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OA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AE,GAAG,KAAK,CAAC;IACvC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAClH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,CACxB,MAAwB,EACxB,IAA2C,EAC3C,MAAqC,EACpC,EAAE;IACH,MAAM,SAAS,GAAG,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACrD,OAAO,CAAC,MAAS,EAAE,SAA6B,EAAyC,EAAE,CAC1F,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAA0C,EAAE;QAC5E,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -3,4 +3,4 @@ export type ResumeSource = ContractSource;
|
|
|
3
3
|
export type ResumeWindow = ContractWindow;
|
|
4
4
|
export type ResumeOptions = ContractOptions;
|
|
5
5
|
export declare function resumeSignal(options: ResumeOptions): import("effect/reactivity/Atom").Atom<number>;
|
|
6
|
-
//# sourceMappingURL=
|
|
6
|
+
//# sourceMappingURL=resumeSignal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resumeSignal.d.ts","sourceRoot":"","sources":["../src/resumeSignal.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,aAAa,IAAI,eAAe,EACrC,KAAK,YAAY,IAAI,cAAc,EACnC,KAAK,YAAY,IAAI,cAAc,EAEnC,MAAM,sCAAsC,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAC1C,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAC1C,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC;AAC5C,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,iDAElD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resumeSignal.js","sourceRoot":"","sources":["../src/resumeSignal.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,YAAY,IAAI,oBAAoB,GACpC,MAAM,sCAAsC,CAAC;AAK9C,MAAM,UAAU,YAAY,CAAC,OAAsB;IAClD,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC"}
|
package/dist/submission.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Effect, Schema } from "effect";
|
|
|
2
2
|
import type * as Atom from "effect/reactivity/Atom";
|
|
3
3
|
import type { PersistedDraftConfig } from "@shivaedev/effect-form/persistence.ts";
|
|
4
4
|
import type { Decoded, Encoded, FieldFailure, Fields, Form, Services } from "@shivaedev/effect-form/shape.ts";
|
|
5
|
-
import { type AtomServices, type RejectField } from "./
|
|
5
|
+
import { type AtomServices, type RejectField } from "./fieldRejection.ts";
|
|
6
6
|
export interface SubmissionConfig<F extends Fields, A, E, R, ER> {
|
|
7
7
|
readonly fields: Schema.Struct<F>;
|
|
8
8
|
readonly initialValues: Encoded<F>;
|
package/dist/submission.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submission.d.ts","sourceRoot":"","sources":["../src/submission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AACl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AC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;IACrD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE,EAAE,CAAC,CAAC;IAChD,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACjD;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,KAAG,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAc1H,CAAC"}
|
package/dist/submission.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { make } from "@shivaedev/effect-form/form.ts";
|
|
2
|
-
import { rejecting } from "./
|
|
2
|
+
import { rejecting } from "./fieldRejection.js";
|
|
3
3
|
export const submission = (config) => {
|
|
4
4
|
const { fields, initialValues, runtime } = config;
|
|
5
5
|
const save = rejecting(fields, config.save, config.rejectField);
|
package/dist/submission.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submission.js","sourceRoot":"","sources":["../src/submission.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAGtD,OAAO,EAAuC,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"submission.js","sourceRoot":"","sources":["../src/submission.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAGtD,OAAO,EAAuC,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAgBrF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAgC,MAAwC,EAA2B,EAAE;IAC9H,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAClD,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAChE,IAAI,SAAiC,CAAC;IACtC,MAAM,IAAI,GAAqC,IAAI,CAAC,MAAM,EAAE;QAC3D,aAAa;QACb,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;YACzC,SAAS,GAAG,QAAQ,CAAC;YACrB,OAAO,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAChC,CAAC;QACD,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,OAAO;KACP,CAAC,CAAC;IACH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC;AAC7C,CAAC,CAAC"}
|
package/docs/roadmap.md
CHANGED
|
@@ -5,10 +5,13 @@ This roadmap owns the package's hooks, form coordination and session-registry im
|
|
|
5
5
|
## Built
|
|
6
6
|
|
|
7
7
|
- [x] Opt-in `keepPreviousData` retains the last successful query value across payload changes, pending requests and failures; the default resets it. Registry replacement clears retained data, superseded responses do not replace the latest result, and disabling retention drops an inherited value. [Rendered query evidence](https://github.com/ShivaeDev/platform/blob/main/packages/effect-react/src/queryPayload.dom.spec.ts).
|
|
8
|
-
- [x] Public `testing.ts` render helpers supply an isolated native registry per mount, retain it on rerender, and dispose native resources and remove the container on idempotent unmount. [DOM evidence](https://github.com/ShivaeDev/platform/blob/main/packages/effect-react/src/client/testing.dom.test.tsx) also exercises query refetch after a command through a test RPC Layer; it does not establish browser networking.
|
|
8
|
+
- [x] Public `client/testing.ts` render helpers supply an isolated native registry per mount, retain it on rerender, and dispose native resources and remove the container on idempotent unmount. [DOM evidence](https://github.com/ShivaeDev/platform/blob/main/packages/effect-react/src/client/testing.dom.test.tsx) also exercises query refetch after a command through a test RPC Layer; it does not establish browser networking.
|
|
9
9
|
- [x] Native query and action hooks with inferred input/success/failure types, retained data, pending/refresh state and explicit refresh/dispatch methods. DOM tests cover query identity changes, shared query execution and latest-dispatch interruption; compiler fixtures cover types.
|
|
10
10
|
- [x] A session generation owning its client, registry and subtree, with replacement/sign-out cleanup, query Unauthorized rechecking and retained screens until the auth owner changes the session.
|
|
11
11
|
- [x] Unauthorized saves in `useCreate` and `useEditor` invoke the session callback exactly once and retain the draft and typed failure, including after rerendering and further edits. [Rendered save evidence](https://github.com/ShivaeDev/platform/blob/main/packages/effect-react/src/client/saveState.dom.test.tsx).
|
|
12
|
+
- [x] Unauthorized action failures invoke the session callback once per failed result and retain successful data and the typed cause, including after rerendering. [Rendered action evidence](https://github.com/ShivaeDev/platform/blob/main/packages/effect-react/src/client/sessionBoundary.dom.test.tsx).
|
|
13
|
+
- [x] Queries and actions preserve a successful `undefined` as `Option.some(undefined)` with settled pending/refreshing flags. Defect and interruption causes remain available, are not Unauthorized and do not request a session recheck. [Rendered result-state evidence](https://github.com/ShivaeDev/platform/blob/main/packages/effect-react/src/client/resultState.dom.test.ts).
|
|
14
|
+
- [x] `eventually` rethrows the last assertion failure after its three-second deadline; `expectNoReactWarnings` fails a test that logs to `console.error` and restores the spy even after that assertion fails. [Testing-helper evidence](https://github.com/ShivaeDev/platform/blob/main/packages/effect-react/src/client/testing.dom.test.tsx).
|
|
12
15
|
- [x] Session cleanup across StrictMode effect replay and Activity hiding, reveal and hidden unmount, with credential rotation tested against the chosen identity key.
|
|
13
16
|
- [x] `useEditor` composing query, fields and save Effect, with initial loading, per-query forms, per-field refresh/saved-result merges, normalized results and in-flight edits covered by rendered tests.
|
|
14
17
|
- [x] `useCreate` starting a fresh form after success while retaining fields edited during schema decoding or the request; submissions through the form API settle the hooks too.
|
|
@@ -18,8 +21,6 @@ This roadmap owns the package's hooks, form coordination and session-registry im
|
|
|
18
21
|
|
|
19
22
|
## Next
|
|
20
23
|
|
|
21
|
-
- [ ] Add direct rendered regressions for Unauthorized action failures invoking the session callback.
|
|
22
|
-
- [ ] Add explicit result-state regressions for a successful `undefined` value and causes containing defects or interruption before making stronger README guarantees about those cases.
|
|
23
24
|
- [ ] Verify changing hook configuration during one form lifetime before documenting any supported reconfiguration policy. Creation currently captures its initial configuration, and an editor holds submission functions per query identity.
|
|
24
25
|
|
|
25
26
|
## Open questions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/effect-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "React query, action, editor and session hooks for native Effect atoms",
|
|
5
5
|
"homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/effect-react#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -20,101 +20,15 @@
|
|
|
20
20
|
"source": "./src/*.ts",
|
|
21
21
|
"types": "./dist/*.d.ts",
|
|
22
22
|
"default": "./dist/*.js"
|
|
23
|
-
},
|
|
24
|
-
"#create.ts": {
|
|
25
|
-
"source": "./src/client/create.ts",
|
|
26
|
-
"types": "./dist/client/create.d.ts",
|
|
27
|
-
"default": "./dist/client/create.js"
|
|
28
|
-
},
|
|
29
|
-
"#editor.ts": {
|
|
30
|
-
"source": "./src/client/editor.ts",
|
|
31
|
-
"types": "./dist/client/editor.d.ts",
|
|
32
|
-
"default": "./dist/client/editor.js"
|
|
33
|
-
},
|
|
34
|
-
"#result-state.ts": {
|
|
35
|
-
"source": "./src/client/resultState.ts",
|
|
36
|
-
"types": "./dist/client/resultState.d.ts",
|
|
37
|
-
"default": "./dist/client/resultState.js"
|
|
38
|
-
},
|
|
39
|
-
"#save-state.ts": {
|
|
40
|
-
"source": "./src/client/saveState.ts",
|
|
41
|
-
"types": "./dist/client/saveState.d.ts",
|
|
42
|
-
"default": "./dist/client/saveState.js"
|
|
43
|
-
},
|
|
44
|
-
"#session-boundary.ts": {
|
|
45
|
-
"source": "./src/client/sessionBoundary.ts",
|
|
46
|
-
"types": "./dist/client/sessionBoundary.d.ts",
|
|
47
|
-
"default": "./dist/client/sessionBoundary.js"
|
|
48
|
-
},
|
|
49
|
-
"#testing.ts": {
|
|
50
|
-
"source": "./src/client/testing.ts",
|
|
51
|
-
"types": "./dist/client/testing.d.ts",
|
|
52
|
-
"default": "./dist/client/testing.js"
|
|
53
23
|
}
|
|
54
24
|
},
|
|
55
25
|
"exports": {
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
"types": "./dist
|
|
59
|
-
"
|
|
60
|
-
"import": "./dist/loadQuery.js",
|
|
61
|
-
"default": "./dist/loadQuery.js"
|
|
62
|
-
},
|
|
63
|
-
"./loadQuery.ts": null,
|
|
64
|
-
"./create.ts": {
|
|
65
|
-
"types": "./dist/client/create.d.ts",
|
|
66
|
-
"source": "./src/client/create.ts",
|
|
67
|
-
"import": "./dist/client/create.js",
|
|
68
|
-
"default": "./dist/client/create.js"
|
|
69
|
-
},
|
|
70
|
-
"./editor.ts": {
|
|
71
|
-
"types": "./dist/client/editor.d.ts",
|
|
72
|
-
"source": "./src/client/editor.ts",
|
|
73
|
-
"import": "./dist/client/editor.js",
|
|
74
|
-
"default": "./dist/client/editor.js"
|
|
75
|
-
},
|
|
76
|
-
"./field-rejection.ts": {
|
|
77
|
-
"types": "./dist/field-rejection.d.ts",
|
|
78
|
-
"source": "./src/field-rejection.ts",
|
|
79
|
-
"import": "./dist/field-rejection.js",
|
|
80
|
-
"default": "./dist/field-rejection.js"
|
|
81
|
-
},
|
|
82
|
-
"./result-state.ts": {
|
|
83
|
-
"types": "./dist/client/resultState.d.ts",
|
|
84
|
-
"source": "./src/client/resultState.ts",
|
|
85
|
-
"import": "./dist/client/resultState.js",
|
|
86
|
-
"default": "./dist/client/resultState.js"
|
|
87
|
-
},
|
|
88
|
-
"./resume-signal.ts": {
|
|
89
|
-
"types": "./dist/resume-signal.d.ts",
|
|
90
|
-
"source": "./src/resume-signal.ts",
|
|
91
|
-
"import": "./dist/resume-signal.js",
|
|
92
|
-
"default": "./dist/resume-signal.js"
|
|
93
|
-
},
|
|
94
|
-
"./save-state.ts": {
|
|
95
|
-
"types": "./dist/client/saveState.d.ts",
|
|
96
|
-
"source": "./src/client/saveState.ts",
|
|
97
|
-
"import": "./dist/client/saveState.js",
|
|
98
|
-
"default": "./dist/client/saveState.js"
|
|
99
|
-
},
|
|
100
|
-
"./session-boundary.ts": {
|
|
101
|
-
"types": "./dist/client/sessionBoundary.d.ts",
|
|
102
|
-
"source": "./src/client/sessionBoundary.ts",
|
|
103
|
-
"import": "./dist/client/sessionBoundary.js",
|
|
104
|
-
"default": "./dist/client/sessionBoundary.js"
|
|
105
|
-
},
|
|
106
|
-
"./submission.ts": {
|
|
107
|
-
"types": "./dist/submission.d.ts",
|
|
108
|
-
"source": "./src/submission.ts",
|
|
109
|
-
"import": "./dist/submission.js",
|
|
110
|
-
"default": "./dist/submission.js"
|
|
26
|
+
"./*.ts": {
|
|
27
|
+
"source": "./src/*.ts",
|
|
28
|
+
"types": "./dist/*.d.ts",
|
|
29
|
+
"default": "./dist/*.js"
|
|
111
30
|
},
|
|
112
|
-
"./
|
|
113
|
-
"types": "./dist/client/testing.d.ts",
|
|
114
|
-
"source": "./src/client/testing.ts",
|
|
115
|
-
"import": "./dist/client/testing.js",
|
|
116
|
-
"default": "./dist/client/testing.js"
|
|
117
|
-
}
|
|
31
|
+
"./package.json": "./package.json"
|
|
118
32
|
},
|
|
119
33
|
"files": [
|
|
120
34
|
"dist",
|
|
@@ -129,29 +43,29 @@
|
|
|
129
43
|
"README.md"
|
|
130
44
|
],
|
|
131
45
|
"dependencies": {
|
|
132
|
-
"@shivaedev/effect-contract": "0.5.
|
|
133
|
-
"@shivaedev/effect-form": "0.
|
|
46
|
+
"@shivaedev/effect-contract": "0.5.1",
|
|
47
|
+
"@shivaedev/effect-form": "0.5.0"
|
|
134
48
|
},
|
|
135
49
|
"devDependencies": {
|
|
136
50
|
"@effect/atom-react": "4.0.4",
|
|
137
51
|
"@effect/platform-node": "4.0.4",
|
|
138
52
|
"@effect/sql-pg": "4.0.4",
|
|
139
53
|
"@effect/sql-sqlite-node": "4.0.4",
|
|
140
|
-
"@shivaedev/effect-pg-boss": "0.
|
|
141
|
-
"@shivaedev/effect-service": "0.
|
|
142
|
-
"@shivaedev/effect-sql": "0.
|
|
143
|
-
"@shivaedev/effect-test": "0.
|
|
144
|
-
"@shivaedev/local-postgres": "0.
|
|
145
|
-
"@shivaedev/platform": "0.
|
|
146
|
-
"@shivaedev/quality": "0.
|
|
147
|
-
"@shivaedev/test-story": "0.
|
|
148
|
-
"@tanstack/react-router": "1.170.
|
|
149
|
-
"@types/node": "24.19.
|
|
54
|
+
"@shivaedev/effect-pg-boss": "0.9.0",
|
|
55
|
+
"@shivaedev/effect-service": "0.4.0",
|
|
56
|
+
"@shivaedev/effect-sql": "0.5.1",
|
|
57
|
+
"@shivaedev/effect-test": "0.6.0",
|
|
58
|
+
"@shivaedev/local-postgres": "0.4.0",
|
|
59
|
+
"@shivaedev/platform": "0.16.0",
|
|
60
|
+
"@shivaedev/quality": "0.25.0",
|
|
61
|
+
"@shivaedev/test-story": "0.7.1",
|
|
62
|
+
"@tanstack/react-router": "1.170.42",
|
|
63
|
+
"@types/node": "24.19.2",
|
|
150
64
|
"@types/react": "19.3.0",
|
|
151
65
|
"@types/react-dom": "19.3.0",
|
|
152
66
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
153
67
|
"effect": "4.0.4",
|
|
154
|
-
"happy-dom": "20.14.
|
|
68
|
+
"happy-dom": "20.14.6",
|
|
155
69
|
"react": "19.3.0",
|
|
156
70
|
"react-dom": "19.3.0",
|
|
157
71
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
@@ -159,7 +73,7 @@
|
|
|
159
73
|
},
|
|
160
74
|
"peerDependencies": {
|
|
161
75
|
"@effect/atom-react": "4.0.4",
|
|
162
|
-
"@tanstack/react-router": "1.170.
|
|
76
|
+
"@tanstack/react-router": "1.170.42",
|
|
163
77
|
"effect": "4.0.4",
|
|
164
78
|
"react": "19.3.0",
|
|
165
79
|
"react-dom": "19.3.0",
|
package/src/client/create.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Effect, Equal, Option, type Schema } from "effect";
|
|
2
2
|
import type * as Atom from "effect/reactivity/Atom";
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
|
-
import { type BrowserDraftConfig, usePersistedDraft } from "@shivaedev/effect-form/react.ts";
|
|
4
|
+
import { type BrowserDraftConfig, usePersistedDraft } from "@shivaedev/effect-form/client/react.ts";
|
|
5
5
|
import type { Decoded, Encoded, FieldFailure, Fields, Form, Services } from "@shivaedev/effect-form/shape.ts";
|
|
6
|
-
import type { AtomServices, FieldRejectionMapping } from "#
|
|
6
|
+
import type { AtomServices, FieldRejectionMapping } from "#fieldRejection.ts";
|
|
7
7
|
import { submission } from "#submission.ts";
|
|
8
8
|
import { type SaveState, useSaveState } from "./saveState.ts";
|
|
9
9
|
export type CreateConfig<TFields extends Fields, TCreated, TSaveError, R, TRuntimeError> = {
|
package/src/client/editor.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { type Effect, Option, type Schema } from "effect";
|
|
|
2
2
|
import type * as AsyncResult from "effect/reactivity/AsyncResult";
|
|
3
3
|
import type * as Atom from "effect/reactivity/Atom";
|
|
4
4
|
import { useCallback, useEffect, useState } from "react";
|
|
5
|
-
import { type BrowserDraftConfig, usePersistedDraft } from "@shivaedev/effect-form/react.ts";
|
|
5
|
+
import { type BrowserDraftConfig, usePersistedDraft } from "@shivaedev/effect-form/client/react.ts";
|
|
6
6
|
import type { Decoded, Encoded, FieldFailure, Fields, Form, Services } from "@shivaedev/effect-form/shape.ts";
|
|
7
|
-
import type { AtomServices, FieldRejectionMapping } from "#
|
|
7
|
+
import type { AtomServices, FieldRejectionMapping } from "#fieldRejection.ts";
|
|
8
8
|
import { submission } from "#submission.ts";
|
|
9
9
|
import { type QueryState, useQuery } from "./resultState.ts";
|
|
10
10
|
import { type SaveState, useSaveState } from "./saveState.ts";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RegistryContext } from "@effect/atom-react";
|
|
2
2
|
import * as AtomRegistry from "effect/reactivity/AtomRegistry";
|
|
3
3
|
import { createContext, createElement, Fragment, type ReactNode, useContext, useEffect, useState } from "react";
|
|
4
|
-
import { DraftSessionContext } from "@shivaedev/effect-form/react.ts";
|
|
4
|
+
import { DraftSessionContext } from "@shivaedev/effect-form/client/react.ts";
|
|
5
5
|
import { useDraftOwner } from "./useDraftOwner.ts";
|
|
6
6
|
export interface SessionBoundaryProps<TSession, TClient> {
|
|
7
7
|
readonly children: (client: TClient) => ReactNode;
|
package/src/submission.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type * as Atom from "effect/reactivity/Atom";
|
|
|
3
3
|
import { make } from "@shivaedev/effect-form/form.ts";
|
|
4
4
|
import type { PersistedDraftConfig } from "@shivaedev/effect-form/persistence.ts";
|
|
5
5
|
import type { Decoded, Encoded, FieldFailure, Fields, Form, Services } from "@shivaedev/effect-form/shape.ts";
|
|
6
|
-
import { type AtomServices, type RejectField, rejecting } from "./
|
|
6
|
+
import { type AtomServices, type RejectField, rejecting } from "./fieldRejection.ts";
|
|
7
7
|
|
|
8
8
|
export interface SubmissionConfig<F extends Fields, A, E, R, ER> {
|
|
9
9
|
readonly fields: Schema.Struct<F>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-rejection.d.ts","sourceRoot":"","sources":["../src/field-rejection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC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 @@
|
|
|
1
|
-
{"version":3,"file":"resume-signal.js","sourceRoot":"","sources":["../src/resume-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,YAAY,IAAI,oBAAoB,GACpC,MAAM,sCAAsC,CAAC;AAK9C,MAAM,UAAU,YAAY,CAAC,OAAsB;IAClD,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC"}
|
|
File without changes
|
|
File without changes
|