Learning from requirejs

Brendan Eich brendan at mozilla.org
Thu Mar 29 16:55:47 PDT 2012


John J Barton wrote:
> And like require.js we will have difficulty resynchronizing the script 
> loading with document loading. For example, the above code may fail if 
> the callback fires before 'myelement' is parsed.

That's a bug on the HTML author's part. The 'myelement' declaring markup 
must have come before that script, or the whole thing should have used 
DOMContentReady (but see 
http://stackoverflow.com/questions/2024018/using-domcontentready-considered-anti-pattern-by-google).

Assuming a bug (failure to order dependent after dependency) to justify 
something -- what, exactly? -- doesn't make a convincing argument for 
anything except fixing the bug.

/be


More information about the es-discuss mailing list