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

Fix Bokeh/ Panel version problems #7

Open
MarcSkovMadsen opened this issue Sep 30, 2020 · 7 comments
Open

Fix Bokeh/ Panel version problems #7

MarcSkovMadsen opened this issue Sep 30, 2020 · 7 comments

Comments

@MarcSkovMadsen
Copy link
Contributor

MarcSkovMadsen commented Sep 30, 2020

I'm running Panel 0.9.7 and Bokeh 2.2.1 and panel-components 0.1.1 and it does not work together.

I get a Error rendering Bokeh items: either 'docid' or 'sessionid' was expected... See #5 (comment).

The problem is that the sessionid is something from an old version of Bokeh.

Solution

  • Update local versions and CDN versions of Bokeh and Panel to latest version.
    • Add the version number to the name.
  • State in the README, setup.py and pyproject.toml which versions of Panel and Bokeh are supported.

Alternatively automatically use the version of Bokeh and Panel assets compatible with the installed version of Panel and Bokeh.

Alternative context

Currently the pyproject.toml states

image

which as I understand it is incorrect.

@MarcSkovMadsen
Copy link
Contributor Author

Here are some thoughts on the version issues

  • Either one version of Panel is supported (Latest) or more (including Latest)
    • Bokeh version might change over time for the latest version of Panel because they are not released in tandem.
    • Should it be the package determining which versions to use or the user specifying?
  • Should css and js assets be 1. served from CDN (and github) 2. By Panel or 3. Inlined.
    • Having all options open is flexible but also costly to create and maintain code for.
    • I would pick option 1 except if there are performance draw backs or other issues I'm not aware of.
  • Could it be as simple as package determining the version of Panel and Bokeh and an extended PYVIZ_EXTENSIONS list is maintained in a separate file. Maybe together with the utils to get the correct versions.

Or even better solve the below problem so that custom inclusion of resources is not needed.

# Not relying on panel to include pyviz resources, except while running
# inside Jupyter, because sometimes when panel is serving multiple notebooks
# simultaneously panel will include in a notebook page resources that are
# only needed in pages of other notebooks.

@MarcSkovMadsen
Copy link
Contributor Author

MarcSkovMadsen commented Oct 2, 2020

Another thought for every extension the relevant .js and .css is maintained in the relevant bokeh extensions file in Panel

image

So at least for these we could default to always using CDN and that version.

@MarcSkovMadsen
Copy link
Contributor Author

And for Panel the panel.min.js is in panel\dist\panel.min.js. And as I understand it there will be a CDN from Panel 0.10.0.

The the question for Panel is the panel.css. Where to get that from?

@MarcSkovMadsen
Copy link
Contributor Author

MarcSkovMadsen commented Oct 2, 2020

Maybe the information can be compiled for each version of Panel by just creating a template with all extensions and then extracting the head scripts

image

Maybe it could even be done on demand by Panel and I guess there is no need to serve them as Panel and Bokeh are already being served by Panel and the rest are on a CDN.

@MarcSkovMadsen
Copy link
Contributor Author

I believe the Bokeh resources to be served can be found via the code in https://github.com/bokeh/bokeh/blob/branch-2.3/bokeh/resources.py. No need to hard code them or create advanced functionality for that is my hypothesis.

@MarcSkovMadsen
Copy link
Contributor Author

And I don't know for sure. But I can see that there has been changes in Panel within the last 3 months to make sure the css and js served is unique for each document.

See holoviz/panel#1479

@paulopes
Copy link
Owner

paulopes commented Oct 4, 2020

Definitely the versions of panel and bokeh locally served need to be updated. Thanks to highlighting how out of date they are.

The CDN option is not my priority. My reporting needs to be servable on-premises, even when there is no access to the Internet. Serving the reports locally without internet dependencies was one of the main reasons for me to create panel-component.

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

No branches or pull requests

2 participants