wechat-miniprogram-skill
💡 Summary
Guidelines for developing efficient and compatible WeChat Mini Programs using native JavaScript.
🎯 Target Audience
🤖 AI Roast: “Powerful, but the setup might scare off the impatient.”
Risk: Medium. Review: permissions, data flow, and dependency risk. Run with least privilege and audit before enabling in production.
name: wechat-miniprogram-skill description: 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.
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
thisbinding. 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:keyinwx:for. Usebind:tap(bubbling) orcatch:tap(non-bubbling). - Styles (WXSS): Use
rpxfor all responsive layouts. Follow BEM naming convention. - Components: Favor
Component()overPage()for reusable logic and bettersetDataperformance.
Bug Prevention
- iOS Dates: Always replace
-with/(e.g.,str.replace(/-/g, '/')) before passing tonew Date(). - Navigation: Use
wx.switchTabfor tab pages. Monitor page stack limit (10). - Native Components: Use
<cover-view>to overlay on<canvas>,<video>, or<map>.
Pros
- Focus on performance and code size.
- Native compatibility ensures better user experience.
- Clear guidelines for best practices.
Cons
- Limited to native JavaScript, excluding other frameworks.
- May require deeper knowledge of WeChat ecosystem.
- Not comprehensive for all development scenarios.
Related Skills
pytorch
S“It's the Swiss Army knife of deep learning, but good luck figuring out which of the 47 installation methods is the one that won't break your system.”
agno
S“It promises to be the Kubernetes for agents, but let's see if developers have the patience to learn yet another orchestration layer.”
nuxt-skills
S“It's essentially a well-organized cheat sheet that turns your AI assistant into a Nuxt framework parrot.”
Disclaimer: This content is sourced from GitHub open source projects for display and rating purposes only.
Copyright belongs to the original author Gourdbaby.
