I still haven't looked at JSPM/SystemJS thoroughly, but regarding your
comment, I personally prefer the dependencies get resolved automatically.
For example, we can have www.example.com/app-deps.json where app-deps.json
contains something like this:

{
    dependencies: [
        {
            name: 'backbone',
            src: 'www.example.org/backbone.js',
            dependencies: [
                {
                    name: 'underscore',
                    src: 'www.example.org/underscore.js'
                }
            ]
        }, {
            name: 'jquery-ui',
            src: 'www.example.org/jquery-ui.js',
            dependencies: [
                {
                    name: 'jquery',
                    src: 'www.example.org/jquery.js'
                }
            ]
        }
    ]
};


Then we can use a loader system to load the dependencies:

Loader.load('www.example.com/app-deps.json');

Now this only works efficiently if we have a central repository similar to
Maven, otherwise there will be a request hell for each app/page/site to
download these dependencies. But if they all point to the same
CDN/Repository or use IDs+MD5/SHA1 hashes rather than URLs (e.g.
org.backbone:backbone:1.0), it will help the browser to avoid downloading
the same version of the same library more than once just because one is
fetched from foo.com/backbone-1.0.js and the other one from
bar.com/backbone-2.0.js.



On Sat, Aug 8, 2015 at 1:53 PM Garrett Smith <dhtmlkitc...@gmail.com> wrote:

> On 8/7/15, Behrang Saeedzadeh <behran...@gmail.com> wrote:
> > Hi Sebastien,
> >
>
> Guys —
>
> > On Sun, Aug 2, 2015 at 10:38 PM Sébastien Cevey <
> seb.ce...@guardian.co.uk>
> > wrote:
>
>
> [...]
>
> >> Versions can be specified either at the top-level config, or even at the
> >> import level, e.g.:
> >>
> >> System.import('npm:lodash@3.10.0').then(function(_) {
> >>   console.log(_.max([1, 2, 3, 4]));
> >> });
> >>
> >>
>
> That looks like the client (browser) would need to fetch the
> dependency list and mapping?
>
>
> Declarative chain of responsibility pattern was proposed years ago.
> The idea is different: It works more like ANT <target>s, where
> dependencies are declared right there in the document itself.
>
> The thread got some noise and then it died.
>
> <script src="fabric.js" async id="fabric">
> <script depends="fabric"> alert("loaded!"); </script>
> --
> Garrett
> @xkit
> ChordCycles.wordpress.com
> garretts.github.io
> personx.tumblr.com
>
-- 
Best regards,
Behrang Saeedzadeh
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to