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 3:31 PM, Lex Spoon <sp...@google.com> wrote:

> On Thu, Mar 4, 2010 at 12:47 PM, Scott Blum <sco...@google.com> wrote:
>
>> 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?
>
>
> Can you give more detail on what you are thinking people should do?
>
> The way the selection scripts currently are, such a rewriter would be
> brittle.  What the rewriter would need to do is recognize our
> computeScriptBase() function and replace it with its own logic.  I don't see
> a way to do that that won't easily break the next time we tweak our
> selection script.  So, it seems we'd need to develop a less fragile way to
> do rewrites of selection scripts.  I can imagine several ways to do that,
> but they would all require a substantial, multi-week effort.
>
> To contrast, the running proposal would need ~7 lines of code.  Here's the
> meta tag part:
>
>   name = name.replace("__MODULENAME__::", "");
>   if (name.indexOf("::") >= 0) {
>     continue;
>   }
>
> Here's the base URL change:
>
>   if (base = getMetaProp("baseUrl")) {
>     return;
>   }
>
>
> Lex
>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to