You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.register can be considered as a new module format...
How about extending the UMD pattern to also use System.register?
Something like:
if(System&&typeofSystem.register==="function"){System.register(['b'],factory);}elseif(typeofdefine==='function'&&define.amd){// AMD. Register as an anonymous module.define(['exports','b'],factory);}elseif(typeofexports==='object'){// CommonJSfactory(exports,require('b'));}else{// Browser globalsfactory((root.commonJsStrict={}),root.b);}
For me, System.register is still speculative, and its format could change depending on how the loader API for the ES module loader shakes out. The use of System in general is trying to mimic or guess at the ES API, and it is just not close to done. I also expect the loaders that do implement System.register would know how to load commonjs or amd modules.
node --harmony_modules
> System.register()
ReferenceError: System is not defined
at repl:1:1
at REPLServer.defaultEval (repl.js:248:27)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
at REPLServer.<anonymous> (repl.js:412:12)
at emitOne (events.js:82:20)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:210:10)
at REPLServer.Interface._line (readline.js:549:8)
at REPLServer.Interface._ttyWrite (readline.js:826:14)
As noted at es6-module-loader wiki:
How about extending the UMD pattern to also use
System.register
?Something like:
A similar discussion also takes place at mozilla/localForage#158.
The text was updated successfully, but these errors were encountered: