Skip to content

补充 mpx2web skill - #2545

Open
wangxiaokou wants to merge 20 commits into
masterfrom
feat-mpx2web-skill
Open

补充 mpx2web skill#2545
wangxiaokou wants to merge 20 commits into
masterfrom
feat-mpx2web-skill

Conversation

@wangxiaokou

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread .agents/skills/mpx2web/SKILL.md Outdated

| 知识库 | 说明 |
| --- | --- |
| [条件编译](./references/conditional-compile.md) | 模板、脚本、样式、JSON 等不同部分的条件编译语法,遇到无法跨端等效实现需分平台处理时读取 |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改skill需要考虑和mpx2rn skill(未来可能抽离出一个mpx base skill)混合使用,mpx2rn skill中已有的基础部分不需要再额外描述,重点描述web特有的差异和最佳实践

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要添加ssr reference

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 事件是否成对。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这为啥需要专门的校验脚本?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants