Table of contents

  1. Positioning
  2. Pain points of network requests
  3. How to solve
  4. [email protected] updating plan
  5. alova vscode plugin demonstration

Positioning (don't spend time on this small request, leave it to alova)

Alova is positioned as the next generation request tool, which will save you most of the work in terms of requests. You only need to specify which API to use and what strategy to execute the request.

Network request pain points

In enterprise-level projects where multiple people collaborate, the cost of Client-Server interaction is relatively high.

Untitled

  1. High cost of front-end and back-end collaboration :
    1. Dependency on backend notification : API updates require backend active notification
    2. API documentation dependency : Front-end needs to consult API documentation for information.
    3. API code writing : The front-end manually writes interface code according to the API documentation.
    4. Missing response data type : API's response data has no type hint by default, which increases the cost of data usage.
    5. Increased bug rate : API changes can lead to increased project bug rates.
  2. Data interaction logic is complex : front-end requests are often not so simple, and it is necessary to consider when to issue requests, when not to issue requests, how to handle response data, etc. according to different scenarios to meet the performance and performance improvement of the project, which will lead to an increase in developer time cost and code maintenance cost.

Solution

Untitled

  1. IDE plugin (vscode/webStorm) : Solve the front-end and back-end collaboration problem (plugin demonstration please see the end of the article):
    1. Automatically generate request codes and response data types
    2. Embed the api document into the code, you can directly query and insert API interfaces in the code
    3. Regularly update api information and proactively notify front-end development
    4. Interface update records to prevent changes from causing bugs.
  2. Request strategy : select the corresponding request strategy, one line of code to achieve complex data interaction logic.