From 7bcf1211a1494c188c9de83670d328c0492de98a Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Fri, 29 Sep 2023 18:24:09 -0400 Subject: feat(jupyter): send Jupyter messaging metadata with `Deno.jupyter.broadcast` (#20714) Exposes [`metadata`](https://jupyter-client.readthedocs.io/en/latest/messaging.html#metadata) to the `Deno.jupyter.broadcast` API. ```js await Deno.jupyter.broadcast(msgType, content, metadata); ``` The metadata is required for [`"comm_open"`](https://github.com/jupyter-widgets/ipywidgets/blob/main/packages/schema/messages.md#instantiating-a-widget-object-1) for with `jupyter.widget` target. --- cli/ops/jupyter.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cli/ops/jupyter.rs') diff --git a/cli/ops/jupyter.rs b/cli/ops/jupyter.rs index 765b062e5..12d19fab5 100644 --- a/cli/ops/jupyter.rs +++ b/cli/ops/jupyter.rs @@ -36,6 +36,7 @@ pub async fn op_jupyter_broadcast( state: Rc>, #[string] message_type: String, #[serde] content: serde_json::Value, + #[serde] metadata: serde_json::Value, ) -> Result<(), AnyError> { let (iopub_socket, last_execution_request) = { let s = state.borrow(); @@ -52,6 +53,7 @@ pub async fn op_jupyter_broadcast( last_request .new_message(&message_type) .with_content(content) + .with_metadata(metadata) .send(&mut *iopub_socket.lock().await) .await?; } -- cgit v1.2.3