GWT Shared Entry Point with iPhone UIWebView -
i have app works fine @ moment , uses geolocation. have method calls com.google.gwt.geolocation.client.geolocation.
i extended existing entry point , overriden method use native geolocation library don't have permission popups.
how can avoid having 2 modules takes twice long compile?
in gwt have entry-point per application, or perl .html
page, can have other scenarios: have module file (.gwt.xml) multiple entry-points, or page loading multiple modules (.cache.js), or load same module (.cache.js) in different pages.
so, in case, maintain 1 entrypoint , 1 module file , include same compiled module in both pages. in case have write code in entry point know in each page:
public void onmoduleload() { if (window.location.getpath().matches(".*page_1.html.*")) { // } else { // thing } }
think in case have compiled stuff in both pages, take advantage of gwt code-splitting , make each page load stuff needs:
public void onmoduleload() { if (window.location.getpath().matches(".*page_1.html.*")) { gwt.runasync(new runasynccallback() { public void onsuccess() { // } public void onfailure(throwable reason) { } }); } else { gwt.runasync(new runasynccallback() { public void onsuccess() { // thing } public void onfailure(throwable reason) { } }); } }
the advantages of approach compile once site, , share same code in pages taking advantage of cache. there disadvantages final code higher, dev-mode slower, etc.
Comments
Post a Comment