Writing a Primary Linker Guidance
Sorry for bumping, but I have an update.
After spending some time researching this topic, it seems to me that the most appropriate way to accomplish server side script selection is to write a new primary linker. These seem to support a lot of functionality that I don't need (like including the css and js files from the .gwt.xml file), so I don't really need to support that. While our project doesn't use code splitting right now, its a definite possiblity in the future.
I wrote a fairly trivial primary linker that simply emits the compilation result javascript to a .cache.js file (currently only the first element in the js array returned by getJavascript(), will look into adding runAsync support later). I tried including the resulting file directly in a script tag, but that didn't work. I defined the $wnd, $doc, and $stats variables. I appended a call to $wnd.gwtOnLoad, but am not entirely sure how to get the errFn variable, or the soft permutation id for that matter. I'm currently leaving those at null and 0 and that seems to work, but I think this is getting rid of my global exception handler.
For anyone familiar with the linker system, where do I get errFn or softPermutationId for gwtOnLoad?
Also, my readings of javadoc seem to indicate all I have to do to support runAsync is provide __gwtStartLoadingFragment and __gwtInstallCode. Is that really all I have to do?
2nd last question: will this scheme handle ClientBundle, or more accurately ImageBundle?
Last question: could I support dev mode in this configuration? I was thinking if I detect devmode I would link to a seperate js file like the one here. Would that work?
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/uhC5FakaV3oJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home