Fallback.js can load libraries from a CDN, and if a CDN is down it will instead load them as a local asset through the asset pipeline.
This has the advantages of a CDN (bandwidth savings, speed, likelihood of libraries being already in the client cache) with the advantages of local assets (not depending on the uptime of the CDN).
For now only angularjs, bootstrap and jquery are loaded this way, because other vendor libraries use less-trustworthy CDNs.
With this change angularjs, bootstrap and jquery are individually precompiled by the asset pipeline, and they are no longer in the asset manifest (they will be individually loaded by fallback.js only if a CDN is down).
Also there is no longer a <script> tag in the view that loads the application.js manifest. The application.js manifest is instead loaded by fallback.js. This is necessary to guarentee that this project's js files (which are mostly angularjs services, modules etc or use jQuery methods) are loaded only after angularjs, bootstrap and jquery are loaded.
↧
Trending Articles
More Pages to Explore .....