It’s been a while since we published last part of Vue Performance series. I hope you had a chance to apply everything you already learned in your projects and make them faster! If you have read previous articles you already know perfectly how lazy loading works, how to code-split routes and components, and how to manage asynchronous loading in elegant way but we still haven’t covered the aspect that influences bundle size the most - third party libraries. This article is all about them!
While most of the dependencies are available through NPM, many of them also provide a link to a CDN (Content Delivery Network) version so it can be included in any project without additional efforts or build steps.
But there is also a fair amount of popular third-party libraries that don't provide an NPM package and rely fully on being implemented via the script tag. Common examples are newsletter integrations, contact forms, and the Stripe SDK to process payments.
The new version of Vue.js is right around the corner. As of today, Vue 3 is in pre-alpha version and the source code is available on GitHub, under the vue-next branch.
There's been a lot of fuss about the new version of Vue.js, and specifically about the new Composition API. If you have never heard of it, you can take a look at the slides from my talk, Vue 3 and the Composition API, that I presented at Vue Toronto recently. (video of the presentation is coming soon!)
In the previous article we learned about the performance improvements that Vue 3 will bring. We already know that apps written in the new major version of Vue will perform very well but performance isn’t the most important part. The thing that matters most to us developers, is how the new release will affect the way we write our code.
As you could expect, Vue 3 brings a lot of new exciting features.
We tend to hear more and more about the upcoming 3rd major release of Vue.js. While not everything is certain yet by following discussions, we can safely assume that it’s going to be a huge improvement over the current version (that is already outstanding). Vue team is doing an amazing job of improving framework APIs.
The purpose of lazy loading is to postpone downloading parts of your application that are not needed by the user on the initial page load which ends up in much better loading time.
Lazy loading of vue-router routes and common gotchas
In the previous article, we learned about the concept of lazy loading and briefly understood how webpack bundling works under the hood. With a good understanding of basics, we can see how to apply this knowledge in a real-world Vue application. The trick you will earn today could dramatically decrease your bundle size in just a few minutes. Feel excited? Let’s see what it is!
While mobile-first approach becomes a standard and uncertain network conditions are something we should always take into consideration it’s harder and harder to keep your application loading fast. In this series, I’ll dig deep into Vue performance optimization techniques that we are using in Vue Storefront and that you can use in your Vue.js applications to make them loading instantly and perform smooth. My goal is to make this series a full and complete guide on Vue apps performance.