Commit e69d41b
Inject request object if root page wants it (zauberzeug#5263)
### Motivation
Root page functions should support the same parameter injection patterns
as regular `@ui.page()` decorated functions for consistency and to
provide access to request details (headers, cookies, URL components,
etc.).
### Implementation
Reuse existing page._wrap() infrastructure rather than duplicating
logic. The wrapped page function already inspects signatures and injects
request when present, so we simply avoid conflicting with it.
There currently is no proper documentation location for root page
specifics. Therefor I decided to not do this in this PR (simplifies
review) and ideally add another PR later to do comprehensive
documentation for root page.
### Progress
- [x] I chose a meaningful title that completes the sentence: "If
applied, this PR will..."
- [x] The implementation is complete.
- [x] Pytests have been added.
- [x] Documentation will be added in a separate PR.
---------
Co-authored-by: Falko Schindler <[email protected]>1 parent f3d2c9a commit e69d41b
2 files changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments