Skip to content

Commit 539c8b2

Browse files
committed
widgets: push comm creation to @cocalc/widgets package, so it can be done *before* model creation
1 parent c7196fd commit 539c8b2

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/packages/frontend/jupyter/widgets/manager.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -347,17 +347,6 @@ VBox([s1, s2])
347347
const model = await this.manager.get_model(model_id);
348348
this.last_changed[model_id] = { last_changed: 0 };
349349
model.on("change", this.handleModelChange);
350-
351-
// Also, setup comm channel.
352-
const comm = await this.openCommChannel({
353-
comm_id: model_id,
354-
target_name: "jupyter.widget",
355-
});
356-
model.comm = comm;
357-
model.comm_live = true;
358-
// TODO: we need to setup handling comm messages from
359-
// the kernel, which should call model._handle_comm_msg.
360-
// See ipywidgets/packages/base/src/widget.ts
361350
};
362351

363352
// handleModelChange is called when an ipywidgets model changes.
@@ -533,7 +522,7 @@ VBox([s1, s2])
533522
metadata?: JSONValue;
534523
buffers?: ArrayBuffer[];
535524
}): Promise<IClassicComm> => {
536-
// log("openCommChannel", { comm_id, target_name, data, buffers, metadata });
525+
// log("openCommChannel", { comm_id, target_name, data, buffers, _metadata });
537526
const { send_comm_message_to_kernel } = this.actions;
538527

539528
// TODO: we do not currently have anything at all that

0 commit comments

Comments
 (0)