Multi package paths

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multi package paths

Herby Vojčík
Hello,

Nowadays, I use something like this to load amber:

        loadAmber({
                files: ['Gamma.js', 'Angular.js'],
                packageHome: './',
                ready: function() {
                        // XXX
        }});

I feel the need for a little better modularizing the files loaded -
something is part of the project itself, but some packages are external,
residing on different paths and stored in different repos.

I'd like to be able to use something like:

        loadAmber({
                packageHomes: { local: './', angular: '/vendor/amber-angular/', foo:
'/somewhere/else/' }, // maybe http:// too
                files: { local: ['Gamma.js'], angular: ['Angular.js'], foo: ['Bar.js',
'Baz.js']},
                ready: function() {
                        // XXX
        }});

or I like even this shorter version:

        loadAmber({
                packageHomes: { local: './', angular: '/vendor/amber-angular/', foo:
'/somewhere/else/' }, // maybe http:// too
                files: { './':['Gamma.js'], '/vendor/amber-angular/':['Angular.js'],
'/somewhere/else/':['Bar.js', 'Baz.js'] },
                ready: function() {
                        // XXX
        }});

Would someone object against such a change, has someone better proposal,
or is someone already working on something like this?

Herby

P.S.: The server would probably also need some list of logical to
physical paths, in such situation.
Reply | Threaded
Open this post in threaded view
|

Re: Multi package paths

Herby Vojčík


Herby Vojčík wrote:

> Hello,
>
> Nowadays, I use something like this to load amber:
>
> loadAmber({
> files: ['Gamma.js', 'Angular.js'],
> packageHome: './',
> ready: function() {
> // XXX
> }});
>
> I feel the need for a little better modularizing the files loaded -
> something is part of the project itself, but some packages are external,
> residing on different paths and stored in different repos.
>
> I'd like to be able to use something like:
>
> loadAmber({
> packageHomes: { local: './', angular: '/vendor/amber-angular/', foo:
> '/somewhere/else/' }, // maybe http:// too
> files: { local: ['Gamma.js'], angular: ['Angular.js'], foo: ['Bar.js',
> 'Baz.js']},
> ready: function() {
> // XXX
> }});
>
> or I like even this shorter version:
>
> loadAmber({
> packageHomes: { local: './', angular: '/vendor/amber-angular/', foo:
> '/somewhere/else/' }, // maybe http:// too
errata: previous line should not be present, files: is enough...

> files: { './':['Gamma.js'], '/vendor/amber-angular/':['Angular.js'],
> '/somewhere/else/':['Bar.js', 'Baz.js'] },
> ready: function() {
> // XXX
> }});
>
> Would someone object against such a change, has someone better proposal,
> or is someone already working on something like this?
>
> Herby
>
> P.S.: The server would probably also need some list of logical to
> physical paths, in such situation.