Avoiding the larger issue of meta tags applying globally, I'd think for this case there should be a more direct way to do it. What I mean is, you have to load the *.cache.html files from *somewhere*. So (from the inlined selection script), you have to do something roughly equivalent to:iframe.src = baseUrl + strongHash + ".cache.html"It seems like... whatever process is used to inline the selection script in the first place, has to be able to specify the base URL, at least relative to the host page base url. Am I understanding this right?
The meta property system looks like a good, clean solution. All we need to do is decide on a convention for having them be module-specific. I don't know the history of this feature or what all it is intended to support, but it looks awfully straightforward to allow prepending moduleName:: before the property name.
On Tue, Mar 2, 2010 at 2:54 PM, Lex Spoon <sp...@google.com> wrote:The meta property system looks like a good, clean solution. All we need to do is decide on a convention for having them be module-specific. I don't know the history of this feature or what all it is intended to support, but it looks awfully straightforward to allow prepending moduleName:: before the property name.So, in IFrameTemplate.js for example, the changes would be:
- processMetas() keeps track of which properties it has seen and keeps the most-specific one of each, and ignores any property with :: that doesn't have __MODULE_NAME__ as a prefix
- how would the base URL lookup change? I don't see that it looks for a meta property anyway, instead using a <base> tag -- are you suggesting adding a check for a meta property instead of / in addition to the <base> tag check?
What would most specific be? I was thinking the last meta tag with any given name would be the one that counts. That's what the existing meta-processing code does.
Looking at that code, I just realized that my example was wrong. It would actually be like this:<metaname="gwt.property"value="com.google.gwt.sample.mail.Mail::baseUrl=http://static-content.service.com/mail">
So, the following would mean the per-module instance is never used, right?<meta name="gwt:property" value="org.example.Foo::bar=..."/><meta name="gwt:property" value="bar=..."/>I suppose that could work, but it makes more sense to me to say that the module-specific one is used in that module regardless of the ordering.
Looking at that code, I just realized that my example was wrong. It would actually be like this:<metaname="gwt.property"value="com.google.gwt.sample.mail.Mail::baseUrl=http://static-content.service.com/mail">Ok, so only the value of gwt.property values would be scoped, no other GWT metas? For example, you would not be able to have separate onLoadErrorFn's per module?
Meh. I've always thought our selections scripts were too big and complicated as is. I'd rather we could figure out a way to get rid of meta properties altogether. :(
It seems like to me, if you have any kind of process for inlining a selection script into a host page, that that process *ought* to be able to update the module base URL correctly. I mean... if you have to generate the correct meta tag to do the exact same thing, while not just modify the selection script being inlined? It seems to me that would avoid extra load-time overhead and complication, and we wouldn't have to extend meta props to work on a per-module basis. Am I crazy?
Straw man.... let's say when you inject a GWT selection script, you can add a single line at the very top:var moduleBaseURL = "w00t/"Then at the top of computeScriptBase(), we just look to see if moduleBaseURL is already defined, and if so we return that.
On Thu, Mar 4, 2010 at 5:16 PM, Scott Blum <sco...@google.com> wrote:Straw man.... let's say when you inject a GWT selection script, you can add a single line at the very top:var moduleBaseURL = "w00t/"Then at the top of computeScriptBase(), we just look to see if moduleBaseURL is already defined, and if so we return that.1. That doesn't solve the problem. The problem is that different modules need different base URLs.
2. How is this better than using a meta property? It looks identical except that it inserts a var rather than a <meta> tag.