@valancex/valance 0.2.0 → 0.3.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/README.md +12 -10
- package/dist/index.d.ts +60 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -1
- package/dist/web.d.ts +42 -2
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +35 -1
- package/dist/web.js.map +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
# @valancex/valance
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Build an interactive application whose state lives in one place, whose screen is a function of that state, and whose only way to change anything is a command. One application, one state, a view derived from it, drawn in a page, on a server, or not at all. (Built on [NEXUS](https://github.com/ValanceX/Nexus), [MESH](https://github.com/ValanceX/Mesh) and [PORT](https://github.com/ValanceX/Port); you do not need to know them to start.)
|
|
4
|
+
|
|
5
|
+
**Documentation:** [Learn](https://github.com/ValanceX/Valance/blob/main/docs/learn/README.md) (start here) · [Use](https://github.com/ValanceX/Valance/blob/main/docs/use/README.md) (API reference and the contract) · [Understand](https://github.com/ValanceX/Valance/blob/main/docs/understand/README.md) (architecture and evidence).
|
|
4
6
|
|
|
5
7
|
```ts
|
|
6
|
-
import * as Valance from "@valancex/valance"; // define, start, mount, hydrate (+ ApplicationHandle, Mounted, TargetFactory)
|
|
7
|
-
import * as Web from "@valancex/valance/web"; // Web.target, Web.history
|
|
8
|
+
import * as Valance from "@valancex/valance"; // define, command, entry, start, mount, hydrate (+ ApplicationHandle, Mounted, TargetFactory)
|
|
9
|
+
import * as Web from "@valancex/valance/web"; // Web.run, Web.target, Web.history (needs @valancex/port-web)
|
|
8
10
|
import { renderToHtml } from "@valancex/valance/web/server";
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
- **Install** (a strict package manager resolves only what you declare, so declare the application-level and build-time packages yourself):
|
|
12
14
|
|
|
13
15
|
```console
|
|
14
|
-
$ pnpm add @valancex/valance @valancex/nexus@^0.10.
|
|
15
|
-
$ pnpm add -D @valancex/mesh-compiler@^0.
|
|
16
|
+
$ pnpm add @valancex/valance @valancex/nexus@^0.10.2 @valancex/mesh-runtime@^0.8.0 @valancex/port-web@^0.2.3 effect@^3.10.0
|
|
17
|
+
$ pnpm add -D @valancex/mesh-compiler@^0.9.0
|
|
16
18
|
```
|
|
17
19
|
|
|
18
20
|
| Package | Range | Role |
|
|
19
21
|
|---|---|---|
|
|
20
22
|
| `@valancex/valance` | the release you target | this package |
|
|
21
|
-
| `@valancex/nexus` | `^0.10.
|
|
22
|
-
| `@valancex/mesh-runtime` | `^0.
|
|
23
|
-
| `@valancex/port-web` | `^0.2.
|
|
23
|
+
| `@valancex/nexus` | `^0.10.2` | **application-level**: your commands, state handles and capabilities are written against it. Also this package's own dependency, so use the same range and one copy is shared |
|
|
24
|
+
| `@valancex/mesh-runtime` | `^0.8.0` | peer: renders programs at run time |
|
|
25
|
+
| `@valancex/port-web` | `^0.2.3` | optional peer: needed for `./web` and `./web/server` |
|
|
24
26
|
| `effect` | `^3.10.0` | peer |
|
|
25
|
-
| `@valancex/mesh-compiler` | `^0.
|
|
27
|
+
| `@valancex/mesh-compiler` | `^0.9.0` | **build time only** (devDependency): compiles MPRX to the `program` each view takes (`compileProgram`) |
|
|
26
28
|
|
|
27
29
|
- **Lifetimes:** the application, each mount and each history live in separate, caller-owned `Scope`s; closing one never closes another. Closing the application's `Scope` ends commits (state stays readable); mounts then end inert.
|
|
28
30
|
- **Presentation:** a mount presents committed state as a latest-state consumer: it may skip superseded intermediate states and converges on the latest. Same view is an `update`, another view a `draw`; `hydrate` takes over server markup and then behaves like `mount`. A mount's failure is local to it; recovery is a fresh mount.
|
|
29
31
|
- **History:** `Web.history` follows committed state and runs the application's own navigate command on popstate; it owns its listener's `Scope` only.
|
|
30
32
|
- **Status:** pre-1.0. `./internal` is the composition protocol for binding authors and tests, unstable by design.
|
|
31
|
-
- **The contract:** [`docs/V1_CONTRACT.md`](https://github.com/ValanceX/Valance/blob/main/docs/V1_CONTRACT.md) states what VALANCE guarantees, what the caller owns and what is not guaranteed. Engineering constraints: [`docs/CONSTRAINTS.md`](https://github.com/ValanceX/Valance/blob/main/docs/CONSTRAINTS.md). Historical investigation record: [`docs/FINDINGS.md`](https://github.com/ValanceX/Valance/blob/main/docs/FINDINGS.md). Release notes: [`docs/releases/v0.2.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.2.md) (current), [`v0.1.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.1.md).
|
|
33
|
+
- **The contract:** [`docs/V1_CONTRACT.md`](https://github.com/ValanceX/Valance/blob/main/docs/V1_CONTRACT.md) states what VALANCE guarantees, what the caller owns and what is not guaranteed. Engineering constraints: [`docs/CONSTRAINTS.md`](https://github.com/ValanceX/Valance/blob/main/docs/CONSTRAINTS.md). Historical investigation record: [`docs/FINDINGS.md`](https://github.com/ValanceX/Valance/blob/main/docs/FINDINGS.md). Release notes: [`docs/releases/v0.2.1.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.2.1.md) (current), [`v0.2.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.2.md), [`v0.1.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.1.md).
|
|
32
34
|
|
|
33
35
|
MIT licensed.
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* define(app) data: program, state, scope, command bindings. No target, no platform.
|
|
7
7
|
* start(app, options) starts the NEXUS application in the CALLER's Scope; supplies the platform;
|
|
8
|
-
* creates the application's state and its MESH host;
|
|
8
|
+
* creates the application's state and its MESH host; checks that every event the views' programs declare has
|
|
9
|
+
* a command-table key (MESH says what is declared; Contract §2); returns the application's handle:
|
|
9
10
|
* its `state` and `invoke`, and nothing of the composition (see ./internal).
|
|
10
11
|
* mount / hydrate connects a PORT target to a started application: draws (or adopts server
|
|
11
12
|
* server output for) the current render, follows later renders as updates, and
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
* Nothing here is target-specific. A target is whatever satisfies `Target`, which is PORT's
|
|
18
19
|
* contract (draw / update / unmount, plus hydrate where a PORT has one) and nothing more.
|
|
19
20
|
*/
|
|
20
|
-
import type { BoundaryValue, RenderTree } from "@valancex/mesh-runtime";
|
|
21
|
+
import type { BoundaryValue, RenderTree, SourceSpan } from "@valancex/mesh-runtime";
|
|
21
22
|
import * as Nexus from "@valancex/nexus";
|
|
22
23
|
import { type DispatchExit } from "./internal.js";
|
|
23
24
|
import { Effect, Exit, Schema, Scope } from "effect";
|
|
@@ -48,7 +49,63 @@ export interface ApplicationDefinition<S, E, R extends Ambient, V extends string
|
|
|
48
49
|
}
|
|
49
50
|
/** The definition, typed. An application is data: defining one starts nothing. */
|
|
50
51
|
export declare const define: <S, E, R extends Ambient, V extends string>(definition: ApplicationDefinition<S, E, R, V>) => ApplicationDefinition<S, E, R, V>;
|
|
51
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Binds the application's state, and returns the function that makes commands whose whole behavior is a pure transition of it:
|
|
54
|
+
* `transition` receives the validated input and the current state, and returns the next state. The input is validated by `input`
|
|
55
|
+
* before `transition` runs, exactly as for any command (a failure is the typed `CommandValidationError`, and nothing commits).
|
|
56
|
+
*
|
|
57
|
+
* const command = Valance.command(state);
|
|
58
|
+
* const add = command(Schema.Struct({ amount: Schema.Number }), ({ amount }, current) => ({ ...current, count: current.count + amount }));
|
|
59
|
+
*
|
|
60
|
+
* It is the trusted, atomic writer of Contract §3, not the validating one: the result is committed AS RETURNED, without being checked
|
|
61
|
+
* against the state's schema, and concurrent transitions all land. (It is `state.update`, never `state.set`.)
|
|
62
|
+
*
|
|
63
|
+
* It is an ordinary NEXUS command, so `entry` binds it like any other. A command that must consult the platform, wait, or fail with
|
|
64
|
+
* its own error is written as a NEXUS command over an Effect (`Nexus.Command.define`) and bound the same way.
|
|
65
|
+
*
|
|
66
|
+
* The state is bound in a first call, and the transition is checked against exactly that state type: what `transition` returns must be a
|
|
67
|
+
* state, and is not inferred from what it returns. So a union-shaped state needs no annotation, a literal keeps the type the state gives it
|
|
68
|
+
* (a mutable array stays mutable, a readonly one stays readonly), and no returned type is read "as const". (One call with the state and the
|
|
69
|
+
* transition together cannot do this: TypeScript then types the returned literals from a type parameter of that same call, and widens them.)
|
|
70
|
+
* A returned object is not checked for excess properties, the same as returning it from `state.update`.
|
|
71
|
+
*/
|
|
72
|
+
export declare const command: <S>(state: Nexus.State.StateHandle<S>) => (<I>(input: Schema.Schema<I>, transition: (input: I, current: S) => S) => Nexus.Command.Command<I, void, never, never>);
|
|
73
|
+
/**
|
|
74
|
+
* An entry's behavior: it runs the command `run`, with the input `input` makes from the entry's arguments, as plain values in order (an absent
|
|
75
|
+
* argument is `undefined`). Without `input` the command is given `{}`, the input of a command that takes none. `input`'s result is
|
|
76
|
+
* validated by the command's schema before its body runs, as for any command.
|
|
77
|
+
*
|
|
78
|
+
* The result is a table entry for `ApplicationDefinition.commands`. Any number of entries may run the same command, and it takes a
|
|
79
|
+
* command from `command` or from NEXUS. A rendered view's entry is keyed `"component/name"`; an entry for a caller outside any view
|
|
80
|
+
* (`invoke`, history) is keyed `"app/..."`. Both are resolved in the one table, and an unknown key is the typed `UnmappedCommand`.
|
|
81
|
+
*/
|
|
82
|
+
export declare const entry: <I, O, E, R>(run: Nexus.Command.Command<I, O, E, R>, input?: (...values: ReadonlyArray<unknown>) => unknown) => Nexus.Mesh.Binding<E | Nexus.Command.CommandValidationError, R>;
|
|
83
|
+
/**
|
|
84
|
+
* One event a view's program declares whose `component/command` key the application's command table lacks. `key`, `component` and `command`
|
|
85
|
+
* are MESH's declaration; `view` is the application's name for the program; `span` is MESH's, in the source of `component`'s template (it names no file).
|
|
86
|
+
*/
|
|
87
|
+
export interface UnmappedDeclaration {
|
|
88
|
+
readonly view: string;
|
|
89
|
+
readonly component: string;
|
|
90
|
+
readonly event: string;
|
|
91
|
+
readonly command: string;
|
|
92
|
+
readonly key: string;
|
|
93
|
+
readonly span: SourceSpan;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* `start`'s conformance failure (D ⊆ B, Contract §2): every event the programs of ALL the application's views declare needs an entry in the command table.
|
|
97
|
+
* `missing` lists each declaration whose key is absent: in the order of the definition's views, then MESH's order. It says only that a key is absent: nothing
|
|
98
|
+
* about a command, a binding, arguments or success.
|
|
99
|
+
*/
|
|
100
|
+
export type ConformanceViolation = {
|
|
101
|
+
readonly _tag: "ConformanceViolation";
|
|
102
|
+
readonly missing: ReadonlyArray<UnmappedDeclaration>;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Why `start` yields no handle: NEXUS's state and platform failures; the diagnostics MESH reports for a view's program (the first view, in the definition's order,
|
|
106
|
+
* that has any: they depend on the program alone, never on state); or the conformance failure.
|
|
107
|
+
*/
|
|
108
|
+
export type StartError = Nexus.Application.ApplicationInitError | Nexus.State.StateInitError | Nexus.Mesh.MeshDiagnostics | ConformanceViolation;
|
|
52
109
|
export interface StartOptions<S> {
|
|
53
110
|
/** Supplied to NEXUS `Application.start`, where platform services (capabilities, Clock, …) enter. */
|
|
54
111
|
readonly platform?: Nexus.Application.Platform;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAiB,UAAU,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGnG,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAuB,KAAK,YAAY,EAA6B,MAAM,eAAe,CAAC;AAClG,OAAO,EAAY,MAAM,EAAE,IAAI,EAAgB,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C,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,KAAK,CACxC,CAAC;AAE5H;;;GAGG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAA;CAAE,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,KAAK,CAChE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,44 @@
|
|
|
1
|
+
import { declaredEvents } from "@valancex/mesh-runtime";
|
|
1
2
|
import * as Nexus from "@valancex/nexus";
|
|
2
3
|
import { handleOf, runningOf } from "./internal.js";
|
|
3
4
|
import { Deferred, Effect, Exit, Fiber, Layer, Stream } from "effect";
|
|
4
5
|
/** The definition, typed. An application is data: defining one starts nothing. */
|
|
5
6
|
export const define = (definition) => definition;
|
|
7
|
+
/** The diagnostic id of a command made by `command`: it has no author-chosen id, and the id only decorates `CommandValidationError.command`. */
|
|
8
|
+
const TRANSITION_COMMAND = "valance.command";
|
|
9
|
+
/**
|
|
10
|
+
* Binds the application's state, and returns the function that makes commands whose whole behavior is a pure transition of it:
|
|
11
|
+
* `transition` receives the validated input and the current state, and returns the next state. The input is validated by `input`
|
|
12
|
+
* before `transition` runs, exactly as for any command (a failure is the typed `CommandValidationError`, and nothing commits).
|
|
13
|
+
*
|
|
14
|
+
* const command = Valance.command(state);
|
|
15
|
+
* const add = command(Schema.Struct({ amount: Schema.Number }), ({ amount }, current) => ({ ...current, count: current.count + amount }));
|
|
16
|
+
*
|
|
17
|
+
* It is the trusted, atomic writer of Contract §3, not the validating one: the result is committed AS RETURNED, without being checked
|
|
18
|
+
* against the state's schema, and concurrent transitions all land. (It is `state.update`, never `state.set`.)
|
|
19
|
+
*
|
|
20
|
+
* It is an ordinary NEXUS command, so `entry` binds it like any other. A command that must consult the platform, wait, or fail with
|
|
21
|
+
* its own error is written as a NEXUS command over an Effect (`Nexus.Command.define`) and bound the same way.
|
|
22
|
+
*
|
|
23
|
+
* The state is bound in a first call, and the transition is checked against exactly that state type: what `transition` returns must be a
|
|
24
|
+
* state, and is not inferred from what it returns. So a union-shaped state needs no annotation, a literal keeps the type the state gives it
|
|
25
|
+
* (a mutable array stays mutable, a readonly one stays readonly), and no returned type is read "as const". (One call with the state and the
|
|
26
|
+
* transition together cannot do this: TypeScript then types the returned literals from a type parameter of that same call, and widens them.)
|
|
27
|
+
* A returned object is not checked for excess properties, the same as returning it from `state.update`.
|
|
28
|
+
*/
|
|
29
|
+
export const command = (state) => (input, transition) => Nexus.Command.define(TRANSITION_COMMAND, input, (decoded) => Effect.asVoid(state.update((current) => Effect.sync(() => transition(decoded, current)))));
|
|
30
|
+
/** What an entry's argument is to the application: the value itself, or `undefined` when the argument is absent. */
|
|
31
|
+
const plain = (argument) => "value" in argument ? argument.value : undefined;
|
|
32
|
+
/**
|
|
33
|
+
* An entry's behavior: it runs the command `run`, with the input `input` makes from the entry's arguments, as plain values in order (an absent
|
|
34
|
+
* argument is `undefined`). Without `input` the command is given `{}`, the input of a command that takes none. `input`'s result is
|
|
35
|
+
* validated by the command's schema before its body runs, as for any command.
|
|
36
|
+
*
|
|
37
|
+
* The result is a table entry for `ApplicationDefinition.commands`. Any number of entries may run the same command, and it takes a
|
|
38
|
+
* command from `command` or from NEXUS. A rendered view's entry is keyed `"component/name"`; an entry for a caller outside any view
|
|
39
|
+
* (`invoke`, history) is keyed `"app/..."`. Both are resolved in the one table, and an unknown key is the typed `UnmappedCommand`.
|
|
40
|
+
*/
|
|
41
|
+
export const entry = (run, input) => Nexus.Mesh.bind(run, (args) => input === undefined ? {} : input(...args.map(plain)));
|
|
6
42
|
/**
|
|
7
43
|
* Starts the application. Its lifetime is the caller's `Scope`: closing it ends the application and its state, and
|
|
8
44
|
* Valance keeps nothing that outlives that scope. (NEXUS can also end an application early; that is the substrate's,
|
|
@@ -23,6 +59,24 @@ export const start = (app, options = {}) => Effect.gen(function* () {
|
|
|
23
59
|
}));
|
|
24
60
|
const state = yield* Nexus.Application.createState(nexus, app.state.schema, options.state ?? app.state.initial);
|
|
25
61
|
const commands = app.commands(state);
|
|
62
|
+
// Conformance, D ⊆ B (Contract §2). B is the table's own keys. D is what MESH says the programs of EVERY view declare (unselected views, inactive
|
|
63
|
+
// conditional branches and repeated bodies included): VALANCE asks MESH and reads no program. A program MESH rejects has no declared events, so it fails
|
|
64
|
+
// `start` first (its diagnostics do not depend on state), and D ⊆ B is evaluated only for a complete D. A MESH package failure is a defect, as in a render.
|
|
65
|
+
const declared = [];
|
|
66
|
+
for (const [view, { program }] of Object.entries(app.views)) {
|
|
67
|
+
const result = yield* Effect.promise(() => declaredEvents({ program: { root: program.root, templates: program.templates }, model: program.model }));
|
|
68
|
+
if (result.diagnostics !== undefined) {
|
|
69
|
+
return yield* Effect.fail({ _tag: "MeshDiagnostics", diagnostics: result.diagnostics });
|
|
70
|
+
}
|
|
71
|
+
declared.push(...result.events.map((event) => ({ view, event })));
|
|
72
|
+
}
|
|
73
|
+
const missing = declared.flatMap(({ view, event }) => {
|
|
74
|
+
const key = `${event.component}/${event.command}`;
|
|
75
|
+
return Object.hasOwn(commands, key) ? [] : [{ view, component: event.component, event: event.event, command: event.command, key, span: event.span }];
|
|
76
|
+
});
|
|
77
|
+
if (missing.length > 0) {
|
|
78
|
+
return yield* Effect.fail({ _tag: "ConformanceViolation", missing });
|
|
79
|
+
}
|
|
26
80
|
// One host per view, used to dispatch (render, handler) → intent → command. The one NEXUS state is shared by all of them.
|
|
27
81
|
const hosts = new Map(Object.entries(app.views).map(([name, view]) => [name, Nexus.Mesh.host({ program: view.program, scope: Nexus.Selector.define(state, view.scope), commands })]));
|
|
28
82
|
// The render of one given state. The adapter renders a host's scope value, not a value it is handed, and a
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAgD,MAAM,eAAe,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAiB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAyBrF,kFAAkF;AAClF,MAAM,CAAC,MAAM,MAAM,GAAG,CAA4C,UAA6C,EAAqC,EAAE,CAAC,UAAU,CAAC;AAoClK;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAA4C,GAAsC,EAAE,UAA2B,EAAE,EAAmE,EAAE,CACzM,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACtF,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEtI,uHAAuH;IACvH,qHAAqH;IACrH,yHAAyH;IACzH,8HAA8H;IAC9H,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAwC,CAAC;IACjE,IAAI,eAAe,GAAG,KAAK,CAAC;IAE5B,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,O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K,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;AAE5H;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAU,WAAoC,EAAE,MAA0C,EAAkG,EAAE,CACnN,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC"}
|
package/dist/web.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* It adds nothing to PORT: it fixes `container` and `primitives` (the application's Web realization
|
|
4
4
|
* table, which is target configuration, not part of the application) and hands PORT the report callback.
|
|
5
5
|
*/
|
|
6
|
-
import type { WebPort, WebPortOptions } from "@valancex/port-web";
|
|
6
|
+
import type { HydrationResult, WebPort, WebPortOptions, WebPrimitives } from "@valancex/port-web";
|
|
7
7
|
import type { BoundaryValue } from "@valancex/mesh-runtime";
|
|
8
|
-
import type { ApplicationHandle, TargetFactory } from "./index.js";
|
|
8
|
+
import type { Ambient, ApplicationDefinition, ApplicationHandle, Mounted, StartOptions, TargetFactory } from "./index.js";
|
|
9
9
|
import { Effect, Scope } from "effect";
|
|
10
10
|
export type { HydrationResult, WebPrimitives } from "@valancex/port-web";
|
|
11
11
|
export { attribute, booleanAttribute, property, textProperty } from "@valancex/port-web";
|
|
@@ -42,4 +42,44 @@ export interface HistoryOptions<S> {
|
|
|
42
42
|
* what a URL means. PORT Web has no history API (it touches nothing outside its container), so this is Valance's.
|
|
43
43
|
*/
|
|
44
44
|
export declare const history: <S, E>(application: ApplicationHandle<S, E>, options: HistoryOptions<S>) => Effect.Effect<void, never, Scope.Scope>;
|
|
45
|
+
export interface RunOptions<S> extends StartOptions<S> {
|
|
46
|
+
/** The element the application is presented in. */
|
|
47
|
+
readonly container: Element;
|
|
48
|
+
/** The application's Web realization table (the same one the server rendered with, when it did). */
|
|
49
|
+
readonly primitives: WebPrimitives;
|
|
50
|
+
/**
|
|
51
|
+
* Explicit, and never inferred from what the container holds. `"mount"` creates the presentation: whatever the container held is replaced.
|
|
52
|
+
* `"hydrate"` adopts server-rendered markup in the container with the client's own render, and reports whether it did in `Host.mounted.hydration`.
|
|
53
|
+
*/
|
|
54
|
+
readonly present: "mount" | "hydrate";
|
|
55
|
+
/** The application's own URL policy, handed to `history` unread. Absent: the URL is not kept in step. */
|
|
56
|
+
readonly history?: HistoryOptions<S>;
|
|
57
|
+
}
|
|
58
|
+
/** One application running on one page: the core's handle, the presentation, and the one operation the host adds. */
|
|
59
|
+
export interface Host<S, E> {
|
|
60
|
+
/** The application's handle, unchanged: the same one `start` returns, for whatever else wants to enter or read the application. */
|
|
61
|
+
readonly handle: ApplicationHandle<S, E>;
|
|
62
|
+
/** The presentation, unchanged: what `mount` or `hydrate` returned (`hydration` is present when the host hydrated). */
|
|
63
|
+
readonly mounted: Mounted<E> & {
|
|
64
|
+
readonly hydration?: HydrationResult;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Ends the page's composition: the URL synchronization, then the presentation, then the application (its admitted commands are interrupted and
|
|
68
|
+
* awaited, then its resources are released), exactly the order of one Scope holding all three. Calling it again returns the same completion.
|
|
69
|
+
*/
|
|
70
|
+
readonly stop: () => Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Runs one ordinary application on one page: `start`, then `mount` or `hydrate` as `present` says, then `history` if the application has a URL
|
|
74
|
+
* policy, all in ONE lifetime that `stop` closes. It is the caller of the core and nothing more: it decides no state, command, URL, navigation or
|
|
75
|
+
* failure, never looks at the container to choose how to present, and writes nothing to the page, the log or the application's state.
|
|
76
|
+
*
|
|
77
|
+
* A start or first-presentation failure rejects with the existing failure itself (the typed `StartError` or `MeshDiagnostics`; a defect as the
|
|
78
|
+
* defect), after the lifetime it began has been closed. Everything after startup is observed through what the core already gives: `handle`,
|
|
79
|
+
* `mounted.followed` (how the presentation ended), `mounted.settled` and `mounted.dispatched`.
|
|
80
|
+
*
|
|
81
|
+
* It is a convenience for the ordinary page. Several mounts, independent lifetimes, a custom target and headless use are the core's own: `start`,
|
|
82
|
+
* `mount`, `hydrate` and `history`, composed by the caller.
|
|
83
|
+
*/
|
|
84
|
+
export declare const run: <S, E, R extends Ambient, V extends string>(app: ApplicationDefinition<S, E, R, V>, options: RunOptions<S>) => Promise<Host<S, E>>;
|
|
45
85
|
//# sourceMappingURL=web.d.ts.map
|
package/dist/web.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAK1H,OAAO,EAAS,MAAM,EAA8B,KAAK,EAAU,MAAM,QAAQ,CAAC;AAElF,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzF,eA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OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAA;KAAE,CAAC;IACxE;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,GAAG,GAAU,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,MAAM,EAAE,KAAK,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,UAAU,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CA0BvJ,CAAC"}
|
package/dist/web.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createWebPort } from "@valancex/port-web";
|
|
2
|
+
import { hydrate, mount, start } from "./index.js";
|
|
2
3
|
import { runningOf } from "./internal.js";
|
|
3
|
-
import { Effect, Fiber, Queue, Stream } from "effect";
|
|
4
|
+
import { Cause, Effect, Exit, Fiber, Option, Queue, Scope, Stream } from "effect";
|
|
4
5
|
export { attribute, booleanAttribute, property, textProperty } from "@valancex/port-web";
|
|
5
6
|
export const target = (options) => (report) => createWebPort({ ...options, report });
|
|
6
7
|
/**
|
|
@@ -59,4 +60,37 @@ export const history = (application, options) => Effect.gen(function* () {
|
|
|
59
60
|
yield* Fiber.interrupt(follower);
|
|
60
61
|
}));
|
|
61
62
|
});
|
|
63
|
+
/**
|
|
64
|
+
* Runs one ordinary application on one page: `start`, then `mount` or `hydrate` as `present` says, then `history` if the application has a URL
|
|
65
|
+
* policy, all in ONE lifetime that `stop` closes. It is the caller of the core and nothing more: it decides no state, command, URL, navigation or
|
|
66
|
+
* failure, never looks at the container to choose how to present, and writes nothing to the page, the log or the application's state.
|
|
67
|
+
*
|
|
68
|
+
* A start or first-presentation failure rejects with the existing failure itself (the typed `StartError` or `MeshDiagnostics`; a defect as the
|
|
69
|
+
* defect), after the lifetime it began has been closed. Everything after startup is observed through what the core already gives: `handle`,
|
|
70
|
+
* `mounted.followed` (how the presentation ended), `mounted.settled` and `mounted.dispatched`.
|
|
71
|
+
*
|
|
72
|
+
* It is a convenience for the ordinary page. Several mounts, independent lifetimes, a custom target and headless use are the core's own: `start`,
|
|
73
|
+
* `mount`, `hydrate` and `history`, composed by the caller.
|
|
74
|
+
*/
|
|
75
|
+
export const run = async (app, options) => {
|
|
76
|
+
const scope = await Effect.runPromise(Scope.make());
|
|
77
|
+
const startup = Effect.gen(function* () {
|
|
78
|
+
const handle = yield* start(app, options);
|
|
79
|
+
const web = target({ container: options.container, primitives: options.primitives });
|
|
80
|
+
const mounted = options.present === "hydrate" ? yield* hydrate(handle, web) : yield* mount(handle, web);
|
|
81
|
+
if (options.history !== undefined) {
|
|
82
|
+
yield* history(handle, options.history);
|
|
83
|
+
}
|
|
84
|
+
return { handle, mounted };
|
|
85
|
+
});
|
|
86
|
+
const exit = await Effect.runPromiseExit(Scope.extend(startup, scope));
|
|
87
|
+
if (Exit.isFailure(exit)) {
|
|
88
|
+
// What `start` and the presentation had already acquired belongs to this lifetime: release it, then report the startup failure itself (a failure
|
|
89
|
+
// to release is a second, later fact, and does not replace it).
|
|
90
|
+
await Effect.runPromiseExit(Scope.close(scope, exit));
|
|
91
|
+
throw Option.getOrElse(Cause.failureOption(exit.cause), () => Cause.squash(exit.cause));
|
|
92
|
+
}
|
|
93
|
+
let stopping;
|
|
94
|
+
return { ...exit.value, stop: () => stopping ??= Effect.runPromise(Scope.close(scope, Exit.void)) };
|
|
95
|
+
};
|
|
62
96
|
//# sourceMappingURL=web.js.map
|
package/dist/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACn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K,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;AACtG,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valancex/valance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "VALANCE application composition: starts a NEXUS application, renders it with MESH, and realizes it on a PORT target.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@valancex/nexus": "^0.10.
|
|
41
|
+
"@valancex/nexus": "^0.10.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@valancex/mesh-runtime": "^0.
|
|
45
|
-
"@valancex/port-web": "^0.2.
|
|
44
|
+
"@valancex/mesh-runtime": "^0.8.0",
|
|
45
|
+
"@valancex/port-web": "^0.2.3",
|
|
46
46
|
"effect": "^3.10.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
@@ -52,8 +52,9 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^22.0.0",
|
|
55
|
-
"@valancex/mesh-
|
|
56
|
-
"@valancex/
|
|
55
|
+
"@valancex/mesh-compiler": "^0.9.0",
|
|
56
|
+
"@valancex/mesh-runtime": "^0.8.0",
|
|
57
|
+
"@valancex/port-web": "^0.2.3",
|
|
57
58
|
"effect": "^3.10.0",
|
|
58
59
|
"typescript": "^5.6.0",
|
|
59
60
|
"vitest": "^3.2.0"
|