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
Update information for custom widget authors (#3542)
* Remove the custom widget authoring guide for now.
It is based on the typescript cookiecutter, which is out of date regarding 8.0. We don't want to delay the 8.0 release, so we'll remove this guide for now and later either update the ts one to 8.0 or change this guide to use the js cookiecutter.
* Update text for migrating custom widgets from 7 to 8
* Fix links
Copy file name to clipboardExpand all lines: docs/source/migration_guides.md
+14-17Lines changed: 14 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,15 @@ widgets.
7
7
Migrating from 7.x to 8.0
8
8
-------------------------
9
9
10
+
In this section, we discuss migrating a custom widget from ipywidgets 7 to
11
+
ipywidgets 8 or supporting both ipywidgets 7 and ipywidgets 8 with the same
12
+
codebase.
13
+
14
+
For a summarized list of changes affecting custom widget authors, please see the "Developers" section of the
15
+
[changelog](./changelog) for 8.0.
16
+
17
+
Please consider updating your widget by generating a new widget from the [JavaScript widget cookiecutter](https://github.com/jupyter-widgets/widget-cookiecutter) and adapting the code to your widget, since the cookiecutter has been updated to use best practices in Python packaging and Jupyter Widget infrastructure.
To avoid tying your development cycle to ipywidgets, we recommend starting
21
-
the migration on a branch and keeping that branch open until ipywidgets 8.0
22
-
is released.
23
-
24
-
We also recommend testing the migration in a completely new notebook, rather
25
-
than one that contains widgets that you instantiated with ipywidgets 7.x.
26
-
27
-
For a summarized list of relevant changes, please consult the "Developers" section of the
28
-
[changelog](./changelog).
29
-
30
-
You may consider updating your widget by generating a new widget from the cookiecutter at https://github.com/jupyter-widgets/widget-cookiecutter and adapting the changes to your widget. The widget cookiecutter has been updated to use best practices in Python packaging and Jupyter Widget infrastructure.
31
-
32
29
### Updating setup.py
33
30
34
31
Start by updating the dependency in your `setup.py` or `setup.cfg` to support 8.x.
@@ -70,15 +67,15 @@ The ``ManagerBase`` class has been split into an interface type `IWidgetManager`
70
67
+ "@jupyter-widgets/base-manager": "^1",
71
68
```
72
69
73
-
### Updating the AMD module logic
70
+
### Updating the webpack `publicPath` configuration
74
71
75
-
We highly encourage you to update your widget's logic around generating AMD modules for the CDN with changes similar to those at https://github.com/jupyter-widgets/widget-cookiecutter/pull/103/files. These changes allow your AMD module to be hosted anywhere, rather than hardcoding the `unpkg.com` CDN, and they remove the differences between the AMD module generated for the notebook extension and the AMD module generated for the CDN.
72
+
We highly encourage you to update your widget's webpack configuration for `publicPath`, which is used in generating AMD modules, with changes similar to [these changes](https://github.com/jupyter-widgets/widget-cookiecutter/pull/103/files). These changes allow your AMD module to be hosted anywhere, rather than hardcoding the a particular CDN like `unpkg.com`, and they simplify things by removing the differences between the AMD module generated for the notebook extension and the AMD module generated for the CDN.
76
73
77
-
### Updating the client-side code
74
+
### Updating the browser code
78
75
79
76
#### Phosphor -> Lumino
80
77
81
-
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
78
+
The Phosphor library has been archived. It has been forked and renamed [Lumino](https://github.com/jupyterlab/lumino), and the maintenance is now done under the JupyterLab governance.
82
79
83
80
If you used to import classes like ``JupyterPhosphorPanelWidget`` and ``JupyterPhosphorWidget`` from the ``@jupyter-widgets/base`` library, you will need to update them:
84
81
@@ -172,7 +169,7 @@ The version of [Backbone.js](https://backbonejs.org/) that ipywidgets depends on
172
169
173
170
#### Custom tag names
174
171
175
-
If you were changing the base HTML tag for your widget by defining the `tagName` property, this can now be done in ipywidgets 8 in the `preinitialize` method (see https://github.com/jupyter-widgets/ipywidgets/commit/a342e0dbc7c779bb668e5a21c097d7cec9a6ac44 for example changes in core widgets):
172
+
If you were changing the base HTML tag for your widget by defining the `tagName` property, this can now be done in ipywidgets 8 in the `preinitialize` method (see [here](https://github.com/jupyter-widgets/ipywidgets/commit/a342e0dbc7c779bb668e5a21c097d7cec9a6ac44) for example changes in core widgets):
0 commit comments