You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also apply the following diff if you only want to support ipywidgets==8 from now on:
53
+
54
+
```diff
55
+
- "@jupyter-widgets/base": "^2 || ^3 || ^4",
56
+
+ "@jupyter-widgets/base": "^5 || ^6",
57
+
```
58
+
59
+
Note that "@jupyter-widgets/base" version 5 is for ipywidgets 8 support in the front-end, "@jupyter-widgets/base" version 6 is for ipywidgets 8 **and JupyterLab 4** support in the front-end.
60
+
61
+
The ``ManagerBase`` class has been moved from the ``@jupyter-widgets/base`` package to the new ``@jupyter-widgets/base-manager`` package. So if you used to depend on that ``ManagerBase`` class, you need to add the new dependency in your ``package.json`` as following, and update your imports accordingly.
62
+
63
+
```diff
64
+
+ "@jupyter-widgets/base-manager": "^1",
65
+
```
66
+
67
+
### Updating the client-side code
68
+
69
+
#### Phosphor -> Lumino
70
+
71
+
The Phosphor library has been archived. It has been forked and renamed "Lumino", and the maintenance is now done under the JupyterLab governance: https://github.com/jupyterlab/lumino
72
+
73
+
If you used to import classes like ``JupyterPhosphorPanelWidget`` and ``JupyterPhosphorWidget`` from the ``@jupyter-widgets/base`` library, you will need to update them:
74
+
75
+
```diff
76
+
- import { JupyterPhosphorPanelWidget, JupyterPhosphorWidget } from '@jupyter-widgets/base';
77
+
+ import { JupyterLuminoPanelWidget, JupyterLuminoWidget } from '@jupyter-widgets/base';
78
+
```
79
+
80
+
The ``DOMWidgetView.pWidget`` property has been renamed ``DOMWidgetView.luminoWidget`` (though an alias for ``pWidget`` is available for conveniance):
81
+
82
+
```diff
83
+
- this.pWidget
84
+
+ this.luminoWidget
85
+
```
86
+
87
+
The ``DOMWidgetView.processPhosphorMessage`` method has been renamed ``DOMWidgetView.processLuminoMessage``. If you want to support both ipywidgets 7.x and 8.x, you should implement both methods:
+ this._processLuminoMessage(msg, (DOMWidgetView as any).processPhosphorMessage);
109
+
+ }
110
+
+
111
+
+ processLuminoMessage(msg: Message): void {
112
+
+ this._processLuminoMessage(msg, (DOMWidgetView as any).processLuminoMessage);
113
+
+ }
114
+
```
115
+
116
+
I you're dropping ipywidgets 7.x support, you can simply rename the `processPhosphorMessage` method into `processLuminoMessage`.
117
+
118
+
#### ManagerBase import
119
+
120
+
As mentionned before, if you depend on the ``ManagerBase`` class, you will need to update the import:
121
+
122
+
```diff
123
+
- import { ManagerBase } from '@jupyter-widgets/base';
124
+
+ import { ManagerBase } from '@jupyter-widgets/base-manager';
125
+
```
126
+
127
+
#### Backbone extend
128
+
129
+
If you were extending the base widget model with `var CustomWidgetModel = Widget.extend({ ... });` you will need to update the class definition using the ES6 notation:
130
+
131
+
```diff
132
+
- var CustomWidgetModel = Widget.extend({
133
+
- ...
134
+
- });
135
+
+ class CustomWidgetModel extends Widget {
136
+
+ ...
137
+
+ }
138
+
```
139
+
7
140
Migrating from 6.0 to 7.0
8
141
-------------------------
9
142
@@ -14,7 +147,7 @@ For example migrations, see these PRs:
14
147
15
148
To avoid tying your development cycle to ipywidgets, we recommend starting
16
149
the migration on a branch and keeping that branch open until ipywidgets 7.0
17
-
is released.
150
+
is released.
18
151
19
152
We also recommend testing the migration in a completely new notebook, rather
20
153
than one that contains widgets that you instantiated with ipywidgets 6.0.
@@ -30,9 +163,9 @@ cycle through the tags until you see the latest 7.0.0 tag.
30
163
31
164
Next, we should update the JavaScript dependencies. The most important change
32
165
for widget developers is that the JavaScript package for jupyter-widgets has
33
-
been split between `@jupyter-widgets/base` and `@jupyter-widgets/controls`:
166
+
been split between `@jupyter-widgets/base` and `@jupyter-widgets/controls`:
34
167
-`@jupyter-widgets/base` contains the base widget classes and the layout
35
-
classes
168
+
classes
36
169
-`@jupyter-widgets/controls` contains the widget classes for the
37
170
user-facing widgets.
38
171
@@ -105,7 +238,7 @@ that matches a release on NPM. The most common pattern is to request a
105
238
version compatible with the version currently in your `package.json` by using,
106
239
`~{{ version number }}` for `_model_module_version` and `_view_module_version`. See the [cookiecutter
0 commit comments