ipyleaflet
ipyleaflet copied to clipboard
Map doesn't show in JupyterLite
When browsing to https://ipyleaflet.readthedocs.io/en/latest:

It works in https://jupyterlite.readthedocs.io/en/latest/_static/lab, but it has ipyleaflet v0.16:

It's probably because the deployed version pulled 0.16 at build time for the frontend extension.
And now calling piplite.install('ipyleaflet') pulls 0.17 from PyPI, but the frontend assets are still the same (0.16).
There are multiple ways of solving this. Either by pinning the version with piplite.install('ipyleaflet==0.17') in the notebook and making sure to update it on new releases.
Or use an approach like in the ipywidgets repo with piplite_urls: https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/jupyter_lite_config.json
Or switch to the jupyterlite-xeus-python kernel and also make sure the version are pinned or at least in sync.
The first solution is implemented in https://github.com/jupyter-widgets/ipyleaflet/pull/1040.
Or use an approach like in the
ipywidgetsrepo withpiplite_urls: https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/jupyter_lite_config.json
One really nice thing about this approach is that it works for master as well, in that it bundles exactly the version of ipyleaflet the repo is currently at, so you can immediately test the current state of master.
Note that in addition to the jupyter_lite_config.json part, you also need to build the dev version of the packages when building docs: https://github.com/jupyter-widgets/ipywidgets/blob/58adde2cfbe2f78a8ec6756d38a7c637f5e599f8/docs/source/conf.py#L151-L171
I would be happy to make this fix with the piplite_urls. I have been having a look but I haven't managed to fully transpose the logics shown for ipywidgets repo to the case of ipyleaflet.