-
Type of parameter 'predicate' in 'RowResult[] DataTable.Select(Predicate predicate)' is not usable by but exposed to JavaScript. public RowResult[] Select(Predicate predicate){ |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
That seems correct, the class I assume the the class Difficult to tell with certainty since it is an incomplete snippet. |
Beta Was this translation helpful? Give feedback.
-
Closing the issue as WAI. |
Beta Was this translation helpful? Give feedback.
-
thanks!
}。 |
Beta Was this translation helpful? Give feedback.
-
IMHO, migrating classes to JS but keeping the same design is unlikely to result in much reduction in the code size. If you want to reduce the codesize you should first use a more aggressive compilation level ("ADVANCED") and if that proves to be insufficient it is probably best to look in the application design for inefficiencies. Those are my 2 cents. |
Beta Was this translation helpful? Give feedback.
-
Understanding why the size matters might help to answer too - 90M of JS is "big", but esp when it hasn't been optimized at all, it is far from unheard of. If the size matters for an individual bundled file (before optimizing), more smaller libraries might make more sense, to split one big 90M file into many files that sum up to roughly 90M - at least in theory not all use cases need the entire library, so only referencing the smaller pieces will improve total loaded size for a given application (plus, j2cl seems to perform better compiling two smaller modules than one big one, all else equal). Another tool theoretically at your disposal that should improve SIMPLE_OPTIMIZATIONS or WHITESPACE_ONLY is the j2cl minifier, so as to minifiy more than just locals also exposed calls on namespaces/classes (and gets rid of comments while it is running). Note however that bazel doesn't have support for using this, and to my knowledge there is no documentation on using this even outside of bazel. j2cl/tools/java/com/google/j2cl/tools/minifier/J2clMinifier.java Lines 41 to 59 in f683c82 Conversely, I believe the RTA tool is intended to be usable in bazel (though only tests use it, and they can't be run in open source) and has no non-bazel way to run it. The minifier can use rta output as I understand it, to simply identify "java" members and types that can be pruned, so that the minifier strips out code that presently can't be called. This should in effect perform the same sorts of "just remove code that cannot be called" as something like SIMPLE_OPTIMIZATIONS, but you might find it does it faster and with more awareness of what can be changed than closure-compiler itself? Again: giant caveat that to my knowledge there are currently no examples of how to use these in open source. |
Beta Was this translation helpful? Give feedback.
thanks!
This is my code:
@jstype(isNative = true,namespace = JsPackage.GLOBAL)
public class DataTable {
}。
I am trying to rewrite the DataTable class in js as an overridden java class. So the above problem occurred when I was packing. (When I typed the complete java code, I found that the size of the package was too large, almost 90M, so I rewrote some java classes in js to reduce the size of the package). If the current issue does not work out well, is there any way to reduce the package size (currently my configured compilationLevel: SIMPLE_OPTIMIZATIONS).
thanks~