kubetail-org / loadjs

A tiny async loader / dependency manager for modern browsers (899 bytes)
MIT License
2.58k stars 150 forks source link

Support loadjs.path #24

Closed rarkins closed 8 years ago

rarkins commented 8 years ago

This is something I use in $script.js which seems to be missing in loadjs. e.g. would be used like:

loadjs.path('/build/public');
loadjs('angular.js', 'angular');
loadjs('jquery.js', 'jquery');
amorey commented 8 years ago

Interesting, thanks for pointing it out! I'm curious to hear how other folks feel about adding a .path() method. In general I've tried to keep the loadjs feature set down to the bare essentials.

rarkins commented 8 years ago

HTTP2 will mean that bundling becomes an antipattern. Therefore I have 20+ separate libraries/files I need to load async, so adding .path() makes the code a lot simpler.

niondir commented 8 years ago

IMHO it adds more state to loadjs making it more implicit what actually is loaded. I would always prefer managing the basePath in the application and prefix it explicitly.

amorey commented 8 years ago

I agree with @Niondir - even if .path() was available I would still prefer to manage the basePath in the application to make it explicit.

I'm going to close this issue for now. If some folks still want .path() I'm happy to re-open the discussion so we can get more opinions.