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:
@@ -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}>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user