On Thu, Feb 20, 2014 at 1:01 PM, Allen Wirfs-Brock <al...@wirfs-brock.com>wrote:

>
> On Feb 20, 2014, at 12:53 PM, Guy Bedford wrote:
>
> > Thanks, if there is some way to detect this it may well be useful.
> >
> > The use case I came across it was trying to allow ES6 modules to be
> transpiled into AMD for use in an ES6 loader. I'm still not sure how
> necessary the use case is, but it definitely would need this functionality
> work.
>
> The Es6 module loader design has specific hooks to support importing from
> foreign module systems.  However, I'll leave it to Dave or Sam to explain
> how to use them...
>

Guy is trying to support an important path for JS developers to get to ES6
and adopt ES module loading: allow developers to mix ES6 and AMD modules.
 He already supports loading AMD via ES6-loader.  Now he wants to allow
that AMD code to depend upon ES6 modules.  This allows AMD teams to
transition smoothly to ES6.  He needs something like:
define(['a', 'b'], function(a, b) {
  if (!(a instanceof Module)) a = { default: a }
  if (!(b instanceof Module)) b = { default: b }
....
so his generated AMD code can accept ES6 modules.

HTH,
jjb
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to