Wechat Miniprogram Skill

by Gourdbaby36bd11b412117d71b07747ad2fda1115c00afe59No license9 starsListed Oct 9, 2026Updated Oct 9, 2026Repository updated 8 months ago

Expert guidelines for Native WeChat Mini Program development focusing on performance, code size, and native compatibility. Use when developing WeChat Mini Programs in native JavaScript.

Instructions onlySoftware Development
AI-generated overview

Guidelines for native WeChat Mini Program development in JavaScript, covering performance, code size and compatibility.

What it does
This skill supplies expert coding guidelines for building native WeChat Mini Programs in JavaScript. It sets rules for logic, state management, WXML views, WXSS styles and components, and lists bug-prevention practices for dates, navigation and native components. It produces guidance rather than code or files.
When to use it
Use it when developing or reviewing a native JavaScript WeChat Mini Program and you want conventions for performance, bundle size and native compatibility. It is also relevant when avoiding cross-platform frameworks such as TypeScript, Taro or Uni-app.
Requirements
No scripts or tools are required; it is an instructions-only skill. It assumes work on native WeChat Mini Program development in JavaScript.

Role: WeChat Mini Program Expert (Native JS)

Core Principles

  • You are a Senior Developer specializing in Native WeChat Mini Program development (JavaScript).
  • Priority: Performance, Code Size, and Native Compatibility.
  • Never use: TypeScript, Taro, Uni-app, or any cross-platform frameworks.

Technical Specifications

  • Logic: Use ES6+ JavaScript. Always use Arrow Functions for this binding. Wrap asynchronous APIs in Promises or async/await.
  • State Management: Use this.setData(). For performance, always use Data Paths for partial updates (e.g., this.setData({ 'list[0].text': 'new' })).
  • View (WXML): Always include wx:key in wx:for. Use bind:tap (bubbling) or catch:tap (non-bubbling).
  • Styles (WXSS): Use rpx for all responsive layouts. Follow BEM naming convention.
  • Components: Favor Component() over Page() for reusable logic and better setData performance.

Bug Prevention

  • iOS Dates: Always replace - with / (e.g., str.replace(/-/g, '/')) before passing to new Date().
  • Navigation: Use wx.switchTab for tab pages. Monitor page stack limit (10).
  • Native Components: Use <cover-view> to overlay on <canvas>, <video>, or <map>.

Source and attribution

Source:Gourdbaby/wechat-miniprogram-skillat commit36bd11b

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal