(
self, old_state: _ModelState
)
| 158 | return update_task.result() |
| 159 | |
| 160 | async def _create_layout_update( |
| 161 | self, old_state: _ModelState |
| 162 | ) -> LayoutUpdateMessage: |
| 163 | new_state = _copy_component_model_state(old_state) |
| 164 | component = new_state.life_cycle_state.component |
| 165 | |
| 166 | async with AsyncExitStack() as exit_stack: |
| 167 | await self._render_component(exit_stack, old_state, new_state, component) |
| 168 | |
| 169 | if REACTPY_CHECK_VDOM_SPEC.current: |
| 170 | validate_vdom_json(new_state.model.current) |
| 171 | |
| 172 | return { |
| 173 | "type": "layout-update", |
| 174 | "path": new_state.patch_path, |
| 175 | "model": new_state.model.current, |
| 176 | } |
| 177 | |
| 178 | async def _render_component( |
| 179 | self, |
no test coverage detected