Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #654 from Krekotun/patch-1
Browse files Browse the repository at this point in the history
Update 08-modular-development.md
  • Loading branch information
addyosmani committed Apr 12, 2015
2 parents ea1e602 + 4168f45 commit efd3921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapters/08-modular-development.md
Expand Up @@ -25,7 +25,7 @@ You might be thinking that there is little benefit to RequireJS. After all, you
Every time the browser loads in a file you've referenced in a `<script>` tag, it makes an HTTP request to load the file's contents. It has to make a new HTTP request for each file you want to load, which causes problems.

- Browsers are limited in how many parallel requests they can make, so often it's slow to load multiple files, as it can only do a certain number at a time. This number depends on the user's settings and browser, but is usually around 4-8. When working on Backbone applications it's good to split your app into multiple JS files, so it's easy to hit that limit quickly. This can be negated by minifying your code into one file as part of a build process, but does not help with the next point.
- Scripts are loaded synchronously. This means that the browser cannot continue page rendering while the script is loading, .
- Scripts are loaded synchronously. This means that the browser cannot continue page rendering while the script is loading.

What tools like RequireJS do is load scripts asynchronously. This means we have to adjust our code slightly, you can't just swap out `<script>` elements for a small piece of RequireJS code, but the benefits are very worthwhile:

Expand Down

0 comments on commit efd3921

Please sign in to comment.