docs(mesh): mark the newly exported mesh types @experimental
#181 exported Link, ReconnectOptions, ManifestPolicy, SocketCtor, EventfulSocket, RouteEntry, RemoteScopeNode, RemoteRoute and MeshControlDeps without the tag the other mesh exports carry, so they would have read as part of the frozen API. They are mesh plumbing, outside the freeze like MeshConfig. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
5 files changed
+51
-8
No files matched your search
+12
-2
@@ -37,7 +37,12 @@ export function toWsRequest(request: Request, ip: string): WsRequest {
|
||||
};
|
||||
}
|
||||
|
||||
/** The subset of a host WebSocket that {@link eventSocket} drives (Deno's WebSocket and workerd's both satisfy it). */
|
||||
/**
|
||||
* The subset of a host WebSocket that {@link eventSocket} drives (Deno's WebSocket and workerd's both satisfy it).
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
*/
|
||||
export interface EventfulSocket {
|
||||
readonly readyState: number;
|
||||
/** Bytes queued by `send` and not yet written. Deno reports it; a host without it is never waited on. */
|
||||
@@ -153,7 +158,12 @@ async function pollDrained(host: Pick<EventfulSocket, 'readyState' | 'bufferedAm
|
||||
}
|
||||
}
|
||||
|
||||
/** Constructs a host WebSocket *client*. Both the platform global and the `ws` package satisfy it. */
|
||||
/**
|
||||
* Constructs a host WebSocket *client*. Both the platform global and the `ws` package satisfy it.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
*/
|
||||
export type SocketCtor = new (url: string) => EventfulSocket;
|
||||
|
||||
/**
|
||||
|
||||
+15
-2
@@ -5,14 +5,24 @@ import { connectSocket, type SocketCtor } from '../http/ws-adapter';
|
||||
import { sendWhenDrained, type WsSocket } from '../http/ws-core';
|
||||
import { encode, decode, MESH_PROTOCOL_VERSION, type Manifest, type RequestEnvelope, type Frame } from './protocol';
|
||||
|
||||
/** Client handle to a remote mesh server: its manifest, an RPC caller, and a close(). */
|
||||
/**
|
||||
* Client handle to a remote mesh server: its manifest, an RPC caller, and a close().
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
*/
|
||||
export interface Link {
|
||||
manifest: Manifest;
|
||||
rpc(kind: 'scope' | 'route', name: string, ctx: RequestEnvelope): Promise<unknown>;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
/** Backoff bounds for reconnection. `false` disables reconnecting entirely. */
|
||||
/**
|
||||
* Backoff bounds for reconnection. `false` disables reconnecting entirely.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
*/
|
||||
export interface ReconnectOptions {
|
||||
/** Delay before the first retry; doubles from here (default: 500ms). */
|
||||
initialDelayMs?: number;
|
||||
@@ -26,6 +36,9 @@ export interface ReconnectOptions {
|
||||
* Only `'refuse'` exists. It is a named strategy rather than implicit behaviour so that hot graph
|
||||
* reconciliation can arrive later as `'reconcile'` *additively* — peers run on separate deploy
|
||||
* cadences, and silently changing what the default means is the worst kind of breaking change.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
*/
|
||||
export type ManifestPolicy = 'refuse';
|
||||
|
||||
|
||||
@@ -54,7 +54,12 @@ export interface RequestEnvelope {
|
||||
correlation?: { requestId?: string; traceId?: string };
|
||||
}
|
||||
|
||||
/** Manifest entry for an exported route. */
|
||||
/**
|
||||
* Manifest entry for an exported route.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
*/
|
||||
export interface RouteEntry {
|
||||
method: string;
|
||||
pattern: string;
|
||||
|
||||
+12
-2
@@ -2,12 +2,22 @@ import type { Link } from './link';
|
||||
import type { RequestEnvelope } from './protocol';
|
||||
import type { ResponseShape } from '../pipeline';
|
||||
|
||||
/** Local proxy for a remote scope: runs the RPC and returns its token→value binding. */
|
||||
/**
|
||||
* Local proxy for a remote scope: runs the RPC and returns its token→value binding.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
*/
|
||||
export interface RemoteScopeNode {
|
||||
name: string;
|
||||
run: (ctx: any) => Promise<Record<string, unknown>>;
|
||||
}
|
||||
/** Local proxy for a remote route: forwards the request envelope over the link. */
|
||||
/**
|
||||
* Local proxy for a remote route: forwards the request envelope over the link.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
*/
|
||||
export interface RemoteRoute {
|
||||
method: string;
|
||||
pattern: string;
|
||||
|
||||
+6
-1
@@ -90,7 +90,12 @@ function safeEqual(left: string, right: string): boolean {
|
||||
return crypto.timingSafeEqual(leftBuf, rightBuf);
|
||||
}
|
||||
|
||||
/** Dependencies for the mesh control handler: shared secret, manifest, and scope/route resolvers. */
|
||||
/**
|
||||
* Dependencies for the mesh control handler: shared secret, manifest, and scope/route resolvers.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
*/
|
||||
export interface MeshControlDeps {
|
||||
secret: string;
|
||||
manifest: Manifest;
|
||||
|
||||
Reference in new issue
Block a user