Commit 540a354
fix(engine): close out the two pinned bugs from slices 1+2
1. Reactive class= binding (markup.py):
- Passing a state proxy to classes= (or .classes(), or via the new
class_name= React-style alias) now emits class="<current>" AND
data-bind-class="<state.path>" at SSR — picked up by the existing
ReactiveRegistry updater in client.py.
- class_name= is honored as an alias because `class` is a Python keyword;
it routes through the same reactive-binding path.
- examples/reactivity.py:73 (b.div(class_name=UiState.theme, ...)) now
does what its author intended.
2. Bundle generator handles nested defs (app.py):
- _generate_bundle now textwrap.dedent()s the source returned by
inspect.getsource() for both state classes and user functions, and
filters decorator lines with .strip().startswith("@"). Nested
@app.local / @app.client.* defs (factories, tests) now produce valid
bundles.
Tests now positive on both behaviors; the two strict xfails are gone.
35 passed, 0 xfailed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1c78dc9 commit 540a354
3 files changed
Lines changed: 65 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
155 | 142 | | |
156 | 143 | | |
157 | 144 | | |
| |||
169 | 156 | | |
170 | 157 | | |
171 | 158 | | |
| 159 | + | |
172 | 160 | | |
173 | 161 | | |
174 | 162 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 163 | + | |
| 164 | + | |
188 | 165 | | |
189 | 166 | | |
190 | 167 | | |
| |||
196 | 173 | | |
197 | 174 | | |
198 | 175 | | |
199 | | - | |
| 176 | + | |
200 | 177 | | |
201 | 178 | | |
202 | 179 | | |
203 | 180 | | |
204 | 181 | | |
205 | 182 | | |
206 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| 608 | + | |
| 609 | + | |
608 | 610 | | |
609 | 611 | | |
610 | | - | |
| 612 | + | |
611 | 613 | | |
612 | 614 | | |
613 | 615 | | |
| |||
630 | 632 | | |
631 | 633 | | |
632 | 634 | | |
633 | | - | |
634 | | - | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
635 | 638 | | |
636 | 639 | | |
637 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
80 | 92 | | |
81 | 93 | | |
82 | 94 | | |
| |||
107 | 119 | | |
108 | 120 | | |
109 | 121 | | |
110 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
111 | 129 | | |
112 | 130 | | |
113 | | - | |
| 131 | + | |
114 | 132 | | |
115 | 133 | | |
116 | 134 | | |
| |||
183 | 201 | | |
184 | 202 | | |
185 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
186 | 207 | | |
187 | 208 | | |
188 | 209 | | |
| |||
0 commit comments