-
Notifications
You must be signed in to change notification settings - Fork 947
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
Add core widget base class providing module semver ranges #1027
Add core widget base class providing module semver ranges #1027
Conversation
ipywidgets/widgets/widget_core.py
Outdated
@@ -0,0 +1,18 @@ | |||
"""Base widget class for widgets provided in Core | |||
|
|||
Represents a container that can be used to group other widgets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this line?
That sounds consistent to me. |
Maybe this?
|
6eec3d5
to
4f45187
Compare
This is cool :) |
3bbe059
to
a1494f8
Compare
So on the js side, I have |
a1494f8
to
c2a1b6c
Compare
So if the semver req specified by the backend for a model is When we save the widget state, this value is different from the js-side default (^4.4.3) and therefore is the one used in the serialization. An idea would be to have a custom serializer for these attributes to restrict the semver range. |
1b1f541
to
69edd5d
Compare
69edd5d
to
da1f698
Compare
After in-person discussion with @jasongrout on this, we decided that this was still the right approach. |
Closes #1002.
On the Python side, I use multiple inheritance to specify the version range for all core widgets without impacting the base
Widget
andDOMWidget
classes that are used in third-party libraries.On the JS side, I still need to make the change.
Proposed solution: use
'^' + require('../package.json').version
@jasongrout thoughts?