Closed Jackiexiao closed 1 year ago
Hi @Jackiexiao, thanks for the reminder! I removed unused npm packages, reducing the repo size by around 70 Mb. Do you have any additional suggestions on how to decrease the storage footprint of the component?
sorry, I'm not familiar with js/ts, but it seems node_modules is still very large
(base) ➜ node_modules git:(main) du -ah -d 1 | grep M
4.3M ./@typescript-eslint
1.5M ./react-dev-utils
2.3M ./es5-ext
5.0M ./webpack
1.8M ./node-forge
5.5M ./eslint
2.3M ./css-tree
2.1M ./regenerate-unicode-properties
1.2M ./csstype
8.2M ./apache-arrow
12M ./@babel
12M ./.cache
18M ./rxjs
3.6M ./csso
1.6M ./node-notifier
2.7M ./terser
1.4M ./eslint-plugin-import
3.1M ./expect
5.0M ./lodash
4.9M ./es-abstract
1.1M ./esquery
1.2M ./acorn
1.4M ./terser-webpack-plugin
1.6M ./clean-css
1.5M ./@webassemblyjs
3.0M ./react-dom
3.8M ./@jest
5.1M ./jest-environment-jsdom-fourteen
2.4M ./resolve-url-loader
51M ./typescript
1.7M ./eslint-plugin-react
5.1M ./jsdom
13M ./core-js-pure
1.2M ./eslint-plugin-jsx-a11y
1.2M ./sockjs-client
1.2M ./ajv
1.1M ./jest-haste-map
1.9M ./@types
8.8M ./babel-runtime
1.3M ./acorn-globals
2.6M ./webpack-dev-server
1.1M ./jest-util
1.5M ./postcss
3.3M ./caniuse-lite
13M ./core-js
329M .
I would recommend to either not include the node_modules in the repo or make a second repository containing only the build frontend for use as a component. Because as an end user of the component, most of the repository is bloat at this point. It might be useful to include this in your documentation aswell, since any user of the component can safely delete anything outside the build folder itself.
As a contributer on the other hand, the node_modules folder is only really necessary if:
You shouldn't really need to include the node_modules folder if:
As a contributer you will need to install npm anyways, so the package.json should be sufficient.
@Pol-Zeimet @Jackiexiao Hi everyone, thanks a lot for your advice!
I have good news 🎉, the repo size has been reduced from 393Mb down to 70Mb by removing all these node-modules, which are not required to use the streamlit component. Just in case, I have decided to keep the node modules on a local dev branch for future development.(sry that this took so long, I was busy studying for CS exams)
it would be great to decrease repo size
du -ah -d 1