Restore stashed WIP: live streaming plan, forms, CI pipeline, streaming demo

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 22:07:59 +00:00
parent df1aa4e1d1
commit 5a68046bd8
21 changed files with 1463 additions and 120 deletions

View File

@@ -243,8 +243,24 @@ class PageDef:
menu_expr: Any
stream: bool = False # enable streaming response
fallback_expr: Any = None # fallback content while streaming
shell_expr: Any = None # immediate shell content (wraps suspense)
closure: dict[str, Any] = field(default_factory=dict)
_FIELD_MAP = {
"name": "name", "path": "path", "auth": "auth",
"layout": "layout", "cache": "cache",
"data": "data_expr", "content": "content_expr",
"filter": "filter_expr", "aside": "aside_expr",
"menu": "menu_expr", "stream": "stream",
"fallback": "fallback_expr", "shell": "shell_expr",
}
def get(self, key, default=None):
attr = self._FIELD_MAP.get(key)
if attr is not None:
return getattr(self, attr)
return default
def __repr__(self):
return f"<page:{self.name} path={self.path!r}>"