Optimization of included JS files #1259
Replies: 2 comments 13 replies
-
Very interesting observation, @firai! Honestly, I didn't check which files are provided for every single dependency. Sure, in case we have both versions and use only one, we could remove the other one. But we also wanted to provide source maps for easier debugging. As far as I know, you need the non-minified file for source maps to work. So we ultimately need to provide *.js, *.min.js and *.js.map, growing the package size even more. Or is *.min.js and *.js.map enough? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your response, @falkoschindler! Bard and Bing seem to tell me that you could still get somewhat readable debugging information without the full package, but I don't really debug JS/TS. @dclause, do you know the answer to @falkoschindler's question? It seems like Mermaid stopped building source maps into the npm/CDN package since 10.2 though. Looking at Mermaid as an example (since that's the biggest package), it seems to me that
If we need the full packages for debugging and if we have switched to ESM, maybe we can at least get rid of the UMD packages? Ideal scenario would be getting down to just one version. EDIT: Just thinking out loud, could we somehow point to the CDNs for the full versions for debugging? Might be unlikely that debugging is being done on a machine with no network access? And if that's desired by the user, maybe we can tell the user (or provide a script) to download the full versions as needed, instead of distributing them to everyone? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that the size of the NiceGui package, not including dependencies, increased from 13 MB to 49 MB between 1.2.x to 1.3.x. I understand that this is due to #658, which copied in the full JS packages rather than the minified versions. Upon further inspection, the copied packages (at least for mermaid, plotly and aggrid) appear to also contain the minified versions. If the full packages files are being used now, can/should the minified files be removed to eliminate duplication?
My JS knowledge is definitely rudimentary, so I apologize if what I'm suggesting above doesn't make sense given how the packages are set up.
Beta Was this translation helpful? Give feedback.
All reactions