deathbeds / ipydrawio

A standalone embedding of the FOSS drawio / mxgraph package into jupyterlab
https://ipydrawio.rtfd.io
Apache License 2.0
51 stars 4 forks source link

Reduce size of installed packages, initial load impact #63

Open bollwyvl opened 3 years ago

bollwyvl commented 3 years ago

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

bollwyvl commented 3 years ago

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 commented 2 years ago

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.