jupyter-widgets-contrib / ipycanvas

Interactive Canvas in Jupyter
https://ipycanvas.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
688 stars 64 forks source link

ipycanvas does not work with JupyterLab 4 #311

Closed martinRenou closed 1 year ago

martinRenou commented 1 year ago

cc. @davidbrochart who spotted this

ipycanvas works by sending binary buffers through custom comm messages.

It looks like there is a difference in behavior between JupyterLab 3 and JupyterLab 4:

This happens in this.on('msg:custom', (command: any, buffers: any) => {} where buffers is either a DataView[] in Lab 3 or a ArrayBuffer[] in Lab 4.

This might be an issue/change in JupyterLab 4 actually? cc. @jtpio @fcollonval

If it's a wanted change, we should update ipycanvas to support JLab 4

Note: This was all tested using @jupyter-widgets/jupyterlab-manager v5.0.5 and ipycanvas v0.13.1 labextensions

martinRenou commented 1 year ago

It looks like starting JupyterLab's master branch with jupyter lab --dev-mode --extensions-in-dev-mode --ZMQChannelsWebsocketConnection.kernel_ws_protocol='' fixes ipycanvas.

jtpio commented 1 year ago

It looks like starting JupyterLab's master branch with jupyter lab --dev-mode --extensions-in-dev-mode --ZMQChannelsWebsocketConnection.kernel_ws_protocol='' fixes ipycanvas.

This is probably also reproducible with 4.0.0a32 then (could be more convenient for testing than building lab from source).

And likely a change from https://github.com/jupyterlab/jupyterlab/pull/11841 at first glance.

davidbrochart commented 1 year ago

Fixed in https://github.com/jupyterlab/jupyterlab/pull/13730.

martinRenou commented 1 year ago

Thanks a lot!