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/js/40_jupyter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/js/40_jupyter.js') diff --git a/cli/js/40_jupyter.js b/cli/js/40_jupyter.js index ae257f1c1..10dbccf4c 100644 --- a/cli/js/40_jupyter.js +++ b/cli/js/40_jupyter.js @@ -9,8 +9,8 @@ function enableJupyter() { } = core.ensureFastOps(); globalThis.Deno.jupyter = { - async broadcast(msgType, content) { - await op_jupyter_broadcast(msgType, content); + async broadcast(msgType, content, { metadata = {} } = {}) { + await op_jupyter_broadcast(msgType, content, metadata); }, }; } -- cgit v1.2.3