Does the current version of j2cl support sourcemaps?
Chrome's DevTool doesn't show HelloWorld.java in sources list. Also I see next log output in terminal when launching dev server through ibazel:
INFO: 750碌s /0:0:0:0:0:0:0:1:38796 404 GET /HelloWorld.js.map
It seems like reference to the sources presents in js, but the web server cannot find requested resource.
Yes, J2CL has sourcemaps support. The web server used in the example is serving correctly the file. We will fix that.
@jDramaix making source map work is not a small project. web_library in rules_closure needs to understand and serve files from zip files first.
Let's leave this to contributors for now. If nobody takes care of it by the time and eventually that part of the problem will go away with the tree artifacts.
As an update; we are actively working switching from zip files to TreeArtifacts so after that this should be easier to address.
Worth pointing out perhaps that closure-compiler's BUNDLE mode presently doesn't handle sourcemaps at all, see https://github.com/google/closure-compiler/issues/3247. In that issue, I link the patch we're using in our closure-compiler fork so that j2cl-maven-plugin can provide sourcemaps in dev mode. This is not a perfect solution, but probably will suffice until BUNDLE gets to be more efficient or is replaced in the maven plugin.
Most helpful comment
@jDramaix making source map work is not a small project. web_library in rules_closure needs to understand and serve files from zip files first.
Let's leave this to contributors for now. If nobody takes care of it by the time and eventually that part of the problem will go away with the tree artifacts.