Tuesday, October 6, 2020

Re: Strange GWT-RPC bug upgrading from 2.7 to 2.8+

If you need a fast solution I would recommend to use professional help like Vertispan: https://www.vertispan.com

Colin knows the transpiler inside out 😉

@Jens: thanks for your debugging tips, I would add your tips to my GWT deck.
pha...@gmail.com schrieb am Sonntag, 4. Oktober 2020 um 05:16:11 UTC+2:
Thanks Jens, I did what you asked and have the following in the debugger:

Screen Shot 2020-10-03 at 8.11.01 PM.png

Screen Shot 2020-10-03 at 8.11.17 PM.png

What do you make of this?

I don't see any duplicate GWT on the classpath (project is a pretty simple maven setup).


On Friday, October 2, 2020 at 4:31:37 AM UTC-7 Jens wrote:
And there you have it... absolutely no idea why it's malfunctioning in this way. Any help is greatly appreciated!

Ok in sourcemaps it looks indeed a bit weird. However there will be additional JS code executed to convert java.lang.Integer into a primitive int which is represented by JS number. That conversion seems to produce undefined.

Please use newest GWT SDK and either launch SuperDevMode or GWT compiler with these additional command line parameters: "-strict -style PRETTY -XmethodNameDisplayMode ABBREVIATED".

When doing so you make sure that no compile issue will be skipped (-strict), your JS code will be more readable (-style PRETTY) and you can more easily search for Java method names in the generated JS code (-XmethodName...). Next you should disable JS Source Maps support in Chrome Dev Tools to see the JS code.
To find the above method you would search the JS for "AbstractSerializationStreamWriter.addString" and should find a JS line that sets a displayName property. Above that line you will find the method implementation.

In the typical case to convert java.lang.Integer to primitive int, GWT should have generated JS that calls the intValue() method of Integer.

If something looks weird you might also want to double check that you do not have multiple versions of GWT in class path. That sometimes happened people when upgrading GWT and also using a bunch of third party libraries. Sometimes 3rd party libraries also emulate JRE classes which then do not match the JRE emulation in GWT SDK. This can be an additional possibility for unexpected JS behavior.

-- J.

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/e6492c9f-e3e1-4933-b1eb-5bbaca5e1866n%40googlegroups.com.

No comments:

Post a Comment