whatwg / loader

Loader Standard
https://whatwg.github.io/loader/
Creative Commons Zero v1.0 Universal
609 stars 45 forks source link

Proposal: Hook registration with url-scopes/path patterns #4

Open matthewrobb opened 10 years ago

matthewrobb commented 10 years ago

The System loader may well be used to load a great many different things that are not simply JavaScript modules. It seems that in the spirit of The Extensible Web it would be best to describe what hooks get used in a way that is universal and can be extended by users at the lowest level. Ideally without HAVING to sub-class.

I would propose that something similar to what is being considered for ServiceWorkers => url-scopes/path-expressions be used in an api for registering hooks to handle loading. This would allow, for example, a translate hook be registered for "*.coffee" etc.

caridy commented 9 years ago

we should solve https://github.com/whatwg/loader/issues/72 first, then we can get back to this use case.