discourse/app/assets
Kyle Zhao ffc241eb25
FIX: multiple loadScript to the same url may resolve prematurely (#6474)
This is how `loadScript(url)` currently deals with multiple concurrent requests

1. Check existing `<script>` tags, and mark existing scripts (other than the 
   input `url`) as loaded
2. Find "true" `url` of the requested resource (CDN, subfolder path, etc)
3. Check if we have loaded the resource with that "true" `url`, and resolve 
   immediately if we have
4. Otherwise insert a `<script>` tag with the "true" `url` to load it

For example, in a subfolder install:

- Input `url` = `/javascripts/script.js`
- "True" `url` = `/subfolder/javascript/script.js`

And the _very_ subtle bug here is that we should use also use the true `url` 
for step (1), because:

- Since the input and true `url` are different, we mistakenly mark the true 
  `url` as loaded in step one 
- After finding the true `url`, and setting `loaded[trueUrl] = true` in (1), we
  resolve the promise prematurely, when the resource could still be loading
2018-10-11 08:55:36 +08:00
..
fonts Update FontAwesome to 4.7.0 2017-04-26 15:16:30 -04:00
images UX: Category colorpicker restyle 2018-10-04 15:47:46 -04:00
javascripts FIX: multiple loadScript to the same url may resolve prematurely (#6474) 2018-10-11 08:55:36 +08:00
stylesheets FEATURE: Option to disable user presence and profile 2018-10-10 17:34:33 -04:00