NPM / Libraries #1508
Replies: 1 comment 1 reply
-
Very interesting idea, @aersam! We should definitely improve the dependency management (again). And the growing number of third-party libraries concerns me as well. We already thought a similar direction and ended up with concerns about the following scenario: Imagine you develop a robot software and want to deploy to a new machine. You install NiceGUI, maybe in a Docker container, and maybe even start the app and check if it is running. The dependencies are loaded and cached. Then you move the robot into the field where there might be no internet access. Now someone wants to access some performance plot on a separate analysis page, but Plotly isn't available because it has never been cached. So we might need to give the user control over when to load which dependencies. Meanwhile NiceGUI shouldn't get more complicated for unexperienced users that like its simplicity. But I'm sure, we can find an API that is both, nice and powerful. |
Beta Was this translation helpful? Give feedback.
-
Hi Guys
NiceGui handles dependencies on external scripts in a very simple way which is not only bad, but has a number of drawbacks. NiceGui currently ships the js files of external dependencies as part of the pypi package. Meaning each included component will increase the package size more and more. In addition, fixes of included JavaScript Libraries will need to be pushed by an update of NiceGui which is not so great, especially for security fixes. So I think one should think about better ways even if they introduce complexity.
Also bundling and minification are lacking which would optimize production load time
So, I thought I just write down a little proposal to start a discussion about it :)
Preconditions:
Proposal
In a python component, one would declare the dependency something like this:
In JavaScript:
To map 'ag-grid-community' to the correct esm js file without a bundler, one can use metadata from package.json ("module" field) and import maps
Beta Was this translation helpful? Give feedback.
All reactions