Annotations required? #160
-
Is it possible convert a third-party library from source without the JsInterop annotations? I noticed that Guava already has the annotations included in its source and it's mentioned in the docs that it can be used with J2CL. What about other libraries ... like Log4J for instance? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
JsInterop annotations are only needed to expose APIs and abstractions to JavaScript code. The other limitation to bringing third party libraries is that J2CL implements a subset of the Java standard library (JRE) so code that refers to unsupported APIs (e.g Threading) would not compile. |
Beta Was this translation helpful? Give feedback.
-
i.e. you only need annotation if you want to call the Java API from JavaScript. Adding these annotations puts new restrictions on the source and it is better to provide them inside the source. What you can do is, you can see create your own helpers to expose these APIs to JavaScript. |
Beta Was this translation helpful? Give feedback.
i.e. you only need annotation if you want to call the Java API from JavaScript. Adding these annotations puts new restrictions on the source and it is better to provide them inside the source. What you can do is, you can see create your own helpers to expose these APIs to JavaScript.
(All of these assume the library is only using apis emulated in J2CL)