Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with the latest version of ipywidgets #168

Open
axil opened this issue Sep 7, 2022 · 5 comments · Fixed by #169
Open

Does not work with the latest version of ipywidgets #168

axil opened this issue Sep 7, 2022 · 5 comments · Fixed by #169

Comments

@axil
Copy link
Contributor

axil commented Sep 7, 2022

jupyter_bokeh does not work with ipywidgets >=8.0.0a0 Latest compatible version of ipywidgets is 7.7.2.

@axil
Copy link
Contributor Author

axil commented Sep 7, 2022

Here's the relevant migration guide: https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/migration_guides.md

Supposedly all that needs to be done is to update package.json accordingly.

@axil
Copy link
Contributor Author

axil commented Sep 8, 2022

Tried to create a reproducible example in a Docker container. Couldn't (although it did appear in two machines, Linux and Windows). Closing as false alarm for the time being.

@axil axil closed this as completed Sep 8, 2022
@axil
Copy link
Contributor Author

axil commented Sep 13, 2022

Another bunch of tests revealed that the issue is not reproducible on Linux. It only affects Windows.

@axil axil reopened this Sep 13, 2022
@axil
Copy link
Contributor Author

axil commented Sep 14, 2022

I've found it out why it works on Linux: it is because it uses the global version of the notebook extension and not from the virtualenv. So it is basically the same on Windows and Linux.

Got it working with latest ipywidgets (8.0.2) by manually patching the index.js file (searched and replaced all instances of pWidget to luminoWidget and PhosphorWidget to LuminoWidget).

My suggestion is that updating package.json as described in the link above should suffice:

- "@jupyter-widgets/base": "^2 || ^3 || ^4",
+ "@jupyter-widgets/base": "^6",

Validating it I've run into the following problem:

> @bokeh/[email protected] build:lib /home/axil/upyter_bokeh
> tsc

src/plugin.ts:61:14 - error TS2322: Type 'Token<IJupyterWidgetRegistry>' is not assignable to type 'Token<any>'.
  Types have separate declarations of a private property '_tokenStructuralPropertyT'.

61   requires: [IJupyterWidgetRegistry],
                ~~~~~~~~~~~~~~~~~~~~~~

@axil
Copy link
Contributor Author

axil commented Sep 15, 2022

@mattpap I've included the change proposed above into packages.json, built the project, tested against latest ipywigets 8.0.2 (works fine) and generated the package-lock and yarn.lock files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant