Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

docs: round out the WeChat guide (best practices + cross-links)

yhh02e51a1c684f
diff --git a/docs/astro/src/content/docs/guides/wechat.mdx b/docs/astro/src/content/docs/guides/wechat.mdx
index b49cd656c..2a2f38335 100644
--- a/docs/astro/src/content/docs/guides/wechat.mdx
+++ b/docs/astro/src/content/docs/guides/wechat.mdx
@@ -58,3 +58,21 @@ levels download on demand rather than bloating the initial package:
the game fails at runtime. The exporter only wires in the side modules the
entry scene actually requires, so unused ones add no weight.
</Aside>
+
+## Best practices
+
+- **Stay under the main-package limit** (WeChat caps the initial package) by moving
+ on-demand content into `subpackages/<name>/` — see [Assets](/docs/guides/assets/).
+- **Compress textures** (PNG→KTX2 at cook time) to shrink the package and speed
+ first load.
+- **Build only the side modules you use** — each unused `*-wechat` module you skip is
+ weight you don't ship.
+- **Test in WeChat DevTools**, not just the browser — the file system, storage, and
+ socket backends differ from the web.
+- **Preload the next level's group** (`loadGroup`) during play so the subpackage
+ download doesn't stall the transition.
+
+## See also
+
+- [Assets](/docs/guides/assets/) — addressable groups and cooking map onto subpackages.
+- [Networking](/docs/guides/networking/) — sockets use `wx.connectSocket` here.
diff --git a/docs/astro/src/content/docs/zh-cn/guides/wechat.mdx b/docs/astro/src/content/docs/zh-cn/guides/wechat.mdx
index f6f1fd479..60657f37e 100644
--- a/docs/astro/src/content/docs/zh-cn/guides/wechat.mdx
+++ b/docs/astro/src/content/docs/zh-cn/guides/wechat.mdx
@@ -54,3 +54,17 @@ node build-tools/cli.js build -t physics-wechat
`spine-wechat` / `physics-wechat`,导出会警告且游戏在运行时失败。导出器只接入入口
场景实际需要的侧模块,未用到的不会增加体积。
</Aside>
+
+## 最佳实践
+
+- **保持在主包限制以内**(微信对初始包有上限):把按需内容移到 `subpackages/<name>/`——见
+ [资源](/docs/zh-cn/guides/assets/)。
+- **压缩纹理**(cook 时 PNG→KTX2)以缩小包体、加快首屏加载。
+- **只构建你用到的侧模块**——每跳过一个未用的 `*-wechat` 模块就是少发的体积。
+- **在微信开发者工具里测试**,而不只是浏览器——文件系统、存储与套接字后端都与 Web 不同。
+- **在游玩中预加载下一关的分组**(`loadGroup`),让子包下载不卡过渡。
+
+## 参见
+
+- [资源](/docs/zh-cn/guides/assets/) —— 可寻址分组与 cook 映射到子包。
+- [联网](/docs/zh-cn/guides/networking/) —— 那里套接字用 `wx.connectSocket`。