Description
Since posting #6097, we've decided to alter the format of System.register
(while we still can!), to rather use a module context object as the second argument:
So that:
export let name = __moduleName;
Becomes:
System.register([], function($export, $moduleContext) {
return {
setters: [],
execute: function() {
$export('name', $moduleContext.id);
}
};
});
instead of:
System.register([], function($export, __moduleName) {
return {
setters: [],
execute: function() {
$export('name', __moduleName);
}
};
});
This is so that this context argument can potentially be amended in future with additional metadata if and when this is specified at any point in future in the language.
My knowledge of TypeScript internals is quite limited, so I wasn't able to quickly get together a transformer to replace __moduleName
with $moduleContext.id
, but this should be relatively straightforward to do.
In the mean time, it may be worth reverting #6097 to avoid unnecessary breaking changes here.
This corresponds to Traceur PR google/traceur-compiler#2051 and Babel PR babel/babel#3166.
Apologies for any confusion here!