| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
pyodide tests | 1 年前 | |
feat(renderbuffer): integrate diffing into core components and restore msgpack dependency (#633) * feat: skip reruns in virtual service if no state changes detected - Updates handle_message_from_js to robustly parse JsProxy input - Skips rerun execution when incoming component state matches current state - Ensures backwards compatibility with previous JS message shape - Adds eslint-config-prettier to package-lock.json (already in devDependencies) * fix(virtual_service): suppress Ruff warning and clean up Pyodide handler - Removed unused import (`Object`) from JS bridge - Suppressed RUF006 warning by explicitly allowing fire-and-forget task - Simplified `except` clause (unused exception variable) - Minor style cleanup in test page - Updated `pyodide_test.html` to initialize `PreswaldService` during testing * feat(runtime): add RenderBuffer to VirtualPreswaldService to skip redundant reruns - Introduces `RenderBuffer` class in `engine/utils.py` to track previous component state. - Integrates `RenderBuffer` into `VirtualPreswaldService` to detect and skip reruns when state hasn't changed. - Adds `update_if_changed` logic to prevent unnecessary recomputations and logging to confirm behavior. - This is a foundational step toward a reactive runtime and will be extended to `ServerPreswaldService` in a follow-up. Tested manually in `pyodide_test.html` by sending repeated identical messages and observing correct skipping of reruns. * feat(server): use RenderBuffer to skip redundant reruns in ServerPreswaldService This change introduces a render buffer for ServerPreswaldService that tracks component state and avoids unnecessary reruns when updates do not modify any actual values. Aligns behavior with VirtualPreswaldService. Logs a debug message when reruns are skipped due to unchanged state. * fix(frontend): add @monaco-editor/react dependency to fix build error The PlaygroundWidget component imports @monaco-editor/react, but the package was missing from the dependencies. This caused the frontend build to fail after syncing with upstream. This commit adds the missing package to resolve the issue. * feat(components): integrate RenderBuffer to skip redundant renders Introduces `RenderBuffer` support across all Preswald components to prevent unnecessary re-renders and frontend updates when component state has not changed. Components now use `generate_stable_id()` to ensure deterministic ids based on callsite or user-supplied identifiers, enabling consistent diffing between reruns. Additionally, common service logic has been extracted into a shared `BasePreswaldService`, now inherited by both `ServerPreswaldService` and `VirtualPreswaldService`. - All components now use `should_render()` to conditionally append - Debug logs are now guarded to avoid expensive serialization - `RenderBuffer` hashes values internally and accepts either raw objects or precomputed hashes * feat(renderbuffer): integrate diffing into core components and restore msgpack dependency - Re-added `msgpack` as a dependency in `setup.py`, now required by RenderBuffer (was previously removed when the Fastplotlib component was disabled). - Commented out the unused `render_and_send_fastplotlib()` function, which was left behind after Fastplotlib was removed from `main`. - Applied Ruff formatting and cleanup across engine and interface modules. * refactor(service): remove fastapi.WebSocket dependency from BasePreswaldService This refactor removes the direct dependency on `fastapi.WebSocket` from `BasePreswaldService` to support alternative websocket implementations such as the `VirtualWebSocket` used in Pyodide. Also includes: - Generalization of type hints for `websocket` parameters to `Any`. - Removal of the `fastapi` import from `base_service.py`. - Removed the platform constraint from the `msgpack` dependency to enable usage in Pyodide. Other unrelated changes: - Removed the platform constraint from `duckdb` as it is now required in Pyodide builds. - Updated the test wheel reference in `pyodide_test.html` from `0.1.49` to `0.1.51`. * chore: remove unnecessary import * chore: re-enable msgpack dependency for RenderBuffer hashing * chore: remove .projectile from git and ignore it in .gitignore - Untracked .projectile to prevent accidental commits - Added .projectile to .gitignore under Emacs-specific section * build(pyodide): remove platform constraint on msgpack to enable renderbuffer in virtual_service | 1 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 1 年前 |