Introduction
Logic Layer - App Service
The logic layer of the Mini Program development framework uses a JavaScript engine to provide an execution environment for developers' JavaScript code and the unique features of Byte Mini Programs.
The logic layer processes data and sends it to the view layer while receiving event feedback from the view layer.
All the code written by developers will be bundled into a JavaScript file and run when the Mini Program is launched, until the Mini Program is destroyed. This behavior is similar to a ServiceWorker, which is why the logic layer is also referred to as App Service.
In addition to JavaScript, we have added some features to facilitate Mini Program development:
- Added
App
andPage
methods for program and page registration. - Added
getApp
andgetCurrentPages
methods to respectively obtain the App instance and the current page stack. - Provided a rich set of APIs for Byte-specific capabilities, such as user data, scanning, payment, and more.
- Provided modular capabilities, with each page having its own independent scope.
Note: The logic layer of the Mini Program framework does not run in a browser, so some capabilities of JavaScript in the web, such as window
and document
, cannot be used.