Skip to content

Expose comm and custom messages on the widget model#30

Merged
martinRenou merged 1 commit into
QuantStack:mainfrom
arjxn-py:custom-msgs
Jul 15, 2026
Merged

Expose comm and custom messages on the widget model#30
martinRenou merged 1 commit into
QuantStack:mainfrom
arjxn-py:custom-msgs

Conversation

@arjxn-py

Copy link
Copy Markdown
Member

No description provided.


private _onMsg = (msg: KernelMessage.ICommMsgMsg<'iopub' | 'shell'>) => {
if (msg.buffers) {
if (msg.buffers && msg.buffers.length > 0) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is unfortunate, as we wouldn't be able to send custom comm messages that contain binary buffers. They would be trapped in here and processed as ydoc sync messages.

I think for now this is fine as we're only providing a new feature to partially support custom comms, but we should consider making a breaking change in both ypywidgets and yjs-widgets to properly define a comm protocol with ydoc sync messages properly separated.

I'm thinking something like

Suggested change
if (msg.buffers && msg.buffers.length > 0) {
if (msg.type === 'ydoc-sync') {

Let's track that in an issue and resolve later.

@martinRenou martinRenou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think this is looking good

@martinRenou martinRenou added the enhancement New feature or request label Jul 15, 2026
@martinRenou martinRenou merged commit 1da6732 into QuantStack:main Jul 15, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants