For the current Skyline support status across different platforms, see the table below.
| Platform | Supported Version | Notes |
|---|---|---|
| Android | 8.0.33+ | Supported |
| iOS | 8.0.34+ | Supported |
| DevTools | Stable 1.06.2307260+ | Supported |
| Windows | Not supported | Planned |
| Mac | Not supported | Planned |
| WeCom | Not supported | In development |
As can be seen, if Mini Program is not running exclusively on the latest version of WeChat for mobile, you need to pay attention to WebView compatibility. Here, we have compiled some compatibility methods and common compatibility issues.
Compatibility Methods
Style Compatibility
The primary difference between Skyline and WebView lies in style support. Therefore, most compatibility work focuses on style adaptation. You can utilize the WXML debugging tool in WeChat DevTools to locate problematic nodes and analyze the corresponding style compatibility.
Regarding specific style compatibility strategies, some styles have different default values in Skyline compared to web. Styles that were omitted due to reliance on default values must now be explicitly specified, such as flex-direction: row. However, it is recommended to enable Default Block Layout and Default ContentBox Box Model instead, as this brings the default behavior closer to web standards. For more details, refer to Skyline WXSS Style Support and Differences.
Compatibility Handling Based on Different Renderers
In some cases, when standard WXML and WXSS are insufficient to achieve full compatibility, you can use JavaScript to check whether Skyline is enabled and apply different WXML or WXSS implementations accordingly. We have added a renderer property to page and component instances, with values of webview or skyline. Refer to the code below:
<view class="position {{renderer}}"></view>
.position {
position: fixed;
}
.position.skyline {
position: absolute;
}
Page({
data: {
renderer: 'webview'
},
onLoad() {
this.setData({
renderer: this.renderer,
})
},
})
Common Compatibility Issues
- Does Skyline need to be applied to the entire Mini Program?
No, Skyline supports enabling at the page or subpackage level, allowing for progressive migration.
- Layout breaks after enabling Skyline
This is usually caused by the default flex layout and box-sizing defaulting to border-box. Developers are recommended to enable Default Block Layout and Default ContentBox Box Model.
- Why does the top native navigation bar disappear after switching to Skyline?
The native navigation bar is not supported. You need to implement it yourself or use the weui component library. It is recommended to add "navigationStyle": "custom" to the page configuration to maintain compatibility with WebView.
- Why is position: absolute relative coordinate inaccurate after switching to Skyline?
In Skyline mode, all nodes default to relative, which may cause absolute relative coordinates to be inaccurate. Developers are advised to modify the node's position or the relative coordinates.
- Multi-segment text cannot be inlined
This is due to the lack of support for inline layout. You need to switch to a flex layout implementation, or wrap multi-segment text with the text component instead of the view component. You can also use the span component to wrap mixed inline text and image. Examples: <span><image /></span>, <span><view style="width: 50px;"/></span>
- Single-line text ellipsis style does not work
text-overflow: ellipse only works on the text component and cannot be applied to the view component. Additionally, you must declare white-space: nowrap and overflow: hidden. It is recommended to directly use <text overflow="ellipsis"/>
- Multi-line text ellipsis style does not work
Based on single-line text ellipsis, set the maximum number of lines using the max-lines attribute of the text component, i.e., <text max-lines="{{2}}"></text>
- z-index behavior is abnormal
This is because Skyline does not support the web standard stacking context. z-index is only effective when applied to nodes at the same hierarchy level. You can adjust the value according to the actual situation.
- weui extension library is unavailable
The platform is currently supporting the extension library, expected to be released soon. It is recommended that developers install the weui component library via npm, replace the miniprogram_dist under node_modules/weui-miniprogram with the miniprogram_dist from the link, and then build npm in WeChat Developer Tools.
- Component animate animation interface is not supported
The component animate animation interface is not currently supported. To achieve related effects, you can use the worklet animation mechanism.
- SVG rendering is incorrect
SVG in Skyline does not support <style> selector matching; you can manually convert to inline styles. The rgba format is not supported; you can use fill-opacity instead. It is recommended to optimize using the online tool SVGO.
- Custom component style behavior is incorrect
- Check if there is style matching across custom components. In Skyline, tag and id selectors do not support cross-component matching, while class selectors follow the Component Style Isolation Mechanism. You can Enable tag selector global matching to align with legacy behavior.
- Horizontal scrolling of WebView scroll-view does not work
Horizontal scrolling requires enabling enable-flex for WebView compatibility. Additionally, add the style display: flex; flex-direction: row; to the scroll-view, and add the style flex-shrink: 0; to the child nodes of the scroll-view.
- When scroll-view contains a lot of content, why does boundingClientRect fail to execute?
Direct child nodes (first-level nodes) of scroll-view are rendered on demand. That is, direct child nodes are not rendered when they are off-screen, so node dimensions cannot be retrieved. Therefore, when boundingClientRect is retrieved via query.selectAll, node dimensions cannot be obtained immediately; they can only be obtained once all nodes are rendered. Developers are advised to try adjusting to retrieve the boundingClientRect of nodes one by one.
- Why do map / canvas / video / camera fail to render in WeChat Developer Tools after switching to Skyline?
In Skyline mode, WeChat Developer Tools do not yet support debugging native components. Developers are advised to use real device preview for debugging.
- In Skyline mode, why does WeChat Developer Tools hot reload not respond?
Skyline mode does not currently support hot reload. It is recommended to turn off hot reload first and recompile to preview the rendering result. The platform will support hot reload capability in the future.