WeChat Open Platform

Mini Programs Documentation

Details

javascript && wxss

WeChat Mini Programs run on three ports: iOS, Android, and the developer tools used for debugging.

The script execution environments and environments used to render non-native components are different for each of the three ports:

  • In iOS, the Mini Program JavaScript code runs in JavaScriptCore and is rendered by WKWebView. The environments are iOS8, iOS9, and iOS10.
  • In Android, the Mini Program JavaScript code is analyzed using X5 JSCore and rendered by X5 based on a Mobile Chrome 53 core.
  • In the developer tools, the Mini Program JavaScript code runs in nwjs and is rendered by Chrome Webview.

Although the environments of the three ports are very similar, they do have a few differences:

  • ES6 syntax support is inconsistent. Developers can prevent this by enabling ES6 functions that have been converted to ES5.   Details

  • wxss rendering presentation is inconsistent. Although most problems can be avoided by enabling style completion Details, it is still recommended that developers check the Mini Program's actual presentation in iOS and Android.

Client trusted domain name verification

In scenarios where developers use a phone for QR code scanning debugging, after debug mode is opened, the latest client version will not check trusted domain names.

Code files must be encoded in UTF8

iOS only supports the UTF8 encoding format. The latest versions of developer tools will perform an encoding format verification on code files when code is uploaded.

ES6 API support status

WeChat Mini Programs already support the vast majority of ES6 APIs, the specific table is shown below:

  1. tip: TBS 3.0 refers to the Android run environment for WeChat Mini Programs.
  2. tip: Array.values is not supported.
  3. tip: Proxy is not supported.
String iOS8 iOS9 iOS10 TBS3.0
codePointAt
normalize
includes
startsWith
endsWith
repeat
String.fromCodePoint  
Array iOS8 iOS9 iOS10 TBS3.0
copyWithin
find
findIndex
fill
entries
keys
values
includes
Array.from
Array.of  
Number iOS8 iOS9 iOS10 TBS3.0
isFinite
isNaN
parseInt
parseFloat
isInteger
EPSILON
isSafeInteger  
Math iOS8 iOS9 iOS10 TBS3.0
trunc
sign
cbrt
clz32
imul
fround
hypot
expm1
log1p
log10
log2
sinh
cosh
tanh
asinh
acosh
atanh  
Object iOS8 iOS9 iOS10 TBS3.0
is
assign
getOwnPropertyDescriptor
keys
getOwnPropertyNames
getOwnPropertySymbols  
Other iOS8 iOS9 iOS10 TBS3.0
Symbol
Set
Map
Proxy
Reflect
Promise