talsec / Free-RASP-ReactNative

React Native plugin for improving app security and threat monitoring on Android and iOS mobile devices.

Home Page:https://github.com/talsec/Free-RASP-Community

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Package Size is concerning.

asharamseervi opened this issue · comments

Is your feature request related to a problem? Please describe.

I have a limited understanding of packages, but I believe package size matters. While drafting this Unpacked Size is 11.8 MB while going through https://www.npmjs.com/package/freerasp-react-native?activeTab=code, I got to know, ios directory itself is about 11.2 MB while I plan to protect Android app.

Describe the solution you'd like
As per my limited understanding, for a npm package lib and other root files like package, readme, licence, src required until and unless some native android or ios specific functions is desired. Most of the package is already covered in the lib directory, which is required to be extended by app developers.

Removing and adding example, android and ios in .npmignore will remove these directories for npm directory and significantly improve the app size.

Additional context
Please correct me if I am wrong. For a package or app, every KB matters.

Hi @asharamseervi,

Thanks for opening the issue.

freeRASP for React Native is a wrapper around native iOS and Android implementations. Therefore, the content of android and ios folders is necessary for the plugin to work.

example folder is not required in npmjs installation and could be removed, we'll think about adding this to our backlog.

However, removing these folders won't have any effect on the final size of your APK/AAB. Shortly, this is because when you are building your Android app, just the common .js/.ts files and native Android files (in android folder) are compiled. The rest is thrown away.

So if you are using just the Android implementation, you can delete the ios folder from the plugin in node_modules. This will hovewer affect only size on your drive, not the final build, because of the reasons mentioned above.

Cheers,
Tomas

Moving the thread to Discussions. Feel free to continue discussion there, or create another issue if relevant.