-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compile unused classes or methods #65
Comments
Why you want compile unused classes? This is not possible yet. |
I need to export some classes and methods for other modules to use, any suggestions? |
I am unclear what you want. You can't use it from other modules. It would only hidden, dead code. If you want export some methods then you must annotate with the annotation @export. All methods with this annotation will also be compiled. |
What I am doing now is compiling the source code of an existing jar package. Due to the large size of the code, I cannot annotate it with @export one by one. The reason for compiling the jar package is to use the jar package as a module of wasm to reduce the size of the java application code.Looking forward to your reply. |
If you want use it as module then you must declare the interface that you want use. How do you want use the module without any usable methods? |
I just want to convert a jar package source code to wasm, any suggestions? Even though I use the export annotation to export the methods I need one by one, the exported methods must also be static methods, so I have to change a lot of non-static methods to static methods, which is not feasible. |
Add an extra class in which you define the interface methods that you want use from JavaScript. This methods call your library methods. But if you have not write the library for the WASM target then there are only a low chance that it will compile. Many API like the file, network, reflection API can't compile to WASM. |
How do I configure that I can force unused classes or methods to compile and generate wasm files?
The text was updated successfully, but these errors were encountered: