Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Common configuration draft
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  16 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
James Burke  
View profile  
 More options Jun 30 2012, 12:05 pm
From: James Burke <jrbu...@gmail.com>
Date: Sat, 30 Jun 2012 09:05:00 -0700
Subject: Common configuration draft
There is a draft of the common configuration values now on the AMD
wiki. It is marked as DRAFT:

https://github.com/amdjs/amdjs-api/wiki/Common-Config

Please give a holler if you see problems with it. It is based on this
earlier draft:

https://gist.github.com/1630091

that was already discussed on the list. The changes from that draft:

* The map config is now its own config, not nested under paths or
packages, and it allows for a * config, and use of any module prefix.
* paths allows support for array values instead of strings, if the
loader supports fallback/failover loading.

We can take the DRAFT off if this seems generally acceptable and/or
there are more loaders that confirm they implement them. Right now
requirejs supports  all of them.

Note that they are optional. A loader does not have to provide them or
can only choose to provide a subset. The main point is for us to
standardize on some for basic interop, if the loaders provide similar
functionality.

One that I did not specify, but have found very welcome in the
requirejs community is "shim":

http://requirejs.org/docs/api.html#config-shim

but given that it is for helping legacy, non-AMD modules to
participate in AMD loading, I did not think it was appropriate to put
in the list, unless I hear from other AMD loader implementers that
they would want to support it too.

James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Hockey  
View profile  
 More options Jul 16 2012, 3:49 pm
From: Ben Hockey <neonstalw...@gmail.com>
Date: Mon, 16 Jul 2012 12:49:25 -0700 (PDT)
Local: Mon, Jul 16 2012 3:49 pm
Subject: Re: Common configuration draft

i'm confused...

* The map config is now its own config, not nested under paths or

> packages...

in https://github.com/amdjs/amdjs-api/wiki/Common-Config it has the
following under packages

> *map*: Object. Optional. See [details under the map<https://github.com/amdjs/amdjs-api/wiki/Common-Config#wiki-map>
>  section.

but it seems you're saying this is not how it works now.

it's also still unclear if the spec supports the use case i asked about
at https://groups.google.com/d/msg/amd-implement/_vt4K62no4M/uxbXd4afWXUJ -
the ability to do wholesale mapping per package is critical and is the
primary use case supported by dojo's pacakgeMap.  i would hate to have to
list out every module in every package in order to get them properly
mapped.  i get the impression from the spec that the mapping is only
supposed to happen per module id.  for example with the following map

map: {
  pkgA: {
    // a map of module id prefixes to be remapped for any modules mapped
into the pkgA prefix/package
    foo: "foo1.2"
  }

}

if the pkgA module depends on "foo", i expect it will get "foo1.2".  if
pkgA/moduleX depends on "foo", what should i see?  i *think* that the spec
allows for it to be "foo1.2" but i'm uncertain because it doesn't say so
explicitly and every example i've seen (including requirejs tests)
explicitly map the specific module being used but don't demonstrate what
should happen for modules that share the same prefix.  an example,
if https://github.com/jrburke/requirejs/blob/2.0.4/tests/mapConfig/mapCo...
required "a/sub" and that module had a dependency on "c", will it get "c"
or "c1" or something else?  i hope it gets "c1".

if we agree with how this should work then i'd like to see something in the
spec that more clearly says that all modules that have a prefix that
matches a prefix in the map, the dependencies will be remapped according to
the map config.

thanks,

ben...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rawld Gill  
View profile  
 More options Jul 16 2012, 3:55 pm
From: Rawld Gill <rg...@altoviso.com>
Date: Mon, 16 Jul 2012 19:55:15 +0000
Local: Mon, Jul 16 2012 3:55 pm
Subject: RE: [amd-implement] Re: Common configuration draft

> -----Original Message-----
> From: amd-implement@googlegroups.com [mailto:amd-
> implement@googlegroups.com] On Behalf Of Ben Hockey
> Sent: Monday, July 16, 2012 12:49 PM
> To: amd-implement@googlegroups.com
> Subject: [amd-implement] Re: Common configuration draft

> i'm confused...

>    * The map config is now its own config, not nested under paths or
>    packages...

It is still nested under packages...look just above in the spec. And I think that is where the equivalent of dojo's packageMap takes place and answers the questions below.

Let me know if I'm not understanding your observation.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rawld Gill  
View profile  
 More options Jul 16 2012, 4:06 pm
From: Rawld Gill <rg...@altoviso.com>
Date: Mon, 16 Jul 2012 20:06:50 +0000
Local: Mon, Jul 16 2012 4:06 pm
Subject: RE: [amd-implement] Re: Common configuration draft
I pushed send too fast...

I understand the above map to say the module "pkgA"--and only that single module--will map the dependency "foo" in pkgA's deps vector to "foo1.2".

If pkgA is in fact a package and I want and foo/* dependency within any pkgA module to map to foo1.2, then I'd write the config as follows:

packages:{[
  name:"pkgA",
  location://etc.
  map:{
    "*":{
      foo:"foo1.2"
    }
  }

},{

  name:"foo1.2",
  //etc.

}]

> if we agree with how this should work then i'd like to see something in the spec
> that more clearly says that all modules that have a prefix that matches a prefix in
> the map, the dependencies will be remapped according to the map config.

So, as I understand the spec, map is defined as follows:

map:(module-id or "*") --> (map:(prefix) --> replacement)

--Rawld


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Hockey  
View profile  
 More options Jul 16 2012, 5:22 pm
From: Ben Hockey <neonstalw...@gmail.com>
Date: Mon, 16 Jul 2012 14:22:27 -0700 (PDT)
Local: Mon, Jul 16 2012 5:22 pm
Subject: Re: [amd-implement] Re: Common configuration draft

> It is still nested under packages...look just above in the spec. And I
> think that is where the equivalent of dojo's packageMap takes place and
> answers the questions below.

we need james to clarify his intentions with the changes he made when
translating the spec from the gist to the wiki.  

based on the comments in james' initial post on this thread, my concern is
that the piece about map in the package section of the wiki is a remnant
that he may have intended to remove.  it's hard to say for certain because
i'm trying to piece this together based on comments here, the spec in the
wiki, the spec in the gist and all our previous discussion based on the
content in the gist.

the way that map is described in the wiki, it doesn't really look like
there is an intention for it to be used under the config for a package -
maybe i'm wrong.

the other part that needs clarification too is whether the values to be
remapped represent module ids or prefixes.  eg:
map: {
  pkgA: {
    foo: "foo1.2"
  }

}

if pkgA depends on "foo/bar" should it get "foo1.2/bar"?

i know how i would like all of this to work but i don't want to make
assumptions based on how i'd like it to work.  i don't see these clearly
spelled out in the spec and i can see that it would be easy for different
people to make different interpretations.  hopefully we can avoid some
frustration later by clarifying this now.

ben...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Burke  
View profile  
 More options Jul 16 2012, 8:44 pm
From: James Burke <jrbu...@gmail.com>
Date: Mon, 16 Jul 2012 17:44:57 -0700
Local: Mon, Jul 16 2012 8:44 pm
Subject: Re: Common configuration draft

Away from computer, but two notes:

* I meant to remove map from the package area, bad copy paste. Map is its
own config section.
* map in requirejs is similar to paths: it I applied to to any module ID
prefix match, so it should meet your use case concern.

I apologize for not scrubbing the text better. I will update that draft
with the above, but it may take a day or so.

James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rawld Gill  
View profile  
 More options Jul 16 2012, 9:16 pm
From: Rawld Gill <rg...@altoviso.com>
Date: Tue, 17 Jul 2012 01:16:44 +0000
Local: Mon, Jul 16 2012 9:16 pm
Subject: RE: [amd-implement] Re: Common configuration draft
That works for me. I'll update the dojo impl later tonight. Unless we run into problems, it will make 1.8.

--Rawld


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Burke  
View profile  
 More options Jul 17 2012, 8:37 pm
From: James Burke <jrbu...@gmail.com>
Date: Tue, 17 Jul 2012 17:37:55 -0700
Local: Tues, Jul 17 2012 8:37 pm
Subject: Re: Common configuration draft

On Mon, Jul 16, 2012 at 5:44 PM, James Burke <jrbu...@gmail.com> wrote:
> * I meant to remove map from the package area, bad copy paste. Map is its
> own config section.

It is now removed from the wiki page.

> * map in requirejs is similar to paths: it I applied to to any module ID
> prefix match, so it should meet your use case concern.

The map section has some text about this already, and an example.

Ben, if you think that section could be worded better, I'm open to
ideas. And of course if I completely misread your concern, clue me in.
:)

James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Backhouse  
View profile  
 More options Sep 4 2012, 9:06 am
From: Richard Backhouse <richardabackho...@gmail.com>
Date: Tue, 04 Sep 2012 09:05:58 -0400
Local: Tues, Sep 4 2012 9:05 am
Subject: Re: [amd-implement] Re: Common configuration draft

I'm in the process of implementing the Map Config support and wanted to
double check on something.

The spec states :

" Object. Specifies for a given module ID prefix, what module ID to use
in place of another module ID"

I just want to be sure that we are talking specifically about "module
ID" and not "module ID prefix" for the values in the mapEntry. For example

{
     map:  {
         'some/newmodule':  {
             'foo':  'foo1.2'
         },
         'some/oldmodule':  {
             'foo':  'foo1.0'
         }
     }

}

foo, foo1.2 and foo1.0 are module ID's and not module ID prefixes correct ?

Also, this is directed to James. Are you supporting Map Configs in r.js
? For my optimizer it has become quite involved on how to tackle the
issue of the multiple modules defining themselves with the same id
within the same delivered javascript stream.

Richard

On 7/17/12 8:37 PM, James Burke wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Burke  
View profile  
 More options Sep 4 2012, 9:14 pm
From: James Burke <jrbu...@gmail.com>
Date: Tue, 4 Sep 2012 18:13:59 -0700
Local: Tues, Sep 4 2012 9:13 pm
Subject: Re: [amd-implement] Re: Common configuration draft
On Tue, Sep 4, 2012 at 6:05 AM, Richard Backhouse

Ah, I treat them as module ID prefixes. That makes it more fun doesn't
it? :) I think it makes sense though, particularly for cjs-type
"packages". If someone asks for "foo/helper", seems like that should
translate to "foo1.0/helper" for oldmodule.

I need to work up some tests to include in the amdjs test set for this
common config now that we have a few folks implementing them. I'll try
to get it done next week. In the meantime, here are the tests I use in
requirejs:

https://github.com/jrburke/requirejs/tree/master/tests/mapConfig

The r.js optimizer does builds and places them in the "built" folder
in there as part of its unit tests, if you wonder where they come
from. The r.js map build tests start here and are their names start
with "map":

https://github.com/jrburke/r.js/blob/master/build/tests/builds.js#L998

> Also, this is directed to James. Are you supporting Map Configs in r.js ?
> For my optimizer it has become quite involved on how to tackle the issue of
> the multiple modules defining themselves with the same id within the same
> delivered javascript stream.

I do support them in r.js, at least to the extent that the above tests
pass. If you have a tricky test case though, I am interested to see
it.

James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Backhouse  
View profile  
 More options Sep 8 2012, 8:37 am
From: Richard Backhouse <richardabackho...@gmail.com>
Date: Sat, 08 Sep 2012 08:37:12 -0400
Local: Sat, Sep 8 2012 8:37 am
Subject: Re: [amd-implement] Re: Common configuration draft

On 9/4/12 9:13 PM, James Burke wrote:

Thanks for the clarification.

I think it would be best to modify the text in the spec to avoid
confusion. Perhaps changing the wording to :

"Object. Specifies for a given module ID prefix, what module ID/prefix
to use in place of another module ID/prefix"

What do you think ?

I took a look at the tests you have in requirejs and converted a few of
them over to run in amdjs-tests. I took "mapConfig", "mapConfigStar" and
"mapConfigStarAdapter". The others seemed to be more requirejs specific.

The "mapConfigStar" test has highlighted another gotcha (at least for me
with the approach I have taken).

There is a map configuration of

         '*': {
             'c': 'another/c'
         },

The 'another/c' module has a peer reference to a module called './minor'
so the full mapped id for it would be 'another/minor'. At the moment the
approach I have taken is not modify the ids that are written into the
modules. That is they are in unmapped form. This results in multiple
define calls with the same id. To handle this I add the matched mapping
as an additonal parameter to the define call and that is used to better
qualify the id of the module internally. With this approach I don't have
to mess with the dependent list to modify the mapped id there too. This
works for mapped ids and prefixes but the peer module has caused me
problems. Looking at your built version of the "mapConfigStar" test I
see that your code writes in the mapped ids. I'm curious to know if you
also modify the modules dependency lists too for these mapped ids.

Richard


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Backhouse  
View profile  
 More options Sep 8 2012, 8:51 am
From: Richard Backhouse <richardabackho...@gmail.com>
Date: Sat, 8 Sep 2012 05:51:34 -0700 (PDT)
Local: Sat, Sep 8 2012 8:51 am
Subject: Re: [amd-implement] Re: Common configuration draft

So it just dawned on me that the dependency list ids don't have to be
modified as the only one that are affected as the relative ones and they
don't need to be changed :-). I think my current approach is overdoing
things.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Backhouse  
View profile  
 More options Sep 8 2012, 1:52 pm
From: Richard Backhouse <richardabackho...@gmail.com>
Date: Sat, 08 Sep 2012 13:52:10 -0400
Local: Sat, Sep 8 2012 1:52 pm
Subject: Re: [amd-implement] Re: Common configuration draft

After realizing my originally approach was overly complex and also
doomed to failure I have ended up with a much simpler solution that
passes the 3 mapConfig tests, "mapConfig", "mapConfigStar" and
"mapConfigStarAdapter" :-)

James, if it helps I can fork the amdjs-tests repo and create a push
request with these 3 tests I've added.

Richard
On 9/8/12 8:51 AM, Richard Backhouse wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Burke  
View profile  
 More options Sep 11 2012, 2:13 pm
From: James Burke <jrbu...@gmail.com>
Date: Tue, 11 Sep 2012 11:13:48 -0700
Local: Tues, Sep 11 2012 2:13 pm
Subject: Re: [amd-implement] Re: Common configuration draft
On Sat, Sep 8, 2012 at 10:52 AM, Richard Backhouse

<richardabackho...@gmail.com> wrote:
> James, if it helps I can fork the amdjs-tests repo and create a push request
> with these 3 tests I've added.

That would be awesome!

I also updated the config page to what you suggested, but instead of
"ID/prefix" I just said "ID prefix". So:

"Object. Specifies for a given module ID prefix, what module ID prefix
to use in place of another module ID prefix"

James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Backhouse  
View profile  
 More options Sep 11 2012, 3:11 pm
From: Richard Backhouse <richardabackho...@gmail.com>
Date: Tue, 11 Sep 2012 15:11:54 -0400
Local: Tues, Sep 11 2012 3:11 pm
Subject: Re: [amd-implement] Re: Common configuration draft
On 9/11/12 2:13 PM, James Burke wrote:
> On Sat, Sep 8, 2012 at 10:52 AM, Richard Backhouse
> <richardabackho...@gmail.com> wrote:
>> James, if it helps I can fork the amdjs-tests repo and create a push request
>> with these 3 tests I've added.
> That would be awesome!

> I also updated the config page to what you suggested, but instead of
> "ID/prefix" I just said "ID prefix". So:

> "Object. Specifies for a given module ID prefix, what module ID prefix
> to use in place of another module ID prefix"

> James

James,

Here is the pull request :

https://github.com/amdjs/amdjs-tests/pull/10

Richard


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Burke  
View profile  
 More options Sep 11 2012, 3:28 pm
From: James Burke <jrbu...@gmail.com>
Date: Tue, 11 Sep 2012 12:28:32 -0700
Local: Tues, Sep 11 2012 3:28 pm
Subject: Re: [amd-implement] Re: Common configuration draft
On Tue, Sep 11, 2012 at 12:11 PM, Richard Backhouse

<richardabackho...@gmail.com> wrote:
> https://github.com/amdjs/amdjs-tests/pull/10

Thank you, merged! I also updated the README to mention the
availability of these new tests.

James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »