@sjcx/vorma 0.0.0-pre.2 → 0.0.0-pre.3
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/dist/build/assemble-artifacts.d.ts +1 -1
- package/dist/build/bundle-client.d.ts +1 -1
- package/dist/build/cli.js +27 -37
- package/dist/build/compile-application.d.ts +2 -2
- package/dist/build/development-artifacts.d.ts +1 -1
- package/dist/build/development-build.d.ts +3 -6
- package/dist/build/development-work.d.ts +2 -3
- package/dist/build/generate-application.d.ts +2 -2
- package/dist/build/index.d.ts +2 -3
- package/dist/build/index.js +1 -1
- package/dist/build/inspect-projects.d.ts +3 -3
- package/dist/build/load-config.d.ts +0 -2
- package/dist/build/publish-artifacts.d.ts +1 -4
- package/dist/build/render-client-transport.d.ts +1 -1
- package/dist/build/render-server-generated.d.ts +1 -12
- package/dist/build/render-types.d.ts +1 -1
- package/dist/build/resolve-config.d.ts +2 -4
- package/dist/build/source-layout.d.ts +1 -1
- package/dist/{build-DcP5_DUV.js → build-sHSh5zaX.js} +67 -282
- package/package.json +5 -36
- package/dist/build/compile-server.d.ts +0 -42
- package/dist/client/assembly.d.ts +0 -40
- package/dist/client/browser-http-client.d.ts +0 -10
- package/dist/client/client-loaders.d.ts +0 -93
- package/dist/client/commit.d.ts +0 -41
- package/dist/client/contracts.d.ts +0 -192
- package/dist/client/core.d.ts +0 -45
- package/dist/client/development.d.ts +0 -16
- package/dist/client/document-recovery.d.ts +0 -4
- package/dist/client/endpoints.d.ts +0 -54
- package/dist/client/errors.d.ts +0 -87
- package/dist/client/freshness.d.ts +0 -51
- package/dist/client/head.d.ts +0 -14
- package/dist/client/history.d.ts +0 -25
- package/dist/client/index.d.ts +0 -80
- package/dist/client/index.js +0 -150
- package/dist/client/links.d.ts +0 -48
- package/dist/client/materialize.d.ts +0 -21
- package/dist/client/modules.d.ts +0 -2
- package/dist/client/navigation.d.ts +0 -47
- package/dist/client/payload.d.ts +0 -54
- package/dist/client/prefetch.d.ts +0 -28
- package/dist/client/prepare.d.ts +0 -47
- package/dist/client/projections.d.ts +0 -26
- package/dist/client/queries.d.ts +0 -33
- package/dist/client/react/application.d.ts +0 -87
- package/dist/client/react/hooks.d.ts +0 -36
- package/dist/client/react/index.d.ts +0 -5
- package/dist/client/react/index.js +0 -3237
- package/dist/client/react/link.d.ts +0 -27
- package/dist/client/react/view.d.ts +0 -86
- package/dist/client/request.d.ts +0 -16
- package/dist/client/route-context.d.ts +0 -31
- package/dist/client/route-matching.d.ts +0 -22
- package/dist/client/route-synchronization.d.ts +0 -30
- package/dist/client/route-url.d.ts +0 -5
- package/dist/client/runtime.d.ts +0 -82
- package/dist/client/scroll.d.ts +0 -16
- package/dist/client/services.d.ts +0 -34
- package/dist/client/state.d.ts +0 -102
- package/dist/client/static-assets.d.ts +0 -3
- package/dist/client/stylesheets.d.ts +0 -7
- package/dist/client/transport-type-entries.d.ts +0 -2
- package/dist/client/types.d.ts +0 -152
- package/dist/client/view-definition.d.ts +0 -24
- package/dist/client/work-indicator.d.ts +0 -18
- package/dist/compile-Me8EOyMK.js +0 -870
- package/dist/development-B_rxuwY7.js +0 -128
- package/dist/hash-set-BPx3iXec.js +0 -141
- package/dist/href-Cqyax8Y0.js +0 -357
- package/dist/materialize-DZ7VSLFk.js +0 -739
- package/dist/metadata-BoPKo-G2.js +0 -32
- package/dist/primitives/tasks/index.d.ts +0 -1
- package/dist/primitives/tasks/index.js +0 -1
- package/dist/route-context-CtY_9U_W.js +0 -559
- package/dist/route-matching-D_uSG2P9.js +0 -33
- package/dist/search-parse-0f7oqVsG.js +0 -375
- package/dist/server/config/index.d.ts +0 -36
- package/dist/server/config/index.js +0 -30
- package/dist/server/development/metadata.d.ts +0 -11
- package/dist/server/document.d.ts +0 -37
- package/dist/server/form-data.d.ts +0 -21
- package/dist/server/graph/compile.d.ts +0 -118
- package/dist/server/graph/declarations.d.ts +0 -117
- package/dist/server/graph/literal-error-tag.d.ts +0 -14
- package/dist/server/graph/pattern-conflicts.d.ts +0 -36
- package/dist/server/graph/search-schema.d.ts +0 -13
- package/dist/server/graph/transport-schema.d.ts +0 -11
- package/dist/server/index.d.ts +0 -310
- package/dist/server/index.js +0 -2311
- package/dist/server/public-assets.d.ts +0 -18
- package/dist/server/runtime/application.d.ts +0 -15
- package/dist/server/runtime/assets.d.ts +0 -15
- package/dist/server/runtime/context.d.ts +0 -96
- package/dist/server/runtime/domain-errors.d.ts +0 -11
- package/dist/server/runtime/effects.d.ts +0 -83
- package/dist/server/runtime/execute.d.ts +0 -13
- package/dist/server/runtime/finalize.d.ts +0 -44
- package/dist/server/runtime/handler.d.ts +0 -106
- package/dist/server/runtime/head.d.ts +0 -22
- package/dist/server/runtime/payload.d.ts +0 -50
- package/dist/server/runtime/pipeline.d.ts +0 -27
- package/dist/server/runtime/plan.d.ts +0 -98
- package/dist/server/runtime/render-document.d.ts +0 -16
- package/dist/server/runtime/startup-error.d.ts +0 -11
- package/dist/server/runtime/transport-type-entries.d.ts +0 -2
- package/dist/server/runtime/vercel-deployment.d.ts +0 -2
- package/dist/server/url-pathname.d.ts +0 -13
- package/dist/static-assets-BrH3O0M8.js +0 -199
- package/dist/universal/generated-types.d.ts +0 -9
- package/dist/universal/href.d.ts +0 -17
- package/dist/universal/http-method.d.ts +0 -4
- package/dist/universal/json-transport.d.ts +0 -14
- package/dist/universal/null-prototype-record.d.ts +0 -7
- package/dist/universal/path-wire.d.ts +0 -71
- package/dist/universal/pattern-language.d.ts +0 -4
- package/dist/universal/protocol-schemas.d.ts +0 -99
- package/dist/universal/protocol.d.ts +0 -162
- package/dist/universal/search-grammar.d.ts +0 -7
- package/dist/universal/search-parse.d.ts +0 -22
- package/dist/universal/search-serialize.d.ts +0 -16
- package/dist/universal/search-shape.d.ts +0 -32
- package/dist/universal/static-assets.d.ts +0 -2
- package/dist/universal/transport-types/big-decimal.d.ts +0 -13
- package/dist/universal/transport-types/chunk.d.ts +0 -8
- package/dist/universal/transport-types/date-time-utc.d.ts +0 -13
- package/dist/universal/transport-types/date-time-zoned.d.ts +0 -13
- package/dist/universal/transport-types/duration.d.ts +0 -13
- package/dist/universal/transport-types/hash-map.d.ts +0 -8
- package/dist/universal/transport-types/hash-set.d.ts +0 -8
- package/dist/universal/transport-types/option.d.ts +0 -10
- package/dist/universal/transport-types/redacted.d.ts +0 -9
- package/dist/universal/value-transport.d.ts +0 -117
- package/dist/value-transport-Bst4Hk-n.js +0 -864
- /package/dist/{universal → build}/content-digest.d.ts +0 -0
package/dist/client/head.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Result } from "effect";
|
|
2
|
-
import type { HeadElementWire } from "../universal/protocol-schemas.ts";
|
|
3
|
-
export type HeadSections = {
|
|
4
|
-
readonly title: HeadElementWire | undefined;
|
|
5
|
-
readonly meta: ReadonlyArray<HeadElementWire>;
|
|
6
|
-
readonly rest: ReadonlyArray<HeadElementWire>;
|
|
7
|
-
};
|
|
8
|
-
export type HeadReconciliationError = {
|
|
9
|
-
readonly _tag: "HeadReconciliationError";
|
|
10
|
-
readonly message: string;
|
|
11
|
-
};
|
|
12
|
-
export declare function applyHead(sections: HeadSections): Result.Result<void, HeadReconciliationError>;
|
|
13
|
-
/** Reads the server-rendered head state from the three managed regions. */
|
|
14
|
-
export declare function readDocumentHead(): Result.Result<HeadSections, HeadReconciliationError>;
|
package/dist/client/history.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Result } from "effect";
|
|
2
|
-
import type { ScrollPosition } from "./scroll.ts";
|
|
3
|
-
export type BrowserPosition = {
|
|
4
|
-
readonly href: string;
|
|
5
|
-
readonly userState: unknown;
|
|
6
|
-
readonly key: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
export type HistoryStateError = {
|
|
9
|
-
readonly _tag: "HistoryStateError";
|
|
10
|
-
readonly message: string;
|
|
11
|
-
readonly cause: unknown;
|
|
12
|
-
};
|
|
13
|
-
export declare function createEntryKey(): string;
|
|
14
|
-
/** Reads native user state and Vorma's entry key without imposing a user-data codec. */
|
|
15
|
-
export declare function readBrowserPosition(): Result.Result<BrowserPosition, HistoryStateError>;
|
|
16
|
-
/** Writes a new or replaced history entry and returns the position it produced. */
|
|
17
|
-
export declare function writeBrowserPosition(input: {
|
|
18
|
-
readonly href: string;
|
|
19
|
-
readonly replace: boolean;
|
|
20
|
-
readonly userState: unknown;
|
|
21
|
-
readonly key: string;
|
|
22
|
-
}): Result.Result<BrowserPosition, HistoryStateError>;
|
|
23
|
-
/** Remembers the scroll position of the entry `key` names. */
|
|
24
|
-
export declare function rememberScroll(key: string, scroll: ScrollPosition): void;
|
|
25
|
-
export declare function recallScroll(key: string): ScrollPosition | undefined;
|
package/dist/client/index.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { Effect, Result, Stream } from "effect";
|
|
2
|
-
import type { Atom } from "effect/unstable/reactivity";
|
|
3
|
-
import type { MissingGeneratedApplicationKey } from "../universal/generated-types.ts";
|
|
4
|
-
import type { EndpointCallFailure, EndpointCallOutput, MutationEndpointCallInput, NavigationTargetInput, QueryEndpointCallInput } from "./contracts.ts";
|
|
5
|
-
import type { EndpointFrameworkError, MutationSettlement } from "./endpoints.ts";
|
|
6
|
-
import { InputError, NavigationError, PrefetchError, type QueryRedirected, type RevalidationError } from "./errors.ts";
|
|
7
|
-
import { type LinkMatchRules, type LinkState } from "./links.ts";
|
|
8
|
-
import type { QueryEndpointOutput } from "./queries.ts";
|
|
9
|
-
import { ClientCoordinator } from "./runtime.ts";
|
|
10
|
-
import type { ClientEvent, NavigationOptions, NavigationResult, RevalidationResult } from "./types.ts";
|
|
11
|
-
export type { WorkIndicatorOptions } from "./work-indicator.ts";
|
|
12
|
-
/** Application contract catalogue supplied by Vorma's generated declarations. */
|
|
13
|
-
export interface ClientApplicationContracts {
|
|
14
|
-
}
|
|
15
|
-
type RegisteredAssetKey = ClientApplicationContracts extends {
|
|
16
|
-
readonly assets: infer Key extends string;
|
|
17
|
-
} ? Key | `/${Key}` : MissingGeneratedApplicationKey;
|
|
18
|
-
/**
|
|
19
|
-
* The hashed URL of a public asset, typed by the generated asset keys. The
|
|
20
|
-
* build requires a string literal argument and replaces each call with that
|
|
21
|
-
* asset's hashed URL. This function body exists so that imports and re-exports
|
|
22
|
-
* of `getPublicUrl` are valid JavaScript; a correct client build replaces every
|
|
23
|
-
* call, and the bundler then removes the unused function from the output.
|
|
24
|
-
*/
|
|
25
|
-
export declare function getPublicUrl(_key: RegisteredAssetKey): string;
|
|
26
|
-
export type { BuildMismatch, ClientBootError, ClientEvent, ClientLifecycle, FailureSource, NavigationOptions, NavigationResult, NavigationSource, NavigationState, OperationId, OperationKind, OperationPhase, OperationState, PendingNavigation, PendingPrefetch, PendingRevalidation, PublicRouteError, BoundaryError, RequestKind, RevalidationResult, RevalidationState, RouteError, RouteErrorSource, RouteMatchSummary, RouteState, RouteUpdateReason, WorkState, } from "./types.ts";
|
|
27
|
-
export type { AnyRouteMatch, ClientLoaderData, ClientLoaderState, ClientLoaderRoutePattern, EndpointCallFailure, EndpointCallOutput, EndpointRequestOptions, LoaderData, LoaderRoutePattern, MutationEndpointCallInput, QueryEndpointCallInput, RawHrefTarget, RouteInput, RouteMatch, RoutePattern, RouteTarget, RouteUrlInput, } from "./contracts.ts";
|
|
28
|
-
export type { TransportTypeEntry } from "../universal/value-transport.ts";
|
|
29
|
-
export { optionTransportType } from "../universal/transport-types/option.ts";
|
|
30
|
-
export { redactedTransportType } from "../universal/transport-types/redacted.ts";
|
|
31
|
-
export { chunkTransportType } from "../universal/transport-types/chunk.ts";
|
|
32
|
-
export { durationTransportType } from "../universal/transport-types/duration.ts";
|
|
33
|
-
export { bigDecimalTransportType } from "../universal/transport-types/big-decimal.ts";
|
|
34
|
-
export { dateTimeUtcTransportType } from "../universal/transport-types/date-time-utc.ts";
|
|
35
|
-
export { dateTimeZonedTransportType } from "../universal/transport-types/date-time-zoned.ts";
|
|
36
|
-
export { hashMapTransportType } from "../universal/transport-types/hash-map.ts";
|
|
37
|
-
export { hashSetTransportType } from "../universal/transport-types/hash-set.ts";
|
|
38
|
-
export type { ClientRequestContext, PrepareRequestFn } from "./request.ts";
|
|
39
|
-
export { synchronizeRoute, type RouteSynchronizationOptions, } from "./route-synchronization.ts";
|
|
40
|
-
export { toHref } from "./route-url.ts";
|
|
41
|
-
export type { EndpointFrameworkError, MutationSettlement, ResponseMetadata, QueryResponse, } from "./endpoints.ts";
|
|
42
|
-
export type { ClientLoaderTrigger } from "./client-loaders.ts";
|
|
43
|
-
export { createQueryAtom, type QueryAtom, type QueryEndpointOutput, } from "./queries.ts";
|
|
44
|
-
export type { ClientLoaderContext } from "./contracts.ts";
|
|
45
|
-
export { getClientLoaderDataAtom, getLoaderDataAtom, getRouteMatchAtom, type RouteContext, } from "./route-context.ts";
|
|
46
|
-
export { type LinkMatchRules, type LinkState } from "./links.ts";
|
|
47
|
-
export { BuildMismatchError, HandlerError, CancelledByDedupeKeyError, InputError, NavigationError, PrefetchError, QueryRedirected, RevalidationError, TransportError, type QueryNavigation, } from "./errors.ts";
|
|
48
|
-
export { type ClientCoordinator, clientRuntime, universalRuntime, type ClientUnavailableError, } from "./runtime.ts";
|
|
49
|
-
export declare function getRouteStateAtom(): Atom.Atom<import("effect/Option").Option<import("./types.ts").RouteState>>;
|
|
50
|
-
export declare function getNavigationStateAtom(): Atom.Atom<import("./types.ts").NavigationState>;
|
|
51
|
-
export declare function getRevalidationStateAtom(): Atom.Atom<import("./types.ts").RevalidationState>;
|
|
52
|
-
export declare function getWorkStateAtom(): Atom.Atom<import("./types.ts").WorkState>;
|
|
53
|
-
/** Includes an Effect in the work indicator until it succeeds, fails, or is interrupted. */
|
|
54
|
-
export declare function trackWork<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R | ClientCoordinator>;
|
|
55
|
-
export declare function getWorkIndicatorActiveAtom(): Atom.Atom<boolean>;
|
|
56
|
-
export declare function getBuildMismatchAtom(): Atom.Atom<import("effect/Option").Option<import("./types.ts").BuildMismatch>>;
|
|
57
|
-
/** Native atom retention owns the last observed settlement after active work retires. */
|
|
58
|
-
export { getOperationStateAtom } from "./projections.ts";
|
|
59
|
-
/** Subscribe to each framework event from this mounted application's lifetime. */
|
|
60
|
-
export declare function observeClientEvents(): Stream.Stream<ClientEvent, never, ClientCoordinator>;
|
|
61
|
-
/** Starts a navigation and observes its typed outcome. */
|
|
62
|
-
export declare function navigate(input: NavigationTargetInput & NavigationOptions): Effect.Effect<NavigationResult, NavigationError, ClientCoordinator>;
|
|
63
|
-
/** Prepares a destination for promotion while the Effect runs; readiness completes it. */
|
|
64
|
-
export declare function prefetch(input: NavigationTargetInput & {
|
|
65
|
-
readonly skipWorkIndicator?: boolean;
|
|
66
|
-
}): Effect.Effect<void, PrefetchError, ClientCoordinator>;
|
|
67
|
-
/** The active and pending facts of a link target under its match rules; a target that does not encode has no link state. */
|
|
68
|
-
export declare function getLinkStateAtom(input: NavigationTargetInput & {
|
|
69
|
-
readonly matchRules?: LinkMatchRules;
|
|
70
|
-
}): Result.Result<Atom.Atom<LinkState>, InputError>;
|
|
71
|
-
/** Retires every value of the current session, refreshes the committed route and active queries, and awaits the result. */
|
|
72
|
-
export declare function invalidateClientData(): Effect.Effect<RevalidationResult, RevalidationError, ClientCoordinator>;
|
|
73
|
-
/** Registers fresh-data demand for the committed route and awaits its qualifying result. */
|
|
74
|
-
export declare function revalidate(options?: {
|
|
75
|
-
readonly skipWorkIndicator?: boolean;
|
|
76
|
-
}): Effect.Effect<RevalidationResult, RevalidationError, ClientCoordinator>;
|
|
77
|
-
/** Returns decoded query data and response metadata; a redirect surfaces as a typed navigation handoff. */
|
|
78
|
-
export declare function queryEndpoint<const Input extends QueryEndpointCallInput>(input: Input): Effect.Effect<QueryEndpointOutput<Input>, EndpointCallFailure<Input, EndpointFrameworkError | QueryRedirected>, ClientCoordinator>;
|
|
79
|
-
/** Observes an application-owned mutation settlement and its scheduled refresh. */
|
|
80
|
-
export declare function mutateEndpoint<const Input extends MutationEndpointCallInput>(input: Input): Effect.Effect<MutationSettlement<EndpointCallOutput<Input>>, EndpointCallFailure<Input, EndpointFrameworkError>, ClientCoordinator>;
|
package/dist/client/index.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { A as routeStateAtom, B as RevalidationError, F as HandlerError, I as InputError, L as NavigationError, N as BuildMismatchError, O as refreshEpochAtom, P as CancelledByDedupeKeyError, R as PrefetchError, S as buildMismatchAtom, T as navigationStateAtom, V as TransportError, d as ClientCoordinator, f as clientRuntime, g as toHref, h as universalRuntime, i as getRouteMatchAtom, j as workStateAtom, k as revalidationStateAtom, l as workIndicatorActiveAtom, n as getClientLoaderDataAtom, r as getLoaderDataAtom, s as synchronizeRoute, w as getOperationStateAtom, x as getLinkStateAtomFor, z as QueryRedirected } from "../route-context-CtY_9U_W.js";
|
|
2
|
-
import { a as bigDecimalTransportType, c as redactedTransportType, i as dateTimeUtcTransportType, l as optionTransportType, n as hashMapTransportType, o as durationTransportType, r as dateTimeZonedTransportType, s as chunkTransportType, t as hashSetTransportType } from "../hash-set-BPx3iXec.js";
|
|
3
|
-
import { Cause, Context, Effect, Exit, Option, Result, Stream } from "effect";
|
|
4
|
-
import { AsyncResult, Atom } from "effect/unstable/reactivity";
|
|
5
|
-
//#region src/client/queries.ts
|
|
6
|
-
function createQueryAtom(input) {
|
|
7
|
-
const id = crypto.randomUUID();
|
|
8
|
-
const requestAtom = Atom.isAtom(input.request) ? input.request : Atom.make(Option.some(input.request));
|
|
9
|
-
const reading = input.runtime.atom((get) => {
|
|
10
|
-
const request = get(requestAtom);
|
|
11
|
-
get(refreshEpochAtom);
|
|
12
|
-
const computation = {
|
|
13
|
-
id,
|
|
14
|
-
token: Symbol("vorma/query-computation")
|
|
15
|
-
};
|
|
16
|
-
const runtime = get(input.runtime);
|
|
17
|
-
const coordinatorNow = AsyncResult.isSuccess(runtime) ? Context.getOption(runtime.value, ClientCoordinator) : Option.none();
|
|
18
|
-
if (Option.isSome(coordinatorNow) && Option.isSome(request)) coordinatorNow.value.queries.expect(computation);
|
|
19
|
-
return Effect.gen(function* () {
|
|
20
|
-
if (Option.isNone(request)) return yield* Effect.never;
|
|
21
|
-
const coordinator = yield* ClientCoordinator;
|
|
22
|
-
yield* Effect.addFinalizer(() => {
|
|
23
|
-
return Effect.sync(() => coordinator.queries.release(computation));
|
|
24
|
-
});
|
|
25
|
-
let dispatched;
|
|
26
|
-
const exit = yield* Effect.exit(coordinator.endpoints.read(request.value, (facts) => {
|
|
27
|
-
dispatched = facts;
|
|
28
|
-
}));
|
|
29
|
-
if (Exit.isSuccess(exit) || !Cause.hasInterruptsOnly(exit.cause)) coordinator.queries.acknowledge({
|
|
30
|
-
id,
|
|
31
|
-
dispatched,
|
|
32
|
-
success: Exit.isSuccess(exit)
|
|
33
|
-
});
|
|
34
|
-
return Exit.isSuccess(exit) ? exit.value : yield* Effect.failCause(exit.cause);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
return Atom.readable((get) => {
|
|
38
|
-
return Option.isNone(get(requestAtom)) ? AsyncResult.initial() : get(reading);
|
|
39
|
-
}, (refresh) => refresh(reading));
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/client/index.ts
|
|
43
|
-
/**
|
|
44
|
-
* The hashed URL of a public asset, typed by the generated asset keys. The
|
|
45
|
-
* build requires a string literal argument and replaces each call with that
|
|
46
|
-
* asset's hashed URL. This function body exists so that imports and re-exports
|
|
47
|
-
* of `getPublicUrl` are valid JavaScript; a correct client build replaces every
|
|
48
|
-
* call, and the bundler then removes the unused function from the output.
|
|
49
|
-
*/
|
|
50
|
-
function getPublicUrl(_key) {
|
|
51
|
-
throw new Error("Vorma's client build did not replace getPublicUrl with a public asset URL");
|
|
52
|
-
}
|
|
53
|
-
function getRouteStateAtom() {
|
|
54
|
-
return routeStateAtom;
|
|
55
|
-
}
|
|
56
|
-
function getNavigationStateAtom() {
|
|
57
|
-
return navigationStateAtom;
|
|
58
|
-
}
|
|
59
|
-
function getRevalidationStateAtom() {
|
|
60
|
-
return revalidationStateAtom;
|
|
61
|
-
}
|
|
62
|
-
function getWorkStateAtom() {
|
|
63
|
-
return workStateAtom;
|
|
64
|
-
}
|
|
65
|
-
/** Includes an Effect in the work indicator until it succeeds, fails, or is interrupted. */
|
|
66
|
-
function trackWork(effect) {
|
|
67
|
-
return Effect.flatMap(ClientCoordinator, (coordinator) => coordinator.trackWork(effect));
|
|
68
|
-
}
|
|
69
|
-
function getWorkIndicatorActiveAtom() {
|
|
70
|
-
return workIndicatorActiveAtom;
|
|
71
|
-
}
|
|
72
|
-
function getBuildMismatchAtom() {
|
|
73
|
-
return buildMismatchAtom;
|
|
74
|
-
}
|
|
75
|
-
/** Subscribe to each framework event from this mounted application's lifetime. */
|
|
76
|
-
function observeClientEvents() {
|
|
77
|
-
return Stream.unwrap(Effect.map(ClientCoordinator, (coordinator) => coordinator.events));
|
|
78
|
-
}
|
|
79
|
-
/** Starts a navigation and observes its typed outcome. */
|
|
80
|
-
function navigate(input) {
|
|
81
|
-
return Effect.flatMap(ClientCoordinator, (coordinator) => {
|
|
82
|
-
const href = toHref(input);
|
|
83
|
-
if (Result.isFailure(href)) return Effect.fail(new NavigationError({
|
|
84
|
-
stage: "target",
|
|
85
|
-
cause: Cause.fail(href.failure)
|
|
86
|
-
}));
|
|
87
|
-
const options = {
|
|
88
|
-
...input.replace === void 0 ? {} : { replace: input.replace },
|
|
89
|
-
...input.scrollToTop === void 0 ? {} : { scrollToTop: input.scrollToTop },
|
|
90
|
-
...input.scrollToFragment === void 0 ? {} : { scrollToFragment: input.scrollToFragment },
|
|
91
|
-
...input.historyState === void 0 ? {} : { historyState: input.historyState },
|
|
92
|
-
...input.skipWorkIndicator === void 0 ? {} : { skipWorkIndicator: input.skipWorkIndicator }
|
|
93
|
-
};
|
|
94
|
-
return coordinator.navigation.navigate(href.success, options);
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
/** Prepares a destination for promotion while the Effect runs; readiness completes it. */
|
|
98
|
-
function prefetch(input) {
|
|
99
|
-
return Effect.flatMap(ClientCoordinator, (coordinator) => {
|
|
100
|
-
const href = toHref(input);
|
|
101
|
-
const url = Result.flatMap(href, (value) => {
|
|
102
|
-
return Result.try(() => new URL(value, window.location.href));
|
|
103
|
-
});
|
|
104
|
-
if (Result.isFailure(url)) return Effect.fail(new PrefetchError({
|
|
105
|
-
reason: "target",
|
|
106
|
-
cause: url.failure
|
|
107
|
-
}));
|
|
108
|
-
if (url.success.origin !== window.location.origin) return Effect.fail(new PrefetchError({
|
|
109
|
-
reason: "target",
|
|
110
|
-
cause: "A prefetch target must be on the application's origin"
|
|
111
|
-
}));
|
|
112
|
-
return coordinator.prefetch.awaitReadiness(url.success, { skipWorkIndicator: input.skipWorkIndicator === true });
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
/** The active and pending facts of a link target under its match rules; a target that does not encode has no link state. */
|
|
116
|
-
function getLinkStateAtom(input) {
|
|
117
|
-
return Result.map(toHref(input), (href) => {
|
|
118
|
-
return getLinkStateAtomFor({
|
|
119
|
-
href,
|
|
120
|
-
pattern: input.pattern,
|
|
121
|
-
rules: input.matchRules
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
/** Retires every value of the current session, refreshes the committed route and active queries, and awaits the result. */
|
|
126
|
-
function invalidateClientData() {
|
|
127
|
-
return Effect.flatMap(ClientCoordinator, (coordinator) => {
|
|
128
|
-
return coordinator.navigation.invalidate();
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
/** Registers fresh-data demand for the committed route and awaits its qualifying result. */
|
|
132
|
-
function revalidate(options) {
|
|
133
|
-
return Effect.flatMap(ClientCoordinator, (coordinator) => {
|
|
134
|
-
return coordinator.navigation.revalidate({ skipWorkIndicator: options?.skipWorkIndicator === true });
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/** Returns decoded query data and response metadata; a redirect surfaces as a typed navigation handoff. */
|
|
138
|
-
function queryEndpoint(input) {
|
|
139
|
-
return Effect.flatMap(ClientCoordinator, (coordinator) => {
|
|
140
|
-
return coordinator.endpoints.query(input);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
/** Observes an application-owned mutation settlement and its scheduled refresh. */
|
|
144
|
-
function mutateEndpoint(input) {
|
|
145
|
-
return Effect.flatMap(ClientCoordinator, (coordinator) => {
|
|
146
|
-
return coordinator.endpoints.mutate(input);
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
//#endregion
|
|
150
|
-
export { BuildMismatchError, CancelledByDedupeKeyError, HandlerError, InputError, NavigationError, PrefetchError, QueryRedirected, RevalidationError, TransportError, bigDecimalTransportType, chunkTransportType, clientRuntime, createQueryAtom, dateTimeUtcTransportType, dateTimeZonedTransportType, durationTransportType, getBuildMismatchAtom, getClientLoaderDataAtom, getLinkStateAtom, getLoaderDataAtom, getNavigationStateAtom, getOperationStateAtom, getPublicUrl, getRevalidationStateAtom, getRouteMatchAtom, getRouteStateAtom, getWorkIndicatorActiveAtom, getWorkStateAtom, hashMapTransportType, hashSetTransportType, invalidateClientData, mutateEndpoint, navigate, observeClientEvents, optionTransportType, prefetch, queryEndpoint, redactedTransportType, revalidate, synchronizeRoute, toHref, trackWork, universalRuntime };
|
package/dist/client/links.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Atom } from "effect/unstable/reactivity";
|
|
2
|
-
import type { ClientCoordinatorService } from "./runtime.ts";
|
|
3
|
-
export type LinkMatchRules = {
|
|
4
|
-
readonly skip?: boolean;
|
|
5
|
-
readonly includeSearch?: boolean;
|
|
6
|
-
readonly includeHash?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type LinkState = {
|
|
9
|
-
readonly active: {
|
|
10
|
-
readonly exact: boolean;
|
|
11
|
-
readonly ancestor: boolean;
|
|
12
|
-
};
|
|
13
|
-
readonly pending: {
|
|
14
|
-
readonly exact: boolean;
|
|
15
|
-
readonly ancestor: boolean;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
/** The active and pending facts of a resolved link target under its match rules. */
|
|
19
|
-
export declare function getLinkStateAtomFor(input: {
|
|
20
|
-
readonly href: string;
|
|
21
|
-
readonly pattern: string | undefined;
|
|
22
|
-
readonly rules: LinkMatchRules | undefined;
|
|
23
|
-
}): Atom.Atom<LinkState>;
|
|
24
|
-
/** The subset of pointer event fields the click predicates inspect. */
|
|
25
|
-
export type ClickFacts = {
|
|
26
|
-
readonly metaKey?: boolean;
|
|
27
|
-
readonly altKey?: boolean;
|
|
28
|
-
readonly ctrlKey?: boolean;
|
|
29
|
-
readonly shiftKey?: boolean;
|
|
30
|
-
readonly button?: number;
|
|
31
|
-
};
|
|
32
|
-
/** Whether a click may be intercepted: unmodified, primary, and targeting this browsing context. */
|
|
33
|
-
export declare function allowsInterception(event: ClickFacts, targetAttribute: string | undefined): boolean;
|
|
34
|
-
export type LinkIntent = {
|
|
35
|
-
/** Starts a prefetch observer after the supplied delay, or 100 ms when omitted. */
|
|
36
|
-
readonly begin: (source: "pointer" | "focus", delayMs: number | undefined) => void;
|
|
37
|
-
/** Records that the pointer or focus left; a pointer leaving during touch input is ignored. */
|
|
38
|
-
readonly end: (source: "pointer" | "focus") => void;
|
|
39
|
-
readonly reset: () => void;
|
|
40
|
-
};
|
|
41
|
-
/** Tracks whether the last pointer input was touch; the returned function detaches. */
|
|
42
|
-
export declare function attachPointerModalityTracking(): () => void;
|
|
43
|
-
/** One link's prefetch intent: an observer handle held from a pointer's or focus's arrival until either leaves. */
|
|
44
|
-
export declare function createLinkIntent(input: {
|
|
45
|
-
readonly coordinator: ClientCoordinatorService;
|
|
46
|
-
readonly getHrefFn: () => string;
|
|
47
|
-
readonly skipWorkIndicator: boolean;
|
|
48
|
-
}): LinkIntent;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import type { DecodedRoute } from "./payload.ts";
|
|
3
|
-
import type { ViewDefinition } from "./view-definition.ts";
|
|
4
|
-
export type MaterializedRoute = DecodedRoute & {
|
|
5
|
-
readonly definition: ViewDefinition | undefined;
|
|
6
|
-
};
|
|
7
|
-
export type ModuleLoadError = {
|
|
8
|
-
readonly _tag: "ModuleLoadError";
|
|
9
|
-
readonly url: string;
|
|
10
|
-
readonly cause: unknown;
|
|
11
|
-
};
|
|
12
|
-
/** Native imports cache production modules; development retains accepted replacement namespaces. */
|
|
13
|
-
export declare function enableDevelopmentModules(): {
|
|
14
|
-
replaceFn(input: {
|
|
15
|
-
readonly url: string;
|
|
16
|
-
readonly module: Readonly<Record<string, unknown>>;
|
|
17
|
-
}): Map<unknown, unknown>;
|
|
18
|
-
closeFn(): void;
|
|
19
|
-
};
|
|
20
|
-
/** Loads one position independently, retaining its decoded facts and selected view. */
|
|
21
|
-
export declare function materializeRoute(route: DecodedRoute): Effect.Effect<MaterializedRoute, ModuleLoadError>;
|
package/dist/client/modules.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Duration, Effect, Result, type Schedule, Scope } from "effect";
|
|
2
|
-
import { type CommitDependencies } from "./commit.ts";
|
|
3
|
-
import type { ClientCore } from "./core.ts";
|
|
4
|
-
import { NavigationError, RevalidationError } from "./errors.ts";
|
|
5
|
-
import { type BrowserPosition } from "./history.ts";
|
|
6
|
-
import { type PrefetchOwner } from "./prefetch.ts";
|
|
7
|
-
import { type PreparationDependencies, type PreparedRoute } from "./prepare.ts";
|
|
8
|
-
import type { QueryOwner } from "./queries.ts";
|
|
9
|
-
import type { Frame } from "./state.ts";
|
|
10
|
-
import type { NavigationOptions, NavigationResult, RevalidationResult } from "./types.ts";
|
|
11
|
-
export type NavigationOwner = {
|
|
12
|
-
readonly navigate: (href: string, options: NavigationOptions) => Effect.Effect<NavigationResult, NavigationError>;
|
|
13
|
-
/** Records a target failure that happened before a navigation candidate existed. */
|
|
14
|
-
readonly recordTargetFailure: (error: NavigationError) => void;
|
|
15
|
-
/** Starts the navigation now and returns its observation. */
|
|
16
|
-
readonly begin: (href: string, options: NavigationOptions) => Effect.Effect<NavigationResult, NavigationError>;
|
|
17
|
-
/** Registers a demand when executed and awaits its qualifying result. */
|
|
18
|
-
readonly revalidate: (options: {
|
|
19
|
-
readonly skipWorkIndicator: boolean;
|
|
20
|
-
}) => Effect.Effect<RevalidationResult, RevalidationError>;
|
|
21
|
-
/** Registers a demand now and returns the observation of that demand. */
|
|
22
|
-
readonly requireRefresh: (options: {
|
|
23
|
-
readonly skipWorkIndicator: boolean;
|
|
24
|
-
}) => Effect.Effect<RevalidationResult, RevalidationError>;
|
|
25
|
-
/** Commits the boot preparation, whose entries' activations `scope` already holds. */
|
|
26
|
-
readonly commitBoot: (prepared: PreparedRoute, scope: Scope.Closeable, position: BrowserPosition) => Result.Result<Frame, NavigationError>;
|
|
27
|
-
/** Advances the session generation, retires every reusable value, and awaits fresh data. */
|
|
28
|
-
readonly invalidate: () => Effect.Effect<RevalidationResult, RevalidationError>;
|
|
29
|
-
readonly queries: QueryOwner;
|
|
30
|
-
/** Attaches popstate and focus handling; the returned function detaches them. */
|
|
31
|
-
readonly attachBrowserListeners: () => () => void;
|
|
32
|
-
/** Settles every navigation that waited for the first frame: boot's outcome decides whether it starts or fails. */
|
|
33
|
-
readonly settleBoot: (outcome: Result.Result<void, unknown>) => void;
|
|
34
|
-
/** Retires all prefetch preparations and retained snapshots. */
|
|
35
|
-
readonly retireReusable: () => void;
|
|
36
|
-
/** Retires every reusable value and outstanding observation; disposal calls it. */
|
|
37
|
-
readonly retireAll: () => void;
|
|
38
|
-
};
|
|
39
|
-
export declare function createNavigation(core: PreparationDependencies & CommitDependencies & Pick<ClientCore, "retireGeneration">, prefetch: PrefetchOwner, options: {
|
|
40
|
-
readonly enableViewTransitions: boolean;
|
|
41
|
-
readonly revalidateOnWindowFocus: {
|
|
42
|
-
readonly staleTime: Duration.Input;
|
|
43
|
-
readonly skipWorkIndicator: boolean;
|
|
44
|
-
} | undefined;
|
|
45
|
-
/** Runs a failed refresh attempt again under this schedule; without one a failed refresh fails once. */
|
|
46
|
-
readonly refreshRetrySchedule: Schedule.Schedule<unknown, RevalidationError> | undefined;
|
|
47
|
-
}): NavigationOwner;
|
package/dist/client/payload.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { CompiledNestedPattern } from "@vorma/primitives/matcher";
|
|
2
|
-
import { Result } from "effect";
|
|
3
|
-
import type { SearchContractDocument } from "../universal/protocol-schemas.ts";
|
|
4
|
-
import { type TransportDecodeError } from "../universal/value-transport.ts";
|
|
5
|
-
import type { HeadSections } from "./head.ts";
|
|
6
|
-
export type DecodedRoute = {
|
|
7
|
-
readonly pattern: string;
|
|
8
|
-
readonly params: Readonly<Record<string, string>>;
|
|
9
|
-
readonly splatValues: ReadonlyArray<string>;
|
|
10
|
-
/** The pattern as the server's matcher holds it; the registry learns it for early client loader starts. */
|
|
11
|
-
readonly compiledPattern: CompiledNestedPattern;
|
|
12
|
-
/** The check-free decoded contract document that parses a URL's search; null for a route without one. */
|
|
13
|
-
readonly searchContract: SearchContractDocument | null;
|
|
14
|
-
/** The search the server parsed and validated for this route's loader; undefined for a route without a search contract. */
|
|
15
|
-
readonly searchInput: unknown;
|
|
16
|
-
readonly moduleReference: {
|
|
17
|
-
readonly url: string;
|
|
18
|
-
readonly exportNames: ReadonlyArray<string>;
|
|
19
|
-
} | null;
|
|
20
|
-
readonly loaderData: unknown;
|
|
21
|
-
};
|
|
22
|
-
export type ServerRouteError = {
|
|
23
|
-
/** The failed position follows the successful route prefix. Its metadata is not disclosed. */
|
|
24
|
-
readonly index: number;
|
|
25
|
-
readonly status: number;
|
|
26
|
-
readonly clientMessage: string;
|
|
27
|
-
};
|
|
28
|
-
export type DecodedRoutePayload = {
|
|
29
|
-
readonly routes: ReadonlyArray<DecodedRoute>;
|
|
30
|
-
readonly serverError: ServerRouteError | undefined;
|
|
31
|
-
};
|
|
32
|
-
export type DecodedPayload = DecodedRoutePayload & {
|
|
33
|
-
readonly head: HeadSections;
|
|
34
|
-
readonly deps: ReadonlyArray<string>;
|
|
35
|
-
readonly cssBundles: ReadonlyArray<string>;
|
|
36
|
-
readonly staticAssets: ReadonlyArray<string>;
|
|
37
|
-
};
|
|
38
|
-
export type BootstrapPayload = DecodedRoutePayload & {
|
|
39
|
-
readonly clientBuildId: string;
|
|
40
|
-
/** Whether the development server served the document. */
|
|
41
|
-
readonly developmentMode: boolean;
|
|
42
|
-
readonly deploymentId: string | undefined;
|
|
43
|
-
};
|
|
44
|
-
/** A transported value on a route record whose marks do not restore it. */
|
|
45
|
-
export type PayloadReadError = {
|
|
46
|
-
readonly _tag: "PayloadReadError";
|
|
47
|
-
readonly pattern: string;
|
|
48
|
-
readonly field: "search_input" | "loader_data";
|
|
49
|
-
readonly cause: TransportDecodeError;
|
|
50
|
-
};
|
|
51
|
-
/** Reads a navigation payload this build's server wrote. */
|
|
52
|
-
export declare function readPayload(raw: unknown): Result.Result<DecodedPayload, PayloadReadError>;
|
|
53
|
-
/** Reads the initial document payload, including build identity. */
|
|
54
|
-
export declare function readBootstrapPayload(raw: unknown): Result.Result<BootstrapPayload, PayloadReadError>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import type { ClientCore } from "./core.ts";
|
|
3
|
-
import { NavigationError, PrefetchError } from "./errors.ts";
|
|
4
|
-
import { type PreparationDependencies, type PreparationOutcome } from "./prepare.ts";
|
|
5
|
-
export type ConsumedPreparation = {
|
|
6
|
-
/** The preparation's outcome; a redirect or refusal is the consumer's to handle. */
|
|
7
|
-
readonly result: Effect.Effect<PreparationOutcome, NavigationError>;
|
|
8
|
-
/** The sequence current when the preparation started; its read is newer. */
|
|
9
|
-
readonly startSequence: number;
|
|
10
|
-
/** Ends the preparation: the consumer calls it once the frame holds what it needs, or when it stops. */
|
|
11
|
-
readonly release: () => void;
|
|
12
|
-
};
|
|
13
|
-
export type PrefetchOwner = {
|
|
14
|
-
/** Holds an observer handle for the Effect's lifetime and observes readiness. */
|
|
15
|
-
readonly awaitReadiness: (url: URL, options: {
|
|
16
|
-
readonly skipWorkIndicator: boolean;
|
|
17
|
-
}) => Effect.Effect<void, PrefetchError>;
|
|
18
|
-
/** Holds an observer handle until interrupted; intent that outlasts readiness uses this. */
|
|
19
|
-
readonly holdUntilInterrupted: (url: URL, options: {
|
|
20
|
-
readonly skipWorkIndicator: boolean;
|
|
21
|
-
}) => Effect.Effect<never, PrefetchError>;
|
|
22
|
-
/** Transfers the destination's preparation to navigation, if one exists. */
|
|
23
|
-
readonly takeForNavigation: (destination: string) => ConsumedPreparation | null;
|
|
24
|
-
readonly retirePreparations: () => void;
|
|
25
|
-
};
|
|
26
|
-
/** The part of an address a preparation serves: its path and query. */
|
|
27
|
-
export declare function readDestination(url: URL): string;
|
|
28
|
-
export declare function createPrefetch(core: PreparationDependencies & Pick<ClientCore, "updateState" | "forkFiber">): PrefetchOwner;
|
package/dist/client/prepare.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Effect, Exit, Scope } from "effect";
|
|
2
|
-
import { type ClientLoaderTrigger } from "./client-loaders.ts";
|
|
3
|
-
import type { ClientCore } from "./core.ts";
|
|
4
|
-
import { NavigationError } from "./errors.ts";
|
|
5
|
-
import type { HeadSections } from "./head.ts";
|
|
6
|
-
import { type DecodedPayload } from "./payload.ts";
|
|
7
|
-
import type { RouteEntry, RouteErrorState } from "./state.ts";
|
|
8
|
-
import type { BuildMismatch, RequestKind } from "./types.ts";
|
|
9
|
-
export type RouteReadSource = {
|
|
10
|
-
readonly kind: "request";
|
|
11
|
-
readonly url: URL;
|
|
12
|
-
readonly requestKind: RequestKind;
|
|
13
|
-
} | {
|
|
14
|
-
readonly kind: "payload";
|
|
15
|
-
readonly url: URL;
|
|
16
|
-
readonly payload: DecodedPayload;
|
|
17
|
-
};
|
|
18
|
-
export type PreparedRoute = {
|
|
19
|
-
readonly url: URL;
|
|
20
|
-
readonly entries: ReadonlyArray<RouteEntry>;
|
|
21
|
-
readonly error: RouteErrorState | null;
|
|
22
|
-
readonly head: HeadSections;
|
|
23
|
-
readonly cssBundles: ReadonlyArray<string>;
|
|
24
|
-
/** The sequence of the read that produced this route. */
|
|
25
|
-
readonly sequence: number;
|
|
26
|
-
readonly generation: number;
|
|
27
|
-
};
|
|
28
|
-
export type PreparationOutcome = {
|
|
29
|
-
readonly _tag: "Prepared";
|
|
30
|
-
readonly prepared: PreparedRoute;
|
|
31
|
-
} | {
|
|
32
|
-
readonly _tag: "Redirect";
|
|
33
|
-
readonly href: string;
|
|
34
|
-
} | {
|
|
35
|
-
readonly _tag: "BuildSkew";
|
|
36
|
-
readonly mismatch: BuildMismatch;
|
|
37
|
-
};
|
|
38
|
-
export type PreparationDependencies = Pick<ClientCore, "getClientBuildId" | "getDeploymentId" | "prepareRequest" | "provideClient" | "advanceSequence" | "getState" | "activations" | "clientLoaders" | "reportBuildMismatch" | "runsInDevelopmentMode" | "publishEvent">;
|
|
39
|
-
/** Prepares one destination. Known client loaders start before the read settles when `prestart` is set. */
|
|
40
|
-
export declare function prepareRoute(core: PreparationDependencies, input: {
|
|
41
|
-
readonly source: RouteReadSource;
|
|
42
|
-
readonly trigger: ClientLoaderTrigger;
|
|
43
|
-
readonly historyState: unknown;
|
|
44
|
-
readonly prestart: boolean;
|
|
45
|
-
/** Called once: at the ready milestone, or with the failure when preparation ends before it. */
|
|
46
|
-
readonly reportReadinessFn: ((exit: Exit.Exit<void, NavigationError>) => void) | undefined;
|
|
47
|
-
}): Effect.Effect<PreparationOutcome, NavigationError, Scope.Scope>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Option } from "effect";
|
|
2
|
-
import { Atom } from "effect/unstable/reactivity";
|
|
3
|
-
import { type Frame, type RouteEntry, type RouteErrorState } from "./state.ts";
|
|
4
|
-
import type { BuildMismatch, ClientLifecycle, NavigationState, OperationId, OperationState, RevalidationState, RouteState, RouteError, WorkState } from "./types.ts";
|
|
5
|
-
export declare const lifecycleAtom: Atom.Atom<ClientLifecycle>;
|
|
6
|
-
export declare const committedFrameAtom: Atom.Atom<Frame | null>;
|
|
7
|
-
/** Projects server-public fields or preserves a browser-local cause according to its source. */
|
|
8
|
-
export declare function projectRouteError(error: Pick<RouteErrorState, "pattern" | "source" | "error">): RouteError;
|
|
9
|
-
/** The public route state of a frame. */
|
|
10
|
-
export declare function projectRouteState(frame: Pick<Frame, "href" | "historyState" | "error"> & {
|
|
11
|
-
readonly entries: ReadonlyArray<Pick<RouteEntry, "pattern" | "params" | "splatValues">>;
|
|
12
|
-
}): RouteState;
|
|
13
|
-
export declare const routeStateAtom: Atom.Atom<Option.Option<RouteState>>;
|
|
14
|
-
export declare const navigationStateAtom: Atom.Atom<NavigationState>;
|
|
15
|
-
export declare const revalidationStateAtom: Atom.Atom<RevalidationState>;
|
|
16
|
-
/**
|
|
17
|
-
* Active queries depend on this; it changes only when a demand registers. It
|
|
18
|
-
* is eager because its dependents are lazy runtime computations behind
|
|
19
|
-
* wrappers, and the registry recomputes a lazy atom's lazy dependents only
|
|
20
|
-
* when the atom itself is recomputed.
|
|
21
|
-
*/
|
|
22
|
-
export declare const refreshEpochAtom: Atom.Atom<number>;
|
|
23
|
-
export declare const buildMismatchAtom: Atom.Atom<Option.Option<BuildMismatch>>;
|
|
24
|
-
export declare const workStateAtom: Atom.Atom<WorkState>;
|
|
25
|
-
/** One operation's state while it is tracked; the observer retains the settled value afterward. */
|
|
26
|
-
export declare const getOperationStateAtom: (arg: OperationId) => Atom.Atom<Option.Option<OperationState>>;
|
package/dist/client/queries.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Option } from "effect";
|
|
2
|
-
import { Atom, AsyncResult } from "effect/unstable/reactivity";
|
|
3
|
-
import type { EndpointCallFailure, EndpointCallOutput, QueryEndpointCallInput } from "./contracts.ts";
|
|
4
|
-
import type { EndpointFrameworkError, QueryResponse } from "./endpoints.ts";
|
|
5
|
-
import type { QueryRedirected } from "./errors.ts";
|
|
6
|
-
import { ClientCoordinator } from "./runtime.ts";
|
|
7
|
-
export type QueryEndpointOutput<Input extends QueryEndpointCallInput> = QueryResponse<EndpointCallOutput<Input>>;
|
|
8
|
-
export type QueryAtom<Input extends QueryEndpointCallInput, RuntimeError> = Atom.Atom<AsyncResult.AsyncResult<QueryEndpointOutput<Input>, EndpointCallFailure<Input, EndpointFrameworkError | QueryRedirected> | RuntimeError>>;
|
|
9
|
-
/** The facts an acknowledgment carries; a read that never dispatched has no sequence. */
|
|
10
|
-
export type QueryAcknowledgment = {
|
|
11
|
-
readonly id: string;
|
|
12
|
-
readonly dispatched: {
|
|
13
|
-
readonly sequence: number;
|
|
14
|
-
readonly generation: number;
|
|
15
|
-
} | undefined;
|
|
16
|
-
readonly success: boolean;
|
|
17
|
-
};
|
|
18
|
-
/** One computation of a query's reading atom, told apart from its successors. */
|
|
19
|
-
export type QueryComputation = {
|
|
20
|
-
readonly id: string;
|
|
21
|
-
readonly token: symbol;
|
|
22
|
-
};
|
|
23
|
-
export type QueryOwner = {
|
|
24
|
-
/** A computation evaluated; the outstanding demand expects its read. */
|
|
25
|
-
readonly expect: (computation: QueryComputation) => void;
|
|
26
|
-
/** A computation's scope closed; without a successor the query is no longer expected. */
|
|
27
|
-
readonly release: (computation: QueryComputation) => void;
|
|
28
|
-
readonly acknowledge: (acknowledgment: QueryAcknowledgment) => void;
|
|
29
|
-
};
|
|
30
|
-
export declare function createQueryAtom<const Input extends QueryEndpointCallInput, R extends ClientCoordinator, RuntimeError>(input: {
|
|
31
|
-
readonly runtime: Atom.AtomRuntime<R, RuntimeError>;
|
|
32
|
-
readonly request: Input | Atom.Atom<Option.Option<Input>>;
|
|
33
|
-
}): QueryAtom<Input, RuntimeError>;
|