Add mizan-ts: TypeScript backend adapter proving AFI is language-agnostic
The TypeScript adapter produces the same manifest, the same X-Mizan-Invalidate headers, the same JSON invalidation protocol, and the same CDN-ready response headers as mizan-django. One Edge Worker. Two backend languages. Same protocol. Features: - @client decorator (function wrapper + class method decorator) - ReactContext class (same API as Django adapter) - Registry with context groups and param tracking - Context bundled GET: /api/mizan/ctx/<name>/ - Mutation POST: /api/mizan/call/ with server-driven invalidation - Three-tier auto-scoping (argument name matching → broad fallback) - Function-level affects targeting - private=True (rejected from RPC, in manifest for Edge) - X-Mizan-Invalidate header with URL-encoded params - Edge manifest generation (identical format to Django's) - render_strategy + user_scoped derivation 22 edge compatibility tests pass (Bun, 21ms): - Deterministic JSON, sorted keys - Cache-Control: public on GETs, no-store on mutations/errors - Vary: Authorization, Cookie - Header round-trip with special characters - Auto-scoped invalidation matches body and header - Function-level invalidation - Private function rejection - Manifest structure with PSR/dynamic_cached strategies Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
14
packages/mizan-ts/package.json
Normal file
14
packages/mizan-ts/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@mizan/ts",
|
||||
"version": "0.1.0",
|
||||
"description": "Mizan TypeScript backend adapter — server functions, context bundling, invalidation protocol.",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"test": "bun test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bun-types": "latest"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
Reference in New Issue
Block a user