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:
16
packages/mizan-ts/tsconfig.json
Normal file
16
packages/mizan-ts/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"declaration": true,
|
||||
"types": ["bun-types"]
|
||||
},
|
||||
"include": ["src/**/*", "tests/**/*"]
|
||||
}
|
||||
Reference in New Issue
Block a user