@procedures/splay 0.0.0-stage → 0.1.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 +7 -0
- package/LICENSE +21 -0
- package/README.md +408 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/components/define.d.ts +134 -0
- package/dist/components/define.d.ts.map +1 -0
- package/dist/components/define.js +486 -0
- package/dist/components/define.js.map +1 -0
- package/dist/components/index.d.ts +39 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +38 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/types.d.ts +264 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/components/types.js +46 -0
- package/dist/components/types.js.map +1 -0
- package/dist/hydrate.d.ts +126 -0
- package/dist/hydrate.d.ts.map +1 -0
- package/dist/hydrate.js +226 -0
- package/dist/hydrate.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +16 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +58 -0
- package/dist/module.js.map +1 -0
- package/dist/register.d.ts +8 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +15 -0
- package/dist/register.js.map +1 -0
- package/dist/registry.d.ts +60 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +191 -0
- package/dist/registry.js.map +1 -0
- package/dist/streaming.d.ts +94 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/streaming.js +422 -0
- package/dist/streaming.js.map +1 -0
- package/dist/types.d.ts +85 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +73 -3
- package/src/components/define.ts +600 -0
- package/src/components/index.ts +78 -0
- package/src/components/types.ts +357 -0
- package/src/hydrate.ts +355 -0
- package/src/index.ts +111 -0
- package/src/module.ts +81 -0
- package/src/register.ts +18 -0
- package/src/registry.ts +257 -0
- package/src/streaming.ts +554 -0
- package/src/types.ts +114 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* client-splay
|
|
3
|
+
*
|
|
4
|
+
* Bridge between splay's rendering model and client's procedure system.
|
|
5
|
+
*
|
|
6
|
+
* This package enables:
|
|
7
|
+
* - Using client procedures as splay renderers
|
|
8
|
+
* - Streaming component updates via procedures
|
|
9
|
+
* - Hydrating serializable descriptors to framework components
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { call } from "client";
|
|
14
|
+
* import {
|
|
15
|
+
* createClientRegistry,
|
|
16
|
+
* createReactHydrate,
|
|
17
|
+
* } from "@procedures/splay";
|
|
18
|
+
*
|
|
19
|
+
* // Create a registry backed by client procedures
|
|
20
|
+
* const registry = createClientRegistry(call, {
|
|
21
|
+
* namespace: "ui",
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* // Hydrate descriptors to React components
|
|
25
|
+
* const hydrate = createReactHydrate(React, {
|
|
26
|
+
* components: { "user-card": UserCard },
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* // Render a component
|
|
30
|
+
* const descriptor = await registry.get("user-card")!(ctx);
|
|
31
|
+
* const element = hydrate(descriptor);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
import "./register.js";
|
|
35
|
+
export type { RenderContext, ComponentRenderer, StreamingComponentRenderer, Registry, StreamingRegistry, ClientRegistryOptions, StreamingRegistryOptions, ComponentMap, HydrateOptions, } from "./types.js";
|
|
36
|
+
export { createClientRegistry, createCheckedRegistry, createRenderContext, type ProcedureCaller, } from "./registry.js";
|
|
37
|
+
export { createStreamingRegistry, createDualRegistry, mergeStreams, throttleStream, debounceStream, type StreamingProcedureCaller, type DualRegistry, } from "./streaming.js";
|
|
38
|
+
export { createHydrate, createReactHydrate, walkDescriptor, transformDescriptor, findInDescriptor, getUsedTypes, validateDescriptor, serializeDescriptor, parseDescriptor, compactDescriptor, type CreateElement, type ReactHydrateOptions, } from "./hydrate.js";
|
|
39
|
+
export * from "./components/index.js";
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,eAAe,CAAC;AAMvB,YAAY,EAEV,aAAa,EAGb,iBAAiB,EACjB,0BAA0B,EAC1B,QAAQ,EACR,iBAAiB,EAGjB,qBAAqB,EACrB,wBAAwB,EAGxB,YAAY,EACZ,cAAc,GACf,MAAM,YAAY,CAAC;AAMpB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AAMvB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,KAAK,wBAAwB,EAC7B,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC;AAQtB,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* client-splay
|
|
3
|
+
*
|
|
4
|
+
* Bridge between splay's rendering model and client's procedure system.
|
|
5
|
+
*
|
|
6
|
+
* This package enables:
|
|
7
|
+
* - Using client procedures as splay renderers
|
|
8
|
+
* - Streaming component updates via procedures
|
|
9
|
+
* - Hydrating serializable descriptors to framework components
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { call } from "client";
|
|
14
|
+
* import {
|
|
15
|
+
* createClientRegistry,
|
|
16
|
+
* createReactHydrate,
|
|
17
|
+
* } from "@procedures/splay";
|
|
18
|
+
*
|
|
19
|
+
* // Create a registry backed by client procedures
|
|
20
|
+
* const registry = createClientRegistry(call, {
|
|
21
|
+
* namespace: "ui",
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* // Hydrate descriptors to React components
|
|
25
|
+
* const hydrate = createReactHydrate(React, {
|
|
26
|
+
* components: { "user-card": UserCard },
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* // Render a component
|
|
30
|
+
* const descriptor = await registry.get("user-card")!(ctx);
|
|
31
|
+
* const element = hydrate(descriptor);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
// Importing the package registers its procedures, as in the other client packages (BUGS-2026-07 H18)
|
|
35
|
+
import "./register.js";
|
|
36
|
+
// =============================================================================
|
|
37
|
+
// Registry
|
|
38
|
+
// =============================================================================
|
|
39
|
+
export { createClientRegistry, createCheckedRegistry, createRenderContext, } from "./registry.js";
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// Streaming
|
|
42
|
+
// =============================================================================
|
|
43
|
+
export { createStreamingRegistry, createDualRegistry, mergeStreams, throttleStream, debounceStream, } from "./streaming.js";
|
|
44
|
+
// =============================================================================
|
|
45
|
+
// Hydration
|
|
46
|
+
// =============================================================================
|
|
47
|
+
export { createHydrate, createReactHydrate, walkDescriptor, transformDescriptor, findInDescriptor, getUsedTypes, validateDescriptor, serializeDescriptor, parseDescriptor, compactDescriptor, } from "./hydrate.js";
|
|
48
|
+
// =============================================================================
|
|
49
|
+
// Components
|
|
50
|
+
// =============================================================================
|
|
51
|
+
// The components: serializable UI descriptors made by procedures. They moved here from
|
|
52
|
+
// "@procedures/client/components" (roadmap 3.4: this is the UI package of the ecosystem).
|
|
53
|
+
export * from "./components/index.js";
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,qGAAqG;AACrG,OAAO,eAAe,CAAC;AAyBvB,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,GAEpB,MAAM,eAAe,CAAC;AAEvB,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,cAAc,GAGf,MAAM,gBAAgB,CAAC;AAExB,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,GAGlB,MAAM,cAAc,CAAC;AAEtB,gFAAgF;AAChF,aAAa;AACb,gFAAgF;AAEhF,uFAAuF;AACvF,0FAA0F;AAC1F,cAAc,uBAAuB,CAAC"}
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module (no side effects): the bridge procedures as data, for `createRegistry()`.
|
|
3
|
+
*
|
|
4
|
+
* Procedure Registration
|
|
5
|
+
*
|
|
6
|
+
* Registers client-splay bridge procedures with the client system.
|
|
7
|
+
* This file is referenced by package.json's client.procedures field.
|
|
8
|
+
*/
|
|
9
|
+
import { type ProcedureModule } from "@procedures/client";
|
|
10
|
+
/**
|
|
11
|
+
* The module of this package, for `createRegistry()`: its procedures as data. Importing this
|
|
12
|
+
* file registers nothing. (`register.ts` registers the same procedures in the global registry.)
|
|
13
|
+
*/
|
|
14
|
+
export declare const splayModule: ProcedureModule;
|
|
15
|
+
export default splayModule;
|
|
16
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAkE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA8D1H;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,eAGxB,CAAC;eAEY,WAAW"}
|
package/dist/module.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module (no side effects): the bridge procedures as data, for `createRegistry()`.
|
|
3
|
+
*
|
|
4
|
+
* Procedure Registration
|
|
5
|
+
*
|
|
6
|
+
* Registers client-splay bridge procedures with the client system.
|
|
7
|
+
* This file is referenced by package.json's client.procedures field.
|
|
8
|
+
*/
|
|
9
|
+
import { createProcedure, outputSchema, defineModule } from "@procedures/client";
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Schemas
|
|
12
|
+
// =============================================================================
|
|
13
|
+
const voidSchema = outputSchema();
|
|
14
|
+
const bridgeInfoSchema = outputSchema();
|
|
15
|
+
const healthCheckSchema = outputSchema();
|
|
16
|
+
// =============================================================================
|
|
17
|
+
// Bridge Procedures
|
|
18
|
+
// =============================================================================
|
|
19
|
+
/**
|
|
20
|
+
* Get package info.
|
|
21
|
+
*/
|
|
22
|
+
const infoProcedure = createProcedure()
|
|
23
|
+
.path(["splay", "bridge", "info"])
|
|
24
|
+
.input(voidSchema)
|
|
25
|
+
.output(bridgeInfoSchema)
|
|
26
|
+
.meta({ description: "Get client-splay bridge information" })
|
|
27
|
+
.handler(() => ({
|
|
28
|
+
name: "@procedures/splay",
|
|
29
|
+
version: "1.0.0",
|
|
30
|
+
description: "Bridge between splay and client",
|
|
31
|
+
}))
|
|
32
|
+
.build();
|
|
33
|
+
/**
|
|
34
|
+
* Health check for the bridge.
|
|
35
|
+
*/
|
|
36
|
+
const healthProcedure = createProcedure()
|
|
37
|
+
.path(["splay", "bridge", "health"])
|
|
38
|
+
.input(voidSchema)
|
|
39
|
+
.output(healthCheckSchema)
|
|
40
|
+
.meta({ description: "Health check for client-splay bridge" })
|
|
41
|
+
.handler(() => ({
|
|
42
|
+
status: "healthy",
|
|
43
|
+
timestamp: new Date().toISOString(),
|
|
44
|
+
}))
|
|
45
|
+
.build();
|
|
46
|
+
// =============================================================================
|
|
47
|
+
// Registration
|
|
48
|
+
// =============================================================================
|
|
49
|
+
/**
|
|
50
|
+
* The module of this package, for `createRegistry()`: its procedures as data. Importing this
|
|
51
|
+
* file registers nothing. (`register.ts` registers the same procedures in the global registry.)
|
|
52
|
+
*/
|
|
53
|
+
export const splayModule = defineModule("@procedures/splay", [
|
|
54
|
+
infoProcedure,
|
|
55
|
+
healthProcedure,
|
|
56
|
+
]);
|
|
57
|
+
export default splayModule;
|
|
58
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAA2C,MAAM,oBAAoB,CAAC;AAiB1H,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF,MAAM,UAAU,GAAG,YAAY,EAAQ,CAAC;AACxC,MAAM,gBAAgB,GAAG,YAAY,EAAc,CAAC;AACpD,MAAM,iBAAiB,GAAG,YAAY,EAAe,CAAC;AAEtD,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,aAAa,GAAG,eAAe,EAAE;KACpC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KACjC,KAAK,CAAC,UAAU,CAAC;KACjB,MAAM,CAAC,gBAAgB,CAAC;KACxB,IAAI,CAAC,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;KAC5D,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACd,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iCAAiC;CAC/C,CAAC,CAAC;KACF,KAAK,EAAE,CAAC;AAEX;;GAEG;AACH,MAAM,eAAe,GAAG,eAAe,EAAE;KACtC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;KACnC,KAAK,CAAC,UAAU,CAAC;KACjB,MAAM,CAAC,iBAAiB,CAAC;KACzB,IAAI,CAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;KAC7D,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACd,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;CACpC,CAAC,CAAC;KACF,KAAK,EAAE,CAAC;AAEX,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAoB,YAAY,CAAC,mBAAmB,EAAE;IAC5E,aAA6B;IAC7B,eAA+B;CAChC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importing this file registers the bridge procedures of @procedures/splay in the
|
|
3
|
+
* global registry (DECISIONS-2026-10, "Every package root registers its procedures"). The
|
|
4
|
+
* procedures as data are in `module.ts`, which registers nothing.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./module.js";
|
|
7
|
+
export declare function registerBridge(): void;
|
|
8
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,cAAc,aAAa,CAAC;AAE5B,wBAAgB,cAAc,IAAI,IAAI,CAGrC"}
|
package/dist/register.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importing this file registers the bridge procedures of @procedures/splay in the
|
|
3
|
+
* global registry (DECISIONS-2026-10, "Every package root registers its procedures"). The
|
|
4
|
+
* procedures as data are in `module.ts`, which registers nothing.
|
|
5
|
+
*/
|
|
6
|
+
import { PROCEDURE_REGISTRY } from "@procedures/client";
|
|
7
|
+
import { splayModule } from "./module.js";
|
|
8
|
+
export * from "./module.js";
|
|
9
|
+
export function registerBridge() {
|
|
10
|
+
// override: calling the exported function again (after the auto-register) must not throw
|
|
11
|
+
PROCEDURE_REGISTRY.registerAll(splayModule.procedures, { override: true });
|
|
12
|
+
}
|
|
13
|
+
// Auto-register
|
|
14
|
+
registerBridge();
|
|
15
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,cAAc,aAAa,CAAC;AAE5B,MAAM,UAAU,cAAc;IAC5B,yFAAyF;IACzF,kBAAkB,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,gBAAgB;AAChB,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client Registry
|
|
3
|
+
*
|
|
4
|
+
* Creates a splay-compatible Registry that delegates to client procedures.
|
|
5
|
+
* This enables splay's rendering engine to use client's procedure system
|
|
6
|
+
* for component resolution and execution.
|
|
7
|
+
*/
|
|
8
|
+
import type { Size } from "./components/index.js";
|
|
9
|
+
import type { Registry, RenderContext, ClientRegistryOptions } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Type for calling client procedures.
|
|
12
|
+
* This matches the shape of client's call function.
|
|
13
|
+
*/
|
|
14
|
+
export interface ProcedureCaller {
|
|
15
|
+
<TResult>(path: string[], input: unknown): Promise<TResult>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a splay-compatible registry backed by client procedures.
|
|
19
|
+
*
|
|
20
|
+
* @param call - Client's procedure call function
|
|
21
|
+
* @param options - Registry options
|
|
22
|
+
* @returns Registry instance
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { call } from "client";
|
|
27
|
+
* import { createClientRegistry } from "@procedures/splay";
|
|
28
|
+
*
|
|
29
|
+
* const registry = createClientRegistry(call, {
|
|
30
|
+
* namespace: "ui",
|
|
31
|
+
* defaultSize: { width: 800, height: 600 },
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // Now pass to splay's renderer
|
|
35
|
+
* const renderer = createRenderer({ registry });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function createClientRegistry(call: ProcedureCaller, options?: ClientRegistryOptions): Registry;
|
|
39
|
+
/**
|
|
40
|
+
* Create a registry that can check procedure existence.
|
|
41
|
+
* Requires an additional hasProcedure function from client.
|
|
42
|
+
*
|
|
43
|
+
* @param call - Client's procedure call function
|
|
44
|
+
* @param hasProcedure - Function to check if a procedure exists
|
|
45
|
+
* @param options - Registry options
|
|
46
|
+
* @returns Registry with accurate has() checks
|
|
47
|
+
*/
|
|
48
|
+
export declare function createCheckedRegistry(call: ProcedureCaller, hasProcedure: (path: string[]) => boolean, options?: ClientRegistryOptions): Registry;
|
|
49
|
+
/**
|
|
50
|
+
* Create a render context for calling component procedures.
|
|
51
|
+
*
|
|
52
|
+
* @param registry - The registry to use for child renders
|
|
53
|
+
* @param data - Data to render
|
|
54
|
+
* @param size - Available size
|
|
55
|
+
* @param path - Path in render tree
|
|
56
|
+
* @param depth - Current depth
|
|
57
|
+
* @returns RenderContext for component procedures
|
|
58
|
+
*/
|
|
59
|
+
export declare function createRenderContext<TData>(registry: Registry, data: TData, size: Size, path?: string, depth?: number): RenderContext<TData>;
|
|
60
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAmB,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EACV,QAAQ,EAER,aAAa,EACb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAMpB;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7D;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,eAAe,EACrB,OAAO,GAAE,qBAA0B,GAClC,QAAQ,CAgFV;AAMD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,eAAe,EACrB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,EACzC,OAAO,GAAE,qBAA0B,GAClC,QAAQ,CAuBV;AAMD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EACvC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,KAAK,EACX,IAAI,EAAE,IAAI,EACV,IAAI,GAAE,MAAe,EACrB,KAAK,GAAE,MAAU,GAChB,aAAa,CAAC,KAAK,CAAC,CA8BtB"}
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client Registry
|
|
3
|
+
*
|
|
4
|
+
* Creates a splay-compatible Registry that delegates to client procedures.
|
|
5
|
+
* This enables splay's rendering engine to use client's procedure system
|
|
6
|
+
* for component resolution and execution.
|
|
7
|
+
*/
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// Client Registry Implementation
|
|
10
|
+
// =============================================================================
|
|
11
|
+
/**
|
|
12
|
+
* Create a splay-compatible registry backed by client procedures.
|
|
13
|
+
*
|
|
14
|
+
* @param call - Client's procedure call function
|
|
15
|
+
* @param options - Registry options
|
|
16
|
+
* @returns Registry instance
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { call } from "client";
|
|
21
|
+
* import { createClientRegistry } from "@procedures/splay";
|
|
22
|
+
*
|
|
23
|
+
* const registry = createClientRegistry(call, {
|
|
24
|
+
* namespace: "ui",
|
|
25
|
+
* defaultSize: { width: 800, height: 600 },
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* // Now pass to splay's renderer
|
|
29
|
+
* const renderer = createRenderer({ registry });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function createClientRegistry(call, options = {}) {
|
|
33
|
+
const { namespace } = options;
|
|
34
|
+
/**
|
|
35
|
+
* Build the procedure path for a component type.
|
|
36
|
+
*/
|
|
37
|
+
function buildPath(type) {
|
|
38
|
+
const basePath = ["components"];
|
|
39
|
+
if (namespace) {
|
|
40
|
+
basePath.push(namespace);
|
|
41
|
+
}
|
|
42
|
+
basePath.push(type);
|
|
43
|
+
return basePath;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create a renderer function for a component type.
|
|
47
|
+
*/
|
|
48
|
+
function createRenderer(type) {
|
|
49
|
+
const procedurePath = buildPath(type);
|
|
50
|
+
return async (ctx) => {
|
|
51
|
+
// Build the input for the component procedure
|
|
52
|
+
const input = {
|
|
53
|
+
data: ctx.data,
|
|
54
|
+
size: ctx.size,
|
|
55
|
+
path: ctx.path,
|
|
56
|
+
depth: ctx.depth,
|
|
57
|
+
};
|
|
58
|
+
// Call the procedure
|
|
59
|
+
const result = await call(procedurePath, input);
|
|
60
|
+
return result;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
// Cache of created renderers
|
|
64
|
+
const rendererCache = new Map();
|
|
65
|
+
return {
|
|
66
|
+
/**
|
|
67
|
+
* Get a renderer for a component type.
|
|
68
|
+
* Creates and caches the renderer on first access.
|
|
69
|
+
*/
|
|
70
|
+
get(type) {
|
|
71
|
+
// Check cache first
|
|
72
|
+
let renderer = rendererCache.get(type);
|
|
73
|
+
if (renderer) {
|
|
74
|
+
return renderer;
|
|
75
|
+
}
|
|
76
|
+
// Create and cache renderer
|
|
77
|
+
// Note: We always create a renderer - the procedure may or may not exist
|
|
78
|
+
// Errors will be thrown at call time if the procedure doesn't exist
|
|
79
|
+
renderer = createRenderer(type);
|
|
80
|
+
rendererCache.set(type, renderer);
|
|
81
|
+
return renderer;
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* Check if a renderer exists.
|
|
85
|
+
* Note: This always returns true since we lazily create renderers.
|
|
86
|
+
* Actual existence is checked at call time.
|
|
87
|
+
*/
|
|
88
|
+
has(_type) {
|
|
89
|
+
// We optimistically return true - actual check happens at call time
|
|
90
|
+
// This matches splay's expectation that has() is a quick check
|
|
91
|
+
return true;
|
|
92
|
+
},
|
|
93
|
+
/**
|
|
94
|
+
* Register a renderer (not supported - use client procedures).
|
|
95
|
+
*/
|
|
96
|
+
register(type, _renderer) {
|
|
97
|
+
throw new Error(`Cannot register renderers directly on ClientRegistry. ` +
|
|
98
|
+
`Define a component procedure at path: ${buildPath(type).join(".")}`);
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// =============================================================================
|
|
103
|
+
// Registry with Existence Check
|
|
104
|
+
// =============================================================================
|
|
105
|
+
/**
|
|
106
|
+
* Create a registry that can check procedure existence.
|
|
107
|
+
* Requires an additional hasProcedure function from client.
|
|
108
|
+
*
|
|
109
|
+
* @param call - Client's procedure call function
|
|
110
|
+
* @param hasProcedure - Function to check if a procedure exists
|
|
111
|
+
* @param options - Registry options
|
|
112
|
+
* @returns Registry with accurate has() checks
|
|
113
|
+
*/
|
|
114
|
+
export function createCheckedRegistry(call, hasProcedure, options = {}) {
|
|
115
|
+
const baseRegistry = createClientRegistry(call, options);
|
|
116
|
+
const { namespace } = options;
|
|
117
|
+
function buildPath(type) {
|
|
118
|
+
const basePath = ["components"];
|
|
119
|
+
if (namespace) {
|
|
120
|
+
basePath.push(namespace);
|
|
121
|
+
}
|
|
122
|
+
basePath.push(type);
|
|
123
|
+
return basePath;
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
...baseRegistry,
|
|
127
|
+
/**
|
|
128
|
+
* Check if a procedure exists for this component type.
|
|
129
|
+
*/
|
|
130
|
+
has(type) {
|
|
131
|
+
return hasProcedure(buildPath(type));
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
// =============================================================================
|
|
136
|
+
// Render Context Factory
|
|
137
|
+
// =============================================================================
|
|
138
|
+
/**
|
|
139
|
+
* Create a render context for calling component procedures.
|
|
140
|
+
*
|
|
141
|
+
* @param registry - The registry to use for child renders
|
|
142
|
+
* @param data - Data to render
|
|
143
|
+
* @param size - Available size
|
|
144
|
+
* @param path - Path in render tree
|
|
145
|
+
* @param depth - Current depth
|
|
146
|
+
* @returns RenderContext for component procedures
|
|
147
|
+
*/
|
|
148
|
+
export function createRenderContext(registry, data, size, path = "root", depth = 0) {
|
|
149
|
+
return {
|
|
150
|
+
data,
|
|
151
|
+
size,
|
|
152
|
+
path,
|
|
153
|
+
depth,
|
|
154
|
+
render: async (childData, childSize, childPath) => {
|
|
155
|
+
// Determine component type from data
|
|
156
|
+
const type = getComponentType(childData);
|
|
157
|
+
if (!type) {
|
|
158
|
+
throw new Error(`Cannot determine component type for data at ${childPath}`);
|
|
159
|
+
}
|
|
160
|
+
const renderer = registry.get(type);
|
|
161
|
+
if (!renderer) {
|
|
162
|
+
throw new Error(`No renderer found for component type: ${type}`);
|
|
163
|
+
}
|
|
164
|
+
// Create child context
|
|
165
|
+
const childCtx = createRenderContext(registry, childData, childSize, childPath, depth + 1);
|
|
166
|
+
return renderer(childCtx);
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Extract component type from data.
|
|
172
|
+
* Looks for a `type` or `__type__` property.
|
|
173
|
+
*/
|
|
174
|
+
function getComponentType(data) {
|
|
175
|
+
if (data === null || typeof data !== "object") {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
const obj = data;
|
|
179
|
+
// Check for type property
|
|
180
|
+
const typeValue = obj["type"];
|
|
181
|
+
if (typeof typeValue === "string") {
|
|
182
|
+
return typeValue;
|
|
183
|
+
}
|
|
184
|
+
// Check for __type__ property (alternative convention)
|
|
185
|
+
const altTypeValue = obj["__type__"];
|
|
186
|
+
if (typeof altTypeValue === "string") {
|
|
187
|
+
return altTypeValue;
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsBH,gFAAgF;AAChF,iCAAiC;AACjC,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAqB,EACrB,OAAO,GAA0B,EAAE;IAEnC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAE9B;;OAEG;IACH,SAAS,SAAS,CAAC,IAAY;QAC7B,MAAM,QAAQ,GAAG,CAAC,YAAY,CAAC,CAAC;QAChC,IAAI,SAAS,EAAE,CAAC;YACd,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,QAAQ,CAAC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,CAAC,IAAI,CAAC,CAAC;YACpC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CAAC,yCAAyC,IAAI,EAAE,CAAC,CAAC;YACnE,CAAC;YAED,uBAAuB;YACvB,MAAM,QAAQ,GAAG,mBAAmB,CAClC,QAAQ,EACR,SAAS,EACT,SAAS,EACT,SAAS,EACT,KAAK,GAAG,CAAC,CACV,CAAC;YAEF,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB,CAAC,IAAa;IACrC,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,GAAG,GAAG,IAA+B,CAAC;IAE5C,0BAA0B;IAC1B,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,uDAAuD;IACvD,MAAM,YAAY,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;IACrC,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;QACrC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Streaming Registry
|
|
3
|
+
*
|
|
4
|
+
* Creates a splay-compatible StreamingRegistry for components that
|
|
5
|
+
* yield multiple outputs over time (live updates, progressive rendering).
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentOutput } from "./components/index.js";
|
|
8
|
+
import type { StreamingRegistry, RenderContext, StreamingRegistryOptions } from "./types.js";
|
|
9
|
+
/**
|
|
10
|
+
* Type for calling streaming client procedures.
|
|
11
|
+
* Returns an async iterable of results.
|
|
12
|
+
*/
|
|
13
|
+
export interface StreamingProcedureCaller {
|
|
14
|
+
<TResult>(path: string[], input: unknown): AsyncIterable<TResult>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a splay-compatible streaming registry backed by client procedures.
|
|
18
|
+
*
|
|
19
|
+
* @param callStreaming - Client's streaming procedure call function
|
|
20
|
+
* @param options - Registry options
|
|
21
|
+
* @returns StreamingRegistry instance
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { stream } from "client";
|
|
26
|
+
* import { createStreamingRegistry } from "@procedures/splay";
|
|
27
|
+
*
|
|
28
|
+
* const registry = createStreamingRegistry(stream, {
|
|
29
|
+
* namespace: "live",
|
|
30
|
+
* bufferSize: 10,
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // Use for live-updating components
|
|
34
|
+
* for await (const output of registry.get("ticker")!(ctx)) {
|
|
35
|
+
* render(output);
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function createStreamingRegistry(callStreaming: StreamingProcedureCaller, options?: StreamingRegistryOptions): StreamingRegistry;
|
|
40
|
+
/**
|
|
41
|
+
* Combined registry supporting both sync and streaming renderers.
|
|
42
|
+
*/
|
|
43
|
+
export interface DualRegistry {
|
|
44
|
+
/** Sync registry for single-output components */
|
|
45
|
+
sync: {
|
|
46
|
+
get(type: string): ((ctx: RenderContext) => Promise<ComponentOutput>) | undefined;
|
|
47
|
+
has(type: string): boolean;
|
|
48
|
+
};
|
|
49
|
+
/** Streaming registry for multi-output components */
|
|
50
|
+
streaming: StreamingRegistry;
|
|
51
|
+
/**
|
|
52
|
+
* Render a component, automatically choosing sync or streaming.
|
|
53
|
+
* @param type - Component type
|
|
54
|
+
* @param ctx - Render context
|
|
55
|
+
* @param preferStreaming - Prefer streaming if available
|
|
56
|
+
*/
|
|
57
|
+
render(type: string, ctx: RenderContext, preferStreaming?: boolean): AsyncIterable<ComponentOutput>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create a dual registry supporting both sync and streaming.
|
|
61
|
+
*
|
|
62
|
+
* @param callSync - Client's sync procedure call function
|
|
63
|
+
* @param callStreaming - Client's streaming procedure call function
|
|
64
|
+
* @param isStreaming - Function to check if a component is streaming
|
|
65
|
+
* @param options - Registry options
|
|
66
|
+
* @returns DualRegistry instance
|
|
67
|
+
*/
|
|
68
|
+
export declare function createDualRegistry(callSync: <T>(path: string[], input: unknown) => Promise<T>, callStreaming: StreamingProcedureCaller, isStreaming: (type: string) => boolean, options?: StreamingRegistryOptions): DualRegistry;
|
|
69
|
+
/**
|
|
70
|
+
* Merge multiple component streams into one.
|
|
71
|
+
* Yields outputs from all streams as they arrive.
|
|
72
|
+
*
|
|
73
|
+
* Each source has at most one pending `next()`, and the reader waits on one shared wake-up.
|
|
74
|
+
* (Before, each round raced the pending promises of all sources: an idle source collected one
|
|
75
|
+
* reaction per item of the other sources, 81 MiB at 200k items. Deep dive DATA-12.) When the
|
|
76
|
+
* reader stops, or a source fails, the function ends the other sources.
|
|
77
|
+
*/
|
|
78
|
+
export declare function mergeStreams(...streams: AsyncIterable<ComponentOutput>[]): AsyncIterable<ComponentOutput>;
|
|
79
|
+
/**
|
|
80
|
+
* Throttle a component stream to emit at most once per interval.
|
|
81
|
+
*
|
|
82
|
+
* The first item of an interval goes out at once. The last item that arrives during the
|
|
83
|
+
* interval goes out when the interval ends. (Before, it waited until the source ended: deep
|
|
84
|
+
* dive DATA-12.) When the source ends, a waiting item goes out at once.
|
|
85
|
+
*/
|
|
86
|
+
export declare function throttleStream(stream: AsyncIterable<ComponentOutput>, intervalMs: number): AsyncIterable<ComponentOutput>;
|
|
87
|
+
/**
|
|
88
|
+
* Debounce a component stream to emit only after a quiet period.
|
|
89
|
+
*
|
|
90
|
+
* When the stream ends, the last output goes out at once (BUGS-2026-07 H29). When the reader
|
|
91
|
+
* stops, the source is not read further (deep dive DATA-12).
|
|
92
|
+
*/
|
|
93
|
+
export declare function debounceStream(stream: AsyncIterable<ComponentOutput>, waitMs: number): AsyncIterable<ComponentOutput>;
|
|
94
|
+
//# sourceMappingURL=streaming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../src/streaming.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EACV,iBAAiB,EAEjB,aAAa,EACb,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAcpB;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;CACnE;AAMD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,wBAAwB,EACvC,OAAO,GAAE,wBAA6B,GACrC,iBAAiB,CAqFnB;AAMD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,IAAI,EAAE;QACJ,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC,GAAG,SAAS,CAAC;QAClF,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;KAC5B,CAAC;IAEF,qDAAqD;IACrD,SAAS,EAAE,iBAAiB,CAAC;IAE7B;;;;;OAKG;IACH,MAAM,CACJ,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,aAAa,EAClB,eAAe,CAAC,EAAE,OAAO,GACxB,aAAa,CAAC,eAAe,CAAC,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,E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