Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget Messaging Protocol Schema #3220

Open
daviddavo opened this issue Jun 22, 2021 · 5 comments
Open

Widget Messaging Protocol Schema #3220

daviddavo opened this issue Jun 22, 2021 · 5 comments
Labels

Comments

@daviddavo
Copy link

Problem

I'm doing an implementation of jupyter-widgets for the IHaskell kernel, and I'm using messages.md as a reference.
I can't seem to understand what version_major and version_minor are on the display_data message.

Are they the widget messaging protocol version, as specified in the comm_open message? Are they the widgets' view module version? Or these numbers come from a completely different thing.

Suggested Improvement

Specifying where these numbers come from

@daviddavo daviddavo added the docs label Jun 22, 2021
@daviddavo
Copy link
Author

daviddavo commented Jun 22, 2021

Okay, so I think I clarified my doubts by reading the json schema.

But I still think that the documentation could be improved, saying that the version is optional

@jasongrout
Copy link
Member

jasongrout commented Jun 22, 2021

Great question. The version_major and version_minor in the display_data message are for the format of that specific message. In other words, if that display_data message ever changes its json format, we would increment that version.

Are they the widget messaging protocol version, as specified in the comm_open message?

Right now it is in sync(both are version 2.0).

I notice that the existing docs say "Widgets are displayed via display_data messages, which now include the version of the schema", which seems to imply to me that the two version numbers should stay in sync.

Are they the widgets' view module version?

No, that is transmitted in the widget model data, not in the display_data message.

@daviddavo
Copy link
Author

Thank you very much!

@bollwyvl
Copy link
Contributor

Thanks for bringing this up.

I'd love to see that core schema complemented (in another file) with a concrete schema of all the public widget models, and custom events. This nasty PR shows such a thing is possible, generating a TS backend for at least parts of ~60 of the ~80 core classes (including private classes and members)... but eventually, it seems like the Schema could become the source of truth, and could be used to test the public API of different implementation... especially if we warmed jupyter_kernel_test back up.

@daviddavo
Copy link
Author

I have another question. I'm trying to implement the Output widget, but I can't make it work.

I've been "reverse-engineering" the messages exchanged when I use it on IPython and replicating it on my kernel, but I still can't make anything appear on the cell where I've displayed the output widget. Not even plain text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants