Replies: 1 comment
-
Going to make this a discussion as i think that is a better forum for this. It is not currently possible. This could increase perf, but also makes versioning a bit tricker since we may not be able to upgrade If possible, I would try to lazy-load your module. You can even code-split vendor deps (ag-grid and react) so those get cached. You will pay a first time download hit, but won't after that. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
My widget - Buckaroo depends on react and ag-grid. these are fairly hefty js packages. Anywidget calls sucrase on every widget injection and duplicates js code in the browser DOM. I would prefer to have a slim module.
Marimo includes react and ag-grid.
marimo/frontend/package.json
Lines 86 to 87 in e8f84e4
Do you have any examples of widgets depending on these packages instead of having to pack up their entire js dependency chain for anywidget?
My core library is fairly small (30k of code+ 70k of non marimo shared dependencies), but it baloons to ~400k - 1.2m when everything is bundled depending on how you count. This gets worse with anywidget because it's injected each time a widget is displayed.
Suggested solution
IPYReact fixes this with modules. Anywidget isn't looking to adopt that approach in the near term.
https://github.com/widgetti/ipyreact?tab=readme-ov-file#creating-the-es-module
Alternative
No response
Additional context
There have been issues and discussions with anywidget about this, but I can't currently find them.
Beta Was this translation helpful? Give feedback.
All reactions