jorendorff / js-loaders

Pseudoimplementation of the proposed ES6 module loaders.
54 stars 7 forks source link

Make Loader.prototype.define and Loader.prototype.module set step to 'fetch' if options.address set #83

Closed guybedford closed 10 years ago

guybedford commented 10 years ago

This would allow the:

  <module name="name" src="source">

Module loading scenario, if it is going to be supported.

Similarly for the anonymous analog:

  <module src="source">
probins commented 10 years ago

related to this, there's a contradiction with 1.6.3.18 which says that module() and define() don't need to be fetched. Is there a difference between define() with an address option and load()? If not, then perhaps it would be better to remove address option from define(), and say that define() is the equivalent of <module name="xx"> and load() is the equivalent of <module name="xx" src="...">.

dherman commented 10 years ago

@guybedford I can see that the API is making the correspondence to HTML confusing, sorry! The correspondence is:

This skinning of the API is obviously confusing, because it's not clear how it corresponds to the features it reflects. Jason and I are going to noodle on skinning the API better to make these correspondences clearer.

johnjbarton commented 10 years ago

How about something like loader.module(name, source, options):

guybedford commented 10 years ago

@dherman ok that makes much more sense, thanks for clarifying! Closing this issue in some attempt to keep things organised.