ModuleLoader / system-register-loader

Module loader to load System.register modules in the browser and Node
15 stars 2 forks source link

Load as System in the browser #4

Closed sebdeckers closed 7 years ago

sebdeckers commented 7 years ago

Thanks for creating this loader. 🙇

I have an aesthetic question: Would it make sense to automatically declare an instance as the global System variable in the browser?

That way it's a drop-in replacement for the full-size system.js library. A user could follow the usual SystemJS entry snippet:

<script src="dist/system-register-loader.js"></script>
<script>
  System.import('./path/to/file.js').then(function(m) {
    // ...
  });
</script>
probins commented 7 years ago

I'm not sure that System is still planned as a global. The direction in TC39 seems to be the other way, e.g. it looks like System.global will now be just global. The current proposal is to have import(), not System.import(). Personally, I am continuing to create and use System for the moment (apart from anything else, I don't know how you polyfill import()), but at some point I will have to change this.

sebdeckers commented 7 years ago

TIL :dizzy: Thanks!