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

Reduce size of installed packages, initial load impact #63

Open
bollwyvl opened this issue Jul 29, 2021 · 2 comments
Open

Reduce size of installed packages, initial load impact #63

bollwyvl opened this issue Jul 29, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@bollwyvl
Copy link

Elevator Pitch

Reduce the size of required installed packages.

Motivation

While downloading the artifacts at install time is easily cached, etc. the files are still very large, and probably are still not fully optimized for initial page load (despite laziness)

Design Ideas

  • use the existing lab MATHJAX_URL, either by using whatever's there, or adding a hard dependency on jupyter_server_mathjax and don't ship another mathjax
  • split out the labextensions as a (set of multiple) separate installable package(s)
  • split out the kernel-side ipywidgets as a package
    • particularly in JupyterLite (where the widgets haven't really been tested) the hit for downloading and installing the (useless) labextensions into the WASM runtime is going to be very real
  • split out the full templates (and customized load) as a separate package
    • these are the worst offenders, with individual XML files that are a couple megabytes
    • keeping the full shapes available on drawio around is probably important, as missing shapes look... bad
  • see if there's any way to make the whl not include two copies of the files
@bollwyvl bollwyvl added the enhancement New feature or request label Jul 29, 2021
@bollwyvl
Copy link
Author

Actually, the complexity of splitting any of the frontend assets out looks pretty high, as we don't get a handle on the window in time to fix the URLs, which wouldn't be known ahead of time. So probably the only win here will be splitting out the kernel-only pieces for lite, etc.

@bollwyvl
Copy link
Author

#88 demonstrates that ipydrawio widgets now works inside the jupyterlite pyolite kernel. Unfortunately, to get to the tiny bit of code it needs, it has to download the entire wheel, which is pretty much not acceptable.

As we still want (pip|mamba) install ipydrawio to bring in everything, the sane thing to do is probably split out a few more packages.

py_packages/
  ipydrawio/ # metapackage
  ipydrawio-common/  # constants, etc.
  ipydrawio-labextensions/  # the assets
  ipydrawio-widgets/  # kernel assets
  ipydrawio-export/  # as before

Of note, it probably makes sense to keep the __js__ behavior for ipydrawio-common, but only shipping the package.json, and without any data_files tomfoolery.

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

No branches or pull requests

1 participant