Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program cloud development debugging


May 20, 2021 WeChat Mini Program Development Document


Table of contents


Debugging

  • The cloud function is debugged locally
  • Network panel
  • Environment tips

The cloud function is debugged locally

Cloud development provides on-premises debugging of cloud functions, providing an on-premises node.js cloud function operating environment that is consistent with the line, allowing developers to debug cloud functions on-premises, and using on-premises debugging can improve development and debugging efficiency:

  • Step debugging/break point debugging: Step-by-step debugging/break point debugging can be performed on the cloud function Node.js instance after using on-premises debugging, as compared to debugging by viewing logs played online in the cloud development console
  • Integrated program testing: Actions such as interactive clicks on small programs in the emulator, if they trigger a cloud function that opens local debugging, will request a local instance instead of the cloud
  • Optimize the development process and improve development efficiency: the debugging phase does not need to upload the deployment of cloud functions, in debugging the cloud function, compared to the debugging process when not using local debugging ("local modification code - - upload deployment cloud function - call"), save the upload waiting steps, change to only "local modification - gt; call" process, greatly improve the development and debugging efficiency

Local debugging also provides special debugging capabilities, including network panel support for demonstrating HTTP requests and cloud development requests, calling diagram presentations, hot overloading when local code is modified, and more, helping developers better develop debugging cloud functions. Details of the features can be found below.

It is recommended that developers will use local debugging test before the development phase and go online to deploy.

More detailed documentation Click here to view.

NetWork panel

From WeChat Developer Tools 1.02.1905302 and foundation 2.7.1, the cloud development request (database, cloud function, file storage, etc.) is displayed in the small program NetWork panel, and the API name is displayed when presenting in the NetWork panel.(WX.Cloud.uploadFile and WX.Cloud.DownloadFile except), there is a special request type Cloud, which will display the environment ID of the actual request, request body (database call, show the SDK syntax), JSON package,Time-consuming, and call the stack.

Note: The implementation of the development interface in the developer tool is different from the client, and the time consumption in the developer tool is generally slower than the client. The test results in a particular environment is that the client will be faster than the developer tool.Around 33%.

The following is an example:

WeChat small program cloud development debugging

Database Details Example:

WeChat small program cloud development debugging

Example of a return package:

WeChat small program cloud development debugging

Environment tips

Starting with WeChat developer tools 1.02.1905302 and the base library 2.7.1, in the small program debugger, if wx.cloud.init is used, the default calling environment used in the currently configured widget is output in the debugger.

WeChat small program cloud development debugging