Skip to content

Commit 1c00fdc

Browse files
authored
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
1 parent b430df4 commit 1c00fdc

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

docs/source/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ some custom widget packages built on top of the Jupyter Widgets framework.
109109
examples/Widget Layout.ipynb
110110
examples/Layout Templates.ipynb
111111
examples/Using Interact.ipynb
112-
examples/Widget Custom.ipynb
113112
examples/Widget Low Level.ipynb
114113
examples/Widget Asynchronous.ipynb
115114
embedding.md

docs/source/migration_guides.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ widgets.
77
Migrating from 7.x to 8.0
88
-------------------------
99

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.
18+
1019
For example migrations, see these PRs:
1120

1221
- [ts-cookiecutter](https://github.com/jupyter-widgets/widget-ts-cookiecutter/pull/115)
@@ -17,18 +26,6 @@ For example migrations, see these PRs:
1726
- [sidecar](https://github.com/jupyter-widgets/jupyterlab-sidecar/pull/86)
1827
- [pythreejs](https://github.com/jupyter-widgets/pythreejs/pull/378)
1928

20-
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-
3229
### Updating setup.py
3330

3431
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`
7067
+ "@jupyter-widgets/base-manager": "^1",
7168
```
7269

73-
### Updating the AMD module logic
70+
### Updating the webpack `publicPath` configuration
7471

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.
7673

77-
### Updating the client-side code
74+
### Updating the browser code
7875

7976
#### Phosphor -> Lumino
8077

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.
8279

8380
If you used to import classes like ``JupyterPhosphorPanelWidget`` and ``JupyterPhosphorWidget`` from the ``@jupyter-widgets/base`` library, you will need to update them:
8481

@@ -172,7 +169,7 @@ The version of [Backbone.js](https://backbonejs.org/) that ipywidgets depends on
172169

173170
#### Custom tag names
174171

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):
176173

177174
```diff
178175
- get tagName() {

0 commit comments

Comments
 (0)