Thanks a lot Lofi for mentioning https://github.com/pepstock-org/Charba .
Let me outline that the injection of javascript code could also be done putting the script element into html page of the application.
In my opinion it depends on the goal of GoJS wrapping, if the goal is to create a lib (like Charba is for CHARTJS) then the injection should be done by GWT, otherwise if the use case is "I need to use GoJS for my application", then maybe the ScriptInjector is not needed. In last case you must have the full application control in order to avoid exceptions due to a misalignment between JSINTEROP mapping and the version of javascript library.
In Charba we are not using the ScriptInjector because is more a J2CL lib (without any dependency with GWT) than a GWT one, and we are creating and adding a script element injecting the javascript code.
Instead, if the platform is only GWT, it could be also helpful to go to ClientBundle to inject the javascript code, in order to leverage on code splitting if needed.
A lesson learned developing Charba is also that sometimes is quite difficult (I don't want to say impossible) to map all javascript code, for many reasons. Therefore some javascript code could be needed, wrapped by a custom JsType native.
Il giorno mercoledì 16 settembre 2020 alle 09:57:04 UTC+2 lofid...@gmail.com ha scritto:
... BTW I think it is important that you inject the GoJS with http://www.gwtproject.org/javadoc/latest/com/google/gwt/core/client/ScriptInjector.htmlso that it is available when you run your app...Or you just take a look at Charba which intergrate ChartJS for GWT and J2CL: https://github.com/pepstock-org/CharbaHope this helps.lofid...@gmail.com schrieb am Mittwoch, 16. September 2020 um 09:37:17 UTC+2:You could take a look at this video, very nice intro how to integrate JavaScript lib with the help of JsInterop:Hope this helps,Lofitonio....@gmail.com schrieb am Dienstag, 15. September 2020 um 22:18:35 UTC+2:Hi all,I am looking for a way to add the html page containing my GoJs functions in a Panel widget how can i do this?Examples?Thanks a lotThanks for the comment!Before you create manually the JsInterop files from GoJS, you should take a look the two JsInterop Generators available which I've shown in my new article"Using IndexedDB in Web Browser — All in Java with Mrs. Gwitany and Dr. Jackl"Thanks,Lofi--tonio....@gmail.com schrieb am Sonntag, 13. September 2020 um 10:28:54 UTC+2:Thanks for this article, I come from Java and C++ world and I am using GWT for first time. I need to use GoJS in my architecture and I think that your post will help me. Very good explanation.AntonioHi All,
I wrote a short introduction for JsInterop "native" with a simple Calculator and CalculatorService: https://bit.ly/WebBrowserGWTJsInteropNative
Enjoy 😊
Lofi
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/89b888b5-0f6d-4c5f-8bfe-f5a9a4471f94n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/99f37d45-6175-41e3-bc96-abe7d02b1fe4n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/f0cbe447-a4f9-4158-8a8e-6d9e92a64ee4n%40googlegroups.com.
No comments:
Post a Comment