Code splitting allows us to divide an application’s JavaScript bundle into smaller bundles. Instead of loading the JavaScript for the whole application, we can load an initial bundle that only has what the application needs to bootstrap. Using lazy loading, we dynamically load the JavaScript bundles for the feature modules when the user navigates to its route.
Although this allows the application to load faster and responses to user interactions to be faster, lazy loading can cause the initial navigation to the feature routes to be slow, as the user has to wait while the browser downloads and processes the JavaScript bundle before rendering the route.
Can we achieve both faster application load time and faster navigation?
Find out in this talk how preloading feature routes can give faster navigation, what built-in preloading strategy is available in Angular, how to create custom preloading strategies and use Quicklink library for selective preloading or Guess.js for predictive pre-fetching.