Hi, everyone. In my jupyterlab application I am using 10 different extensions which all are build separately. And since they are built separately, there is no dependency resolving of repetitions. But I want to know if jupyter lab build
command at the end bundles all seperately buiilt extensions into one and resolve dependencies? Or I will have huge bundle size in my application that is sent to user. Please clarify me on what I should do. Thanks
The specifics are defined by the nodejs/JS import
semantics.
Anything that uses import {foo} from "bar"
in core or an extension will likely go in the main chunk.
Anything that uses await import('baz')
in core or an extension will yield a new runtime chunk which won’t be downloaded until actually required to draw pixels. An example in core is xtermjs
or mermaidjs
: these are quite large, and not needed for every page view.
Both approaches already use SemVer compatibility to avoid runtime downloading of duplicate libraries.
On the main, though: the gains from doing the extra work of jupyter lab build
vs using prebuilt extensions from pip
or conda
to get to some “theoretically most optimum bundle” are fairly minimal, and introduce many ways for your custom application to fail in exciting ways.
This is an expensive webpack build, and once just a few “bad actor” extensions (historically, some big, opinionated Jupyter Widget libraries like plotly
) show up, one can be dealing with hundreds of megabytes of node_modules
, and “too many open files” failures on some build systems (e.g. Windows, small docker containers).
Core and extension developers may not be excited about debugging these kind of issues for free.