{"action":"created","issue":{"url":"https://api.github.com/repos/muicss/loadjs/issues/20","repository_url":"https://api.github.com/repos/muicss/loadjs","labels_url":"https://api.github.com/repos/muicss/loadjs/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/muicss/loadjs/issues/20/comments","events_url":"https://api.github.com/repos/muicss/loadjs/issues/20/events","html_url":"https://github.com/muicss/loadjs/issues/20","id":159560129,"number":20,"title":"parallel loading order","user":{"login":"neuropass","id":288600,"avatar_url":"https://avatars.githubusercontent.com/u/288600?v=3","gravatar_id":"","url":"https://api.github.com/users/neuropass","html_url":"https://github.com/neuropass","followers_url":"https://api.github.com/users/neuropass/followers","following_url":"https://api.github.com/users/neuropass/following{/other_user}","gists_url":"https://api.github.com/users/neuropass/gists{/gist_id}","starred_url":"https://api.github.com/users/neuropass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neuropass/subscriptions","organizations_url":"https://api.github.com/users/neuropass/orgs","repos_url":"https://api.github.com/users/neuropass/repos","events_url":"https://api.github.com/users/neuropass/events{/privacy}","received_events_url":"https://api.github.com/users/neuropass/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-06-10T05:14:02Z","updated_at":"2016-06-11T16:23:19Z","closed_at":null,"body":"First of I love this! I'm coming from headJS which is a fantastic loader (core only) almost as little as loadJS. \r\n\r\nSecond, Looks like when you load in parallel the order changes in reverse.\r\n\r\nFor example I would logically load my files like this in parallel:\r\n\r\n`loadjs(['//cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js', '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js'], 'thunk');`\r\n\r\nhowever in the dom the files are changed in reverse and the output is this: \r\n\r\n`\r\nloadjs(['//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js', '//cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js'], 'thunk');`\r\n\r\n\r\nin this case seeing as bootsrtap needs jQuery first the changes that the scripts will conflict are very high.\r\n\r\nis this a bug or is intended to load the scripts in reverse from the order originally assigned?\r\n\r\n\r\nFor example headJS does this very well and respects the original order, as it loads in sequence and parallel. \r\n\r\nLet me know your thoughts. \r\n"},"comment":{"url":"https://api.github.com/repos/muicss/loadjs/issues/comments/225372784","html_url":"https://github.com/muicss/loadjs/issues/20#issuecomment-225372784","issue_url":"https://api.github.com/repos/muicss/loadjs/issues/20","id":225372784,"user":{"login":"amorey","id":75881,"avatar_url":"https://avatars.githubusercontent.com/u/75881?v=3","gravatar_id":"","url":"https://api.github.com/users/amorey","html_url":"https://github.com/amorey","followers_url":"https://api.github.com/users/amorey/followers","following_url":"https://api.github.com/users/amorey/following{/other_user}","gists_url":"https://api.github.com/users/amorey/gists{/gist_id}","starred_url":"https://api.github.com/users/amorey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amorey/subscriptions","organizations_url":"https://api.github.com/users/amorey/orgs","repos_url":"https://api.github.com/users/amorey/repos","events_url":"https://api.github.com/users/amorey/events{/privacy}","received_events_url":"https://api.github.com/users/amorey/received_events","type":"User","site_admin":false},"created_at":"2016-06-11T16:23:19Z","updated_at":"2016-06-11T16:23:19Z","body":"In an ideal world it would be great to use an async loader (e.g. `loadjs`) to fetch scripts in parallel and execute them in series. Unfortunately there many edge cases and currently it's beyond the scope of this particular library. I'd recommend reading this article for a deep dive into script loading:\r\nhttp://www.html5rocks.com/en/tutorials/speed/script-loading/\r\n\r\nGiven all the edge cases, the simplest thing to do is to use `<script>` tags in the `<head>` when you want to fetch files in parallel and execute them in series, and `loadjs` to load scripts asynchronously. \r\n\r\nWhat are you trying to do in particular? There are a lot of things you can do with `loadjs.done()` and `loadjs.ready()` to keep your script loading fast and simple.\r\n"}}
{"actor":{"display_login":"amorey"}}