Sourcemaps with sso linker

149 views
Skip to first unread message

Dmitry Skavish

unread,
May 11, 2016, 9:42:36 PM5/11/16
to Google Web Toolkit
hi everybody,

I could not figure out how do I build my app and generate sourcemap
url into js file along with all the sources. Anybody can shed some
light here?

That's what I did:

1. I added <set-property name="compiler.useSourceMaps" value="true"/>
to my module and now I have sourcemaps generated.

2. Now if I want to use it I need to manually add the path to the map
to my generated js file, something like that:

//# sourceMappingURL=../WEB-INF/deploy/playerDebug/symbolMaps/AE31C96E973F2818434AA5B24477E385_sourceMap0.json

3. Adding the path gives me the mapping to java classes, but since
there is no sources available it's kind of useless. How do I specify
path to the sources? Is there anyway I can add it to js file?

Is there anyway to automate step 2?

Note that I am just opening the module's html in browser as local
file, not via webserver.

thanks!

--
Dmitry Skavish

Thomas Broyer

unread,
May 12, 2016, 5:09:10 AM5/12/16
to GWT Users


On Thursday, May 12, 2016 at 3:42:36 AM UTC+2, Dmitry Skavish wrote:
hi everybody,

I could not figure out how do I build my app and generate sourcemap
url into js file along with all the sources. Anybody can shed some
light here?

That's what I did:

1. I added <set-property name="compiler.useSourceMaps" value="true"/>
to my module and now I have sourcemaps generated.

2. Now if I want to use it I need to manually add the path to the map
to my generated js file, something like that:

//# sourceMappingURL=../WEB-INF/deploy/playerDebug/symbolMaps/AE31C96E973F2818434AA5B24477E385_sourceMap0.json

3. Adding the path gives me the mapping to java classes, but since
there is no sources available it's kind of useless. How do I specify
path to the sources? Is there anyway I can add it to js file?

Is there anyway to automate step 2?

Yes; the GWT website does that for instance.
You have to add something like the following to your gwt.xml:
<set-configuration-property name="includeSourceMapUrl" 

__HASH__ and __FRAGMENT__ will be replaced with the appropriate values.

You may also want to pass -saveSource to the GWT compiler so it dumps on disk the source files it used (including those produced by GWT generators during the compilation).

 
Note that I am just opening the module's html in browser as local
file, not via webserver.

I'm afraid some things won't work in this setup (I can't tell if it'll change anything to source maps though); try to use a web server (even if only a "python -m SimpleHTTPServer")

Dmitry Skavish

unread,
May 12, 2016, 1:39:30 PM5/12/16
to Google Web Toolkit
Thanks Thomas! Looks like the url is not inserted if I use sso linker.
Is it known issue?
> --
> 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 post to this group, send email to google-we...@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.



--
Dmitry Skavish

cristian607

unread,
Jun 13, 2020, 10:16:14 AM6/13/20
to GWT Users
Hi guys!

I am interested by this as well, and see that indeed it doesn't work w/ sso linker. Is there a way to have the sourcemap url inserted, when using sso linker?
I'm migrating some code to a TS app, and I am keeping some valuable GWT code as a "normal" JS lib, consumable from the TS app.

Thanks in advance!
Cristian
Reply all
Reply to author
Forward
0 new messages