Have you ever created a Vue.js Router by yourself? Do you know the foundations of a router? When we use one from a framework or plugin it might seem like it just works, but under the hood, a router must take care of several things.
In this series, we’ll take a look at how we can build our own Vue.js router.
At this point, the router doesn’t work as a Single Page App (SPA) router, since it assigns a new route to `window.location` directly, which performs a hard reload.
Let’s see what we have to do to adapt our router to serve as a SPA router.
Lazy Loading and Code Splitting are two of the main points of the PRPL Pattern, a pattern named by Google which intent is to to provide some structure to make the initial load of a Progressive Web App (PWA) as fast as possible, boosting the performance.
So far we’ve build the router in a component and a history module within the source code of our app. The problem of it is that the router is tied to the app, specially because the routes are defined within the AppRouter component. That could be improved by moving out the routes from the component […]