Quote: Front-end craftsman

Now that vue3.0 is officially available, it’s time to learn. The following methods can make the project easier to write and use

The project architecture

// 1. Encapsulate the project’s base library

A good base library ensures a minimum quality floor and better scalability for a project. The basic libraries we usually talk about include – component library, basic CSS library, basic tool library.

// 2. Hierarchy management

To manage your requests, it is recommended that you separate the API layer of your project into a single layer of management, which will facilitate better management and reduce complexity in complex interfaces.

Performance optimization

/ / 1. The cache

Caching can reduce requests and speed things up. For example, if you jump from a list of items to a detail page, you can cache item details using cookies or localStore, and if the details have already been loaded, reuse them.

// 2. Lazy loading

Lazy loading is usually to see the content faster, we usually lazy loading of images and other large resources, as well as lazy loading of our components. In fact, basically all performance optimization, nothing more than from these two aspects of the approach.

engineering

// 1. Improvements to WebPack

Improved WebPack configuration to improve packaging speed, changed WebPack support for new syntax sugar.

// 2. Control code quality

Control code quality, which we’ll do via ESLint.

// 3. Automatic deployment

Deployment is repetitive and time-consuming. We can automate it and save a lot of money.