补充 mpx2web skill - #2545
Open
wangxiaokou wants to merge 22 commits into
Open
补充 mpx2web skill#2545wangxiaokou wants to merge 22 commits into
wangxiaokou wants to merge 22 commits into
Conversation
hiyuki
reviewed
Jul 9, 2026
|
|
||
| | 知识库 | 说明 | | ||
| | --- | --- | | ||
| | [条件编译](./references/conditional-compile.md) | 模板、脚本、样式、JSON 等不同部分的条件编译语法,遇到无法跨端等效实现需分平台处理时读取 | |
Collaborator
There was a problem hiding this comment.
改skill需要考虑和mpx2rn skill(未来可能抽离出一个mpx base skill)混合使用,mpx2rn skill中已有的基础部分不需要再额外描述,重点描述web特有的差异和最佳实践
added 15 commits
July 13, 2026 14:33
hiyuki
reviewed
Sep 9, 2026
| 11. 连续触摸手势与 `tap` 共存时,按 [Web 模板能力参考](./references/web-template-reference.md) 使用与当前手势绑定的一次性误触标记;禁止用固定时间窗吞掉之后的合法点击。 | ||
| 12. 用 `transform: scale()` 兼容小字号时,按 [Web 样式实践](./references/web-style-practice.md) 同时校正变换原点和布局占位;不能只让视觉字号变小。 | ||
| 13. WebView 消息安全按 [WebView Bridge 参考](./references/webview-bridge-reference.md) 核对。优先使用内建 `bindmessage`;若 Web 与小程序消息协议不同,用 `bindmessage@web` / `bindmessage@wx` 分开处理,或在同一处理器内写真实平台分支。Web 处理器在领券、跳转等副作用前严格拒绝缺失或不等于当前值的业务主键;不要写成“字段存在时才比较”。不得反向要求既有小程序协议新增 Web-only 的 origin/source/业务字段。只有额外监听全局 `message` 时才同时校验完整可信 origin 与当前 iframe `contentWindow`。 | ||
| 14. 存在 WXS 事件绑定时,先运行 `node <skill-root>/scripts/validate-wxs-web-events.js <file.mpx>` 检查小程序与 Web 事件是否成对。 |
added 2 commits
September 18, 2026 21:41
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## 第三方 H5 SDK |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## Web 运行配置 |
Collaborator
There was a problem hiding this comment.
你专门搞一个Web config reference吧
hiyuki
reviewed
Sep 20, 2026
| Web 下不要依赖以下小程序语义: | ||
|
|
||
| - `onLaunch`:不要依赖冷启动/热启动区别,也不要依赖真实 `scene`、`shareTicket` 等宿主参数。 | ||
| - App `onShow` / `onHide`:不要把它们当作小程序前后台事件,也不要依赖完整进入参数。 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## 与微信小程序的全局能力差异 |
hiyuki
reviewed
Sep 20, 2026
Comment on lines
+185
to
+195
| ## Web 运行时配置入口 | ||
|
|
||
| 配置键及默认行为统一由 [Web JSON 配置参考](./web-json-reference.md#web-运行配置) 维护,本文件不重复列举。应用脚本需要读取或设置**运行时**配置时使用 `mpx.config.webConfig`;它不是 `mpx.config.js` 的导出对象,构建期 `webConfig` 仍位于 `pluginOptions.mpx.plugin`。 | ||
|
|
||
| --- | ||
|
|
||
| ## Web 状态管理与 SSR | ||
|
|
||
| Web 端推荐使用 `@mpxjs/pinia` 承载新状态域。普通 CSR 可创建全局 Pinia 实例;SSR 必须为每次请求创建独立状态实例,避免请求间状态污染。 | ||
|
|
||
| SSR 数据预取、`onAppInit`、`serverPrefetch`、`onSSRAppCreated` 与状态注水统一见 [SSR 专项参考](./ssr-reference.md)。 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## 选择器与基础标签转换 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## 注水缓存与请求竞态 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## 同构请求层边界 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## 数据预取与状态注水 |
hiyuki
reviewed
Sep 20, 2026
| @@ -0,0 +1,182 @@ | |||
| # Mpx2Web SSR 专项参考 | |||
Collaborator
There was a problem hiding this comment.
我都不知道你这篇文档的内容是从哪来的???
你要是不知道怎么写就让AI参考mpx文档https://mpxjs.cn/guide/advance/ssr.html改一下就好了。。。。
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## Vue 生态组件 |
hiyuki
reviewed
Sep 20, 2026
| - Web 不支持 `bubbles`、`composed`、`capturePhase` 传播选项,不依赖它们实现跨层通知。 | ||
| - 需要跨层通知时,在 Web 侧显式监听并转发,或使用项目已有通信方案;保留原有数据,避免与微信传播链重复通知。接收关系不明确时不能只删除传播参数或用空回调代替。 | ||
|
|
||
| ### `$forceUpdate` 与 setup `forceUpdate` |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## 小字号兼容 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## CSS 变量 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## 内建滚动组件与 transform |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## 浏览器页面滚动 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## Web 内建组件 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## Web 模板编译限制 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## Web 原生标签 |
hiyuki
reviewed
Sep 20, 2026
|
|
||
| --- | ||
|
|
||
| ## Web 组件降级 |
hiyuki
reviewed
Sep 20, 2026
| @@ -0,0 +1,171 @@ | |||
| # Mpx2Web WebView Bridge 参考 | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.