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

Add core widget base class providing module semver ranges #1027

Merged
merged 3 commits into from
Feb 1, 2017

Conversation

SylvainCorlay
Copy link
Member

@SylvainCorlay SylvainCorlay commented Jan 6, 2017

Closes #1002.

On the Python side, I use multiple inheritance to specify the version range for all core widgets without impacting the base Widget and DOMWidget 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?

@@ -0,0 +1,18 @@
"""Base widget class for widgets provided in Core

Represents a container that can be used to group other widgets.
Copy link
Member

Choose a reason for hiding this comment

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

Delete this line?

@jasongrout
Copy link
Member

Proposed solution: use '^' + require('../package.json'),version

That sounds consistent to me.

@jasongrout
Copy link
Member

jasongrout commented Jan 6, 2017

Maybe this?

`^${require('../package.json').version}`

@SylvainCorlay
Copy link
Member Author

Maybe this?
^${require('../package.json').version}

This is cool :)

@SylvainCorlay SylvainCorlay force-pushed the core_widget branch 2 times, most recently from 3bbe059 to a1494f8 Compare January 9, 2017 13:08
@SylvainCorlay
Copy link
Member Author

So on the js side, I have CoreWidgetModel and CoreDomWidgetModel since default() will not work well with multiple inheritance.

@SylvainCorlay SylvainCorlay changed the title WIP Add core widget base class providing module semver ranges Add core widget base class providing module semver ranges Jan 13, 2017
@SylvainCorlay
Copy link
Member Author

So if the semver req specified by the backend for a model is ^4.3.0, and the installed/available js version is 4.4.3, what happens when the backend opens a widget, is that the value for model_module_version stored in the model is ^4.3.0.

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.

@SylvainCorlay
Copy link
Member Author

@ellisonbg @jasongrout

@SylvainCorlay
Copy link
Member Author

After in-person discussion with @jasongrout on this, we decided that this was still the right approach.

@SylvainCorlay SylvainCorlay merged commit e345086 into jupyter-widgets:master Feb 1, 2017
@SylvainCorlay SylvainCorlay deleted the core_widget branch February 1, 2017 15:01
@jasongrout jasongrout modified the milestone: 6.0 Feb 28, 2017
@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 19, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide other value than '*' for core widgets' [model/view]_module_version
2 participants