docs(mesh): mesh may change in any release, and only within its own surface
Make the wording consistent: mesh is alpha and may change in any release. The JSDoc tags said 'a minor release' while the README said 'any'. State the rule mesh now follows. Its surface is the @experimental exports, MeshConfig and the mesh:* events. A mesh change stays inside that surface: it adds no createApp option, App method or decorator, and it changes no stable type. Mesh adapts to the stable API instead of moving it. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
11 files changed
+24
-24
No files matched your search
+1
-1
@@ -242,7 +242,7 @@ npm treats versions as semver and semver forbids leading zeros.
|
||||
`envelopeFrom`, `buildManifest`, `createMeshControl`, `MESH_CONTROL_PATH`, `Manifest`,
|
||||
`RequestEnvelope`, `Frame` and `MeshConfig`. They stay exported, unchanged. The mesh already needs
|
||||
`createApp({ experimental: true })`; the tag says the same thing in the types: these are outside
|
||||
the API freeze and may change in a minor release.
|
||||
the API freeze and may change in any release.
|
||||
- **Every `304` is bodiless** (#114). A `304` has no body and no `content-*` headers on any adapter,
|
||||
including one from `throw new NotModified()`, which used to go out with the default JSON
|
||||
envelope's `content-type`.
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ Bun and the edge in its `runtimes` job.
|
||||
- Write tests for new behavior (TDD welcome). We use Vitest.
|
||||
- `complexity:check` caps the cognitive complexity of every function in `src/`. What it measures is how much you have to hold in your head to follow a function from top to bottom, and it charges nesting more heavily than branching: a condition inside a closure inside a function costs several times what the same condition costs at the top level. Going over the threshold is not a verdict on your code — it means one function has grown to ask too much of whoever reads it next. The fix is nearly always to lift a nested closure out to module scope, where its branches are charged once instead of three times over. Raising `COMPLEXITY_MAX` is not the fix, even though the script suggests it.
|
||||
- Keep runtime dependencies at zero beyond `reflect-metadata`.
|
||||
- **The public API is frozen from RC.1, and `api/` is its record.** `api/*.api.md` holds one report per export-map entry, and `npm run api:check` fails when the build declares something they do not. If you meant to change the API, run `npm run build && npm run api` and commit the regenerated report with your change, so the reviewer reads the API change as a diff rather than finding it after release. From RC.1 to stable, releases are fixes only, so a pull request that changes a report needs the owner to reopen the freeze first. The policy is in the README under [API stability](./README.md#api-stability). The check also fails when a public signature names a type its entry point does not export, because a user would have no way to name it. Mesh is `@experimental` and outside the freeze, but it is still in the report, so a mesh change shows up there too.
|
||||
- **The public API is frozen from RC.1, and `api/` is its record.** `api/*.api.md` holds one report per export-map entry, and `npm run api:check` fails when the build declares something they do not. If you meant to change the API, run `npm run build && npm run api` and commit the regenerated report with your change, so the reviewer reads the API change as a diff rather than finding it after release. From RC.1 to stable, releases are fixes only, so a pull request that changes a report needs the owner to reopen the freeze first. The policy is in the README under [API stability](./README.md#api-stability). The check also fails when a public signature names a type its entry point does not export, because a user would have no way to name it. Mesh is alpha, `@experimental` and outside the freeze. Mesh adapts to the stable API and never changes it. Its own surface is the exports tagged `@experimental`, the shape of `MeshConfig` behind the `mesh` option, and the `mesh:*` lifecycle events. A mesh change may alter those and nothing else. It cannot add a `createApp` option, an `App` method or a decorator, and it cannot change a stable type. If mesh needs something the stable API does not offer, it builds on what is there. It is still in the report, so a reviewer can confirm a mesh change touched only mesh.
|
||||
- A new option or method on a public interface has to change that interface too. An implementation that grows a parameter without `src/app/types.ts` growing it as well is unreachable for anyone consuming the package.
|
||||
- New public API needs a doc note in `README.md`, **and a companion pull request to [green-tea-docs](https://github.com/Expressive-Tea/green-tea-docs) updating the page that documents it.** It is a second pull request because a pull request cannot span two repositories — link the two to each other so a reviewer can see both. The documentation site used to be built by this repository's CI, so a stale page broke the build; it is now a separate repository that imports nothing from here, and nothing fails when the two disagree. Issue #18 happened when the two still lived together, which is the reason this line exists rather than a hope. If you would rather not write the docs change, say so in your pull request and a maintainer will — an unmentioned API change is the failure this line exists to prevent, not an unwritten page.
|
||||
- If your change only works on one runtime, say so in the pull request. green-tea runs on Node, Deno, Bun and the edge, and behavior that quietly differs between them is treated as a bug — an explicit "not available here" is fine, silence is not.
|
||||
|
||||
@@ -372,7 +372,7 @@ green-tea uses **calendar versioning**: `YY.M.PATCH` (e.g. `26.8.0` = the first
|
||||
- **RC.1 to stable: fixes only.** No release in that window adds, removes, renames or narrows a public API. It also deprecates nothing. If a fix needs an API change, the freeze is reopened, and the change is called out under `### Breaking` in the CHANGELOG.
|
||||
- **After stable, deprecations come before removals.** A deprecated API keeps working for at least two monthly releases. It carries JSDoc `@deprecated` naming its replacement. Where it has a runtime path, it warns once per process through `app.logger`, never `console`. It is removed only in a release whose CHANGELOG lists the removal under `### Breaking`.
|
||||
- **Every API change shows up in review.** [`api/`](./api) holds the committed API report for each entry point, and CI fails when the build no longer matches it. A deliberate change regenerates the report in the same pull request.
|
||||
- **Mesh is outside the promise.** It is `@experimental` and gated behind `createApp({ experimental: true })`, so it may change in any release. Its exports still appear in the reports, so those changes still show up in review.
|
||||
- **Mesh is alpha and outside the promise.** It is `@experimental` and gated behind `createApp({ experimental: true })`, so it may change in any release. Mesh adapts to the stable API and never changes it. Its own surface is the exports tagged `@experimental`, the shape of `MeshConfig` behind the `mesh` option, and the `mesh:*` lifecycle events. A mesh change may alter those and nothing else. It cannot add a `createApp` option, an `App` method or a decorator, and it cannot change a stable type. If mesh needs something the stable API does not offer, it builds on what is there. Its exports still appear in the reports, so those changes still show up in review.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ export interface RoutePlan {
|
||||
* Mesh networking options: a secret to gate this node's exports and/or remote teapots to connect to.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface MeshConfig {
|
||||
secret?: string;
|
||||
|
||||
@@ -41,7 +41,7 @@ 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).
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface EventfulSocket {
|
||||
readonly readyState: number;
|
||||
@@ -162,7 +162,7 @@ async function pollDrained(host: Pick<EventfulSocket, 'readyState' | 'bufferedAm
|
||||
* 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.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export type SocketCtor = new (url: string) => EventfulSocket;
|
||||
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ export type { TlsOptions, CorsOptions, SecurityOptions } from './security';
|
||||
export type { UploadedFile, MultipartBody } from './multipart';
|
||||
export type { StandardSchemaV1, StandardIssue, StandardResult } from './standard-schema';
|
||||
|
||||
// Mesh — experimental (`createApp({ experimental: true })`): outside the API freeze, may change in a minor.
|
||||
// Mesh — experimental (`createApp({ experimental: true })`): outside the API freeze, may change in any release.
|
||||
export { connectLink } from './mesh/link';
|
||||
export { buildRemote, envelopeFrom } from './mesh/teacup';
|
||||
export { buildManifest, createMeshControl, MESH_CONTROL_PATH } from './mesh/teapot';
|
||||
|
||||
+4
-4
@@ -9,7 +9,7 @@ import { encode, decode, MESH_PROTOCOL_VERSION, type Manifest, type RequestEnvel
|
||||
* 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.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface Link {
|
||||
manifest: Manifest;
|
||||
@@ -21,7 +21,7 @@ export interface Link {
|
||||
* 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.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface ReconnectOptions {
|
||||
/** Delay before the first retry; doubles from here (default: 500ms). */
|
||||
@@ -38,7 +38,7 @@ export interface ReconnectOptions {
|
||||
* 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.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export type ManifestPolicy = 'refuse';
|
||||
|
||||
@@ -474,7 +474,7 @@ function backoffBounds(
|
||||
* `Ctor` is injectable to exercise both client implementations on a single runtime.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export function connectLink(args: {
|
||||
url: string;
|
||||
|
||||
@@ -36,7 +36,7 @@ export const MESH_PROTOCOL_VERSION = 1;
|
||||
* green-tea simply ignores them, which costs the correlation of that hop and nothing else.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface RequestEnvelope {
|
||||
method: string;
|
||||
@@ -58,7 +58,7 @@ export interface RequestEnvelope {
|
||||
* 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.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface RouteEntry {
|
||||
method: string;
|
||||
@@ -73,7 +73,7 @@ export interface RouteEntry {
|
||||
* lazy — the token exists in the teacup's graph, and running it is an RPC.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface Manifest {
|
||||
steps: string[];
|
||||
@@ -88,7 +88,7 @@ export interface Manifest {
|
||||
* so a protocol-level heartbeat could not work on every runtime mesh claims to support.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export type Frame =
|
||||
| { type: 'hello'; v: number; secret: string }
|
||||
|
||||
+4
-4
@@ -6,7 +6,7 @@ import type { ResponseShape } from '../pipeline';
|
||||
* 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.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface RemoteScopeNode {
|
||||
name: string;
|
||||
@@ -16,7 +16,7 @@ export interface RemoteScopeNode {
|
||||
* 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.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface RemoteRoute {
|
||||
method: string;
|
||||
@@ -32,7 +32,7 @@ export interface RemoteRoute {
|
||||
* and its events on the far side join the same trace instead of starting a new one.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export function envelopeFrom(ctx: any): RequestEnvelope {
|
||||
const req = ctx?.req;
|
||||
@@ -54,7 +54,7 @@ export function envelopeFrom(ctx: any): RequestEnvelope {
|
||||
* Turn a link's manifest into local proxy nodes: lazy request-scope steps, and routes.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export function buildRemote(link: Link): { steps: RemoteScopeNode[]; routes: RemoteRoute[] } {
|
||||
const steps: RemoteScopeNode[] = link.manifest.steps.map((token) => ({
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@ import {
|
||||
* to it on an app without a control channel closes `1008` on every adapter.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export const MESH_CONTROL_PATH = '/__mesh__/control';
|
||||
|
||||
@@ -77,7 +77,7 @@ export function controlFrameLimit(maxBodyBytes = DEFAULT_MAX_BODY_BYTES): number
|
||||
* Assemble a {@link Manifest} from exported step tokens and buffered routes.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export function buildManifest(args: { steps: string[]; routes: RouteEntry[] }): Manifest {
|
||||
return { steps: [...args.steps], routes: args.routes };
|
||||
@@ -94,7 +94,7 @@ function safeEqual(left: string, right: string): boolean {
|
||||
* 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.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface MeshControlDeps {
|
||||
secret: string;
|
||||
@@ -292,7 +292,7 @@ async function serveFrames(
|
||||
* Build a control handler that authenticates peers and serves scope/route RPCs from the manifest.
|
||||
*
|
||||
* @experimental Part of the mesh, which needs `createApp({ experimental: true })`: outside the
|
||||
* API freeze, so it may change in a minor release.
|
||||
* API freeze, so it may change in any release.
|
||||
*/
|
||||
export function createMeshControl(deps: MeshControlDeps): {
|
||||
path: string;
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ export interface PipelineStep {
|
||||
* A fully materialized HTTP response produced by a transformer.
|
||||
*
|
||||
* @experimental Public only through the mesh (`MeshControlDeps`, `RemoteRoute`), which needs
|
||||
* `createApp({ experimental: true })`: outside the API freeze, so it may change in a minor release.
|
||||
* `createApp({ experimental: true })`: outside the API freeze, so it may change in any release.
|
||||
*/
|
||||
export interface ResponseShape {
|
||||
status: number;
|
||||
|
||||
Reference in new issue
Block a user