Tuesday, January 28, 2020

Re: Custom Post Linker and Super Dev Mode



On Monday, January 27, 2020 at 10:39:01 PM UTC+1, Geoffrey Wiseman wrote:
On Wednesday, January 15, 2020 at 3:49:34 AM UTC-5, Thomas Broyer wrote:
IIRC, with Super Dev Mode, public artifacts aren't generated in the launcher dir; you need to build your path relative to GWT.getModuleBaseForStaticFiles() rather than GWT.getModuleBase(). HTH

Cautionary preamble: I wasn't involved in the creation of this linker, and I haven't done much with GWT linkers, so it is entirely possible that I'm missing something here. Having said all that:

The linker that I've seen break down in SuperDevMode just calls `emitString` to create some text resources that are then requested later by the browser. Those resources were visible to dev mode in the past, and they're visible in the built GWT application, but in SuperDevMode, they 404. Near as I can tell, the linker isn't using `getModuleBase` or `getModuleBaseForStaticFiles` at all.

Those methods are to be called from the client code, not the linker itself.
 
But with this response I was able to find another thread:

Sounds like you were saying there that it may not be possible to fix this for SuperDevMode? It definitely *does* work in the final built WAR file, it's only SuperDevMode where this seems to break down. So if I create artifacts using `emitString` in a custom linker, there's no way to have these be accessible in SuperDevMode?

If you emitString() with a partialPath of "foo.txt", then it should be accessible in SDM at GWT.getModuleBaseForStaticFiles() + "foo.txt" (but not GWT.getModuleBaseURL() + "foo.txt"). In production mode, it'll be accessible through both, as getModuleBaseForStaticFiles and getModuleBaseURL return the same value then.
 

--
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/9fa84541-4581-4247-88ac-88b1cee60389%40googlegroups.com.

No comments:

Post a Comment