Skip to content

Conversation

trungleduc
Copy link
Member

@trungleduc trungleduc commented Sep 15, 2025

References

  • This PR refactors progressive rendering in Voilà, enabling the frontend to dispatch cell execution requests incrementally via the Jupyter kernel websocket API instead of a custom execution request endpoint

  • Notebook cell execution is now fully compatible with the Jupyter kernel API, reducing reliance on Voilà-specific server endpoints and the nbconvert execution mechanism. As a by-product, Rendering stuck randomly #1428 is fixed in the new progressive rendering mode

vl22.mp4

Code changes

Frontend

  • The frontend now loops through notebook cells and sends execution requests one at a time using the kernel websocket protocol (instead of a custom execution request handler).
  • Output areas for each cell are created and attached dynamically; visual skeletons are removed as soon as execution completes.
  • To avoid leaking notebook source code, the execution code is the cell index, which the server translates to the actual cell source before forwarding the message to the kernel.
  • The rendering logic is simplified: outputs are updated in-place, and loading indicators are managed per cell.

Backend

  • The custom WebSocket-based ExecutionRequestHandler is removed. Instead, progressive rendering is now handled via the standard kernel websocket handler (VoilaKernelWebsocketHandler).
  • The handler intercepts execute_request messages, replaces the code payload (which is the cell index) with the actual notebook cell source, and passes the message to the Jupyter kernel.
  • Output and error messages are masked as needed based on configuration.

User-facing changes

N/A

Backwards-incompatible changes

  • The custom execution endpoint /voila/execution/ is removed
  • The kernel handler endpoints /api/kernels/ and /api/kernels/%s/channels are scoped under the /voila/ prefix and become /voila/api/kernels and /voila/kernels/%s/channels

Copy link
Contributor

Binder 👈 Launch a Binder on branch trungleduc/voila/new-exec

@trungleduc trungleduc added enhancement New feature or request api-change labels Sep 15, 2025
@trungleduc trungleduc marked this pull request as ready for review September 17, 2025 09:35
@trungleduc
Copy link
Member Author

trungleduc commented Sep 17, 2025

Due to the breaking change, this feature should be released in 0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant