Skip to content

Commit 2ee91b5

Browse files
committed
Use super to propagate processLumino/PhosphorMessage instead of skipping to the top of the prototype hierarchy immediately, in the migration guide.
The code before would jump straight to the root class, rather than going up the hierarchy.
1 parent 9723830 commit 2ee91b5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/source/migration_guides.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ The ``DOMWidgetView.pWidget`` property has been renamed ``DOMWidgetView.luminoWi
8888
+ this.luminoWidget
8989
```
9090

91-
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:
91+
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 and call the correct super method:
9292

9393
```diff
9494
- processPhosphorMessage(msg: Message): void {
@@ -109,15 +109,15 @@ The ``DOMWidgetView.processPhosphorMessage`` method has been renamed ``DOMWidget
109109
+ }
110110
+
111111
+ processPhosphorMessage(msg: Message): void {
112-
+ this._processLuminoMessage(msg, (DOMWidgetView as any).processPhosphorMessage);
112+
+ this._processLuminoMessage(msg, super.processPhosphorMessage);
113113
+ }
114114
+
115115
+ processLuminoMessage(msg: Message): void {
116-
+ this._processLuminoMessage(msg, (DOMWidgetView as any).processLuminoMessage);
116+
+ this._processLuminoMessage(msg, super.processLuminoMessage);
117117
+ }
118118
```
119119

120-
If you're dropping ipywidgets 7.x support, you can simply rename the `processPhosphorMessage` method into `processLuminoMessage`.
120+
If you're dropping ipywidgets 7.x support, you can simply rename the `processPhosphorMessage` method to `processLuminoMessage`.
121121

122122
#### Widget manager import
123123

0 commit comments

Comments
 (0)