Module naming and declarations

Brendan Eich brendan at mozilla.com
Mon May 6 19:10:00 PDT 2013


Anne van Kesteren wrote:
> On Mon, May 6, 2013 at 4:39 PM, Jason Orendorff
> <jason.orendorff at gmail.com>  wrote:
>> And this "weird" behavior is hardly without precedent: aren't *all*
>> other URLs a script deals with, including the existing APIs for
>> loading other scripts (adding a<script>  tag or loading the code with
>> an XHR), resolved relative to the document base URL?
>
> Typically the entry script's base URL, which can be different in
> cross-document scenarios. And for XMLHttpRequest it's the document
> associated with its constructor object (which annoyingly is somewhat
> different from the rest).

Noted!

>> Good point. It can do what XHR does in workers: use the script's base
>> url. (If the site happens to have a single directory for serving
>> static js, and the worker script happens to be in it, that's
>> especially convenient.)
>
> So now you have two conventions...

If the newer one is better, that's progress. Building on a broken 
("annoyingly") convention to keep some unity-of-conventions ideal at the 
expense of usability is not the obvious winner.

With the Web, you never can hope to have "one way to do it". The goal is 
"better over time".

/be


More information about the es-discuss mailing list