On Mon, 7 Feb 2011 15:03:55 -0500, Aryeh Gregor wrote:
On Mon, Feb 7, 2011 at 12:33 PM, Adam van den Hoven
<a...@littlefyr.com> wrote:
...

Further, in CommonJS, the library has to export an object in order to make it available. If we could define things in such a way that the browser compiled the library independent of the page that loads it, the browser could cache the *compiled* code and provide that to the browser page. It would also be necessary to either enforce that these cached libraries be immutable or that a copy of the compiled code be made available. I couldn't implement this so I'm not sure how feasible this is but I suspect that
requiring immutability would be the easier to implement.

What problem does this solve?  How is it better than inserting a
<script> element, when the returned resource has suitable caching
headers?

I think Adam's opinion is a bit influenced by CommonJS. Although I like the require() thingy, I think this feature would be much more appreciated for author app objects and extensions (similar to RequireJS) than HTML specific things like crypto et al.

Reply via email to