-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Effect on JupyterLab bundle size #1873
Comments
Yikes, we should be using the @jonmmease could we imagine merging these extensions someday? |
Yes, and we almost did for v4. But the distinct plotlywidget package is needed in order for nbviewer to find the extension, and I didn't spend enough time on it to figure out how to combine things in such a way that wouldn't break something 🙂 |
Ah right. Does JLab have a way for extensions share dependencies yet that we know of? |
The packages doesn't need to be merged to resolve this, they just need to import from the same dist. If the dependency versions are compatible, jupyterlab will de-duplicate them. |
Note: even now the dependency package is already de-duplicated, but the code is duplicated in the final bundle since it is imported from two different dists. |
Ah nice. So if we changed https://github.com/plotly/plotly.py/blob/master/packages/javascript/plotlywidget/src/Figure.js#L5 to load the unminified bundle and not from |
Sounds like a plan. Please ping this issue with any progress, and I'll be happy to verify if it works :) |
So I'm trying to tackle this and having some problems... I've uninstalled and reinstalled both extensions from NPM and right now my vendor bundle sits at 11MB which is smaller that I would expect. I'm also having trouble analyzing it to understand what's in it... @vidartf how were you able to determine that Plotly is in there twice? |
Is there a way to |
Some data from Base install - 4.4 MB vendor file
With
|
OK so my PR #2103 seems like the lightest touch solution to this problem, to me... I can get the bundle size to 7.6MB down from 11MB. |
Hi!
I've been looking at the effect of the plotly jupyterlab extensions on the final bundle size, and I've made these observations:
plotly.js/dist/plotly.js
andplotly.js/dist/plotly.min.js
gets included in the final lab bundle (one from plotlywidget and one from jupyterlab-plotly). Both end up taking roughly equal amount of space (6-7 MB) when the lab build is run in prod mode.plotly.js/src
dir gets included (from plotlywidget).Would it be possible to consolidate the imports in the jupyterlab packages such that only one of the dists gets imported from (and if possible also the
src
import)?The text was updated successfully, but these errors were encountered: