Generic Bundling

Andrea Giammarchi andrea.giammarchi at gmail.com
Sun Oct 13 13:51:56 PDT 2013


my latest message was about this situation

www/
  my-assets/
    js/
      my-bundle.js
    css/
      some.css
    image/
      some.png

  assets.zip

where latter contains the equivalent of the my-assets folder.

The prefetching link won't do a thing in old browsers, might be a directive
for modern suggesting a package.zip file to use instead of the folder name.

Old browsers will do everything as they do today, new browsers have the
ability to use one single package instead of requiring the file.

As result:

<link rel="package" name="my-assets" type="application/zip" href
="assets.zip">
<script src="my-assets/js/my-bundle.js"></script>

will simply request that file through HTTP in old browsers, it will use the
aliased zip file through my-assets if capable.

It's actually very similar to initial proposal also creating a precedent
for network aliases independent from mod_rewrite and friends (client/UA
only mod_rewrite like approach)

Cheers









On Sun, Oct 13, 2013 at 12:34 PM, Brendan Eich <brendan at mozilla.com> wrote:

> Jorge Chamorro wrote:
>
>> On 11/10/2013, at 03:53, Brendan Eich wrote:
>>
>>> >
>>>
>>>> >>  On Thu, Oct 10, 2013 at 8:10 PM, Andrea Giammarchi<
>>>> andrea.giammarchi@**gmail.com <andrea.giammarchi at gmail.com>  <mailto:
>>>> andrea.giammarchi@**gmail.com <andrea.giammarchi at gmail.com>>>  wrote:
>>>> >>  >>      You are confining the problem in HTTP only scenarios while
>>>> the
>>>> >>      solution provided by
>>>> >>  >>      <script src="lib/main.js" ref=”assets.zip”></script>
>>>> >>
>>>>
>>> >  >  No, you're right -- agree with you and Andrea, this is sweet.
>>>
>>
>> Are main.js and assets.zip two separate files, or is main.js expected to
>> come from into assets.zip?
>>
>
> The latter.
>
>
>    I think the latter would be best because it would guarantee that the
>> assets are there by the time main.js runs, as if they were local files,
>> ready to be require()d synchronously.
>>
>
> How would old browsers cope, though? They would load only lib/main.js (and
> possibly make a request storm, as Russell brought out elsewhere in this
> thread), so (synchronous) require of another member of assets.zip might or
> might not work.
>
> A prefetching <link> element might not suffice in old browsers, I'm pretty
> sure it won't.
>
> If the only way to cope with downrev browsers is to use Traceur, so be it.
> We just need to be sure we're not missing some clever alternative.
>
> /be
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131013/fbf3a314/attachment.html>


More information about the es-discuss mailing list