-
Notifications
You must be signed in to change notification settings - Fork 948
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
Versioning changes #1242
Comments
Thanks for opening this. I want to give this the attention it deserves but cannot give a thorough response today. Will get back to this tomorrow. |
One problem we have the current versioning system is that we really have at least three different things we need to version in the jupyter-js-widgets package:
We could simplify the view version to just be the model version the view understands. In order to do that, we really need the model to encapsulate all messages that can go between the kernel and frontend, which we could do by making everything go through the state attributes (for example, for button clicks, a new button state attribute that is number of times clicked). |
See #1235 for more comments. |
I am ready to discuss this now! |
So from the in-person discussions with @jasongrout about the protocol specifications Asymmetry There are a few intrinsic reasons why the widget protocol will remain somewhat asymmetrical.
Overriding core model modules and view modules
The
|
Here's a case where we want a model spec version number to have a minor version bump: if we add a widget to a package, the |
And I think that is a problem that needs to be solved in the widgets themselves (i.e., disambiguating the models), not in the registration string. |
I should add that the model state specification for a given model must include the default values for each field - since those default values are not stored in the persisted serialization in the notebook, for example, they should be specified as part of the model name/module/version metadata. This means we can't have two widgets that have the same model/view metadata, but different defaults for the model fields. |
If no default is specified, no value will be dropped upon serialization. |
I think the two fundamental tensions going on in the Then if the kernel-side implementation specifies a (Also, we should really call it |
Okay, a couple more alternatives: (a) new more backwards compatible thought: introduce a new optional (b) split up jupyter-js-widgets into a base package (responsible for the widget protocol via the base widget manager), a models package (implementing the model specs), and a views package (implementing the view specs). And maybe for backwards compatibility, leave jupyter-js-widgets as a package that depends on the three and exports them all. Then the models, views, and widget protocol can advance separately. |
I prefer |
One thing about (a) is that, since the |
Fixed in #1313. |
The model specification for a widget (i.e., the list of model traits) is implemented at least two places: the kernel and the frontend. Because we want different frontend and kernel-side implementations to exist, the model state specification should probably not be tied to any particular package name or version. Also, I think the view should be defined by the model version it supports and the name/module. (i.e., the version should essentially be '*'). In order for that to happen, we probably need to get rid of custom messages (which are sent from the view to the kernel) and instead route all of that information through the state.
The model version should only support the major part of the version number (i.e., essentially be an integer). Any change in the actual attributes of the models (whether adding, deleting, or even changing intent of the attribute) should be a breaking change in the model specification.
CC @SylvainCorlay
The text was updated successfully, but these errors were encountered: