-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Infinite loop when transpiling to Java html5.js from Closure Compiler contribs. #42
Comments
How about using Elemental2 bindings? |
Hello Thomas, where do I get them (preferably in source code)? happy to try that. |
I have produced some draft copies of google maps v3 and ace editor v1.2.3 through jsinterop-generator, by modifying elemental2 a bit, but the same outcome can probably be achieved through another bazel project which references elemental2. The process requires editing the extern files (or jsinterop-generator itself) to handle cases with externs that are valid for closure-compiler but not for jsinterop-generator. Source jars (no .gwt.xml, no bytecode, but you could unpack these and build them, try them out) from the projects I've gotten working so far: Some notes:
I'm running low on free time these days, but will try to get this into a usable shape so that I can put it in a git repo. @stockiNail has been collaborating with me by trying out the jars a bit and finding issues with either the externs or how jsinterop-generator handles them, as time permits we'll see about making some improvements and publishing these. |
|
Thanks, Goktug! I will try those bindings. Didier |
Colin, I'll try your source code and will let you know. Didier |
@didier-durand FYI I'm gonna test ACE because I've already used in GWT (by JSNI). |
@stockiNail : Hi, yes, please, let us know : i tried to generate ace-1.2.3.js But, it's in my failling tests due to its dependency on html5.js which triggers the infinite loop of this ticket. See line 204 of https://github.com/didier-durand/JSClosure2Interop/blob/master/src/test/java/oss/jsinterop/cl2jsi/test/TestConverterFailure.java Best |
@didier-durand yes, I do my best! Let me say that I'm using the sources provided by @niloc132 and the ace builds from https://github.com/ajaxorg/ace-builds/. |
Mine are the closure of ace-1.2.3.js copied from the Closure Compiler project (source all of the js in my trials) |
@didier-durand it is better to depend not on closure-compiler's own externs directly, but on the output of elemental2 running. You need elemental2-core and elemental2-dom. Very roughly:
and fix
to be initialized to an empty object, If I get a chance today I'll start a github project and link it here. |
@niloc132 : thanks. I'll wait for your github project: I am trying your Gmaps source code in the meantime. |
This is NOT directly related to the ticket itself which remains active but some feedback may be of interest for all. @tbroyer @gkdn @niloc132 : I have combined your hints and code kindly provided by @niloc132 to get an initial subset (Map, Marker, InfoWindow, etc.) of Google Maps JSInterop bindings to work properly with GWT 2.8.1 by including Elemental2 & JSInterops modules in GWT. Thanks to all! (Ping me for more details if needed) |
Likewise off-topic: https://github.com/Vertispan/gwt-googlemaps-api now hosts a bazel+maven project, and points at coords to use in maven to use this library - Any other followup on that should move to that repo's issues for discussion. |
Hello,
We are working on providing to the GWT community Java bindings (Java source code) to many standard Javascript libraries: see https://github.com/didier-durand/JSClosure2Interop
This work is based on this JSInterop Generator and Javscript contribs to the Closure Compiler project (replicated wih identical structure in js directory)
So, in the gen directory, you will see that successful transpiling back to Java for various small Javascript is achieved : GeoJson, Async-2.0, es3, etc.
But, our final targets is bigger libraries like Google Maps (prio 1), jQuery, Ace, Angular, etc. For those, the list of dependency is bigger.
For example, you will see that Google Maps requires 27 dependencies (see src/test/java/oss/jsinterop/cl2jsi/test/TestConverterGmaps.java)
As they use many browser features, those large libraries end up (see src/test/java/oss/jsinterop/cl2jsi/test/TestConverterFailure.java) all involving html5.js to solve their dependencies.
html5.js (see /js/google-closure-compiler/externs/browser/html5.js) comes from Google Closure Compiler contribs.
At this point in time, when its isolated transpiling is tried, JSInterop Genarator seems to go into an infinite loop (please, run src/test/java/oss/jsinterop/cl2jsi/test/TestConverterHtml5.java - The jar of Generator is embarked, so it should run).
Same thing with the transpiling of all large libraries requiring it: when we introduce html5.js to complete the needs, the transpiler loops forever. Its Jar was created from master of March, 21st (commit: e68a27e)
The debug mode of the Generator doesn't say anything user about this loop.
Is the error on our side?
Thanks!
Didier
The text was updated successfully, but these errors were encountered: