dd41f0c25f8057909611ce9bbd50c4315dcb5980
The @client decorator + ServerFunction base + composition machinery is mostly framework-agnostic. The only Django couplings were typing (HttpRequest in __init__ and submit_handler signatures) and runtime view-path detection (HttpResponseBase isinstance/issubclass checks). Replaced both with backend-extension hooks: - HttpRequest type hints → Any. Type Protocol can be tightened later. - HttpResponseBase view-path detection → set_framework_response_base(cls) hook in mizan_core.client.function. Backends register their framework's response base at import time. is_framework_response(obj_or_cls) handles both instance and subclass checks via the registered base. mizan-django registers HttpResponseBase via mizan/client/__init__.py before any @client-decorated code is loaded. FastAPI would similarly register starlette.responses.Response. Direct consumers updated: - mizan/setup/discovery.py: ServerFunction import path - mizan/forms/__init__.py: ServerFunction + create_form_functions imports mizan/client/__init__.py keeps its public re-export surface stable so 'from mizan.client import client, ServerFunction, …' continues to work for downstream Django consumers. Verified: - mizan-core: 15/15 - mizan-django: 348 pass, 21 skip, 0 fail - mizan-ts edge-compat: 34/34 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Description
No description provided
Languages
Python
45.2%
TypeScript
32.2%
Rust
20.8%
Jinja
1.3%
JavaScript
0.3%
Other
0.2%