Skip to content

Commit a9977b0

Browse files
committed
合并master后提交
2 parents 8846ccb + d6ee324 commit a9977b0

40 files changed

Lines changed: 1755 additions & 167 deletions

File tree

.agents/skills/mpx2rn/references/rn-api-reference.md

Lines changed: 341 additions & 89 deletions
Large diffs are not rendered by default.

.agents/skills/mpx2rn/references/rn-script-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
| `selectComponent(selector)` | 方法 | 共用 | 按选择器取第一个匹配实例。RN 不能像小程序一样按 selector 遍历视图树,须在模板目标节点声明 **空 wx:ref**,由编译期建立 **`#id` / `.class` 与节点**的映射后,本 API 才能按小程序写法解析。 |
187187
| `selectAllComponents(selector)` | 方法 | 共用 | 取全部匹配实例数组,**RN 侧与 `selectComponent` 相同**:依赖模板 **空 wx:ref** 与编译期 selector 映射,仅支持 **`#id` / `.class`**|
188188
| `createSelectorQuery()` | 方法 | 共用 | 在实例作用域内创建查询对象。后续 **`select(selector)`** 等链式调用在 RN 上同样依赖目标节点 **空 wx:ref**,通过编译映射将 `#id` / `.class` 落到真实视图;命中非 virtualHost 自定义组件时,返回该组件实体 host 节点信息。 |
189-
| `createIntersectionObserver(options?)` | 方法 | 共用 | 在实例作用域内创建交叉观察。若相对某一节点观察且传入 **`#id` / `.class`**(如 `relativeTo` 等),RN 侧同样要求该节点模板已声明 **空 wx:ref** 并完成编译期映射,其余行为依赖 `@mpxjs/api-proxy` 的 RN 实现。 |
189+
| `createIntersectionObserver(options?)` | 方法 | 共用 | 在实例作用域内创建交叉观察。输出 RN 时应优先使用此实例方法,框架会自动将最近的滚动容器上下文填充为底层工厂方法的第三个参数。若相对某一节点观察且传入 **`#id` / `.class`**(如 `relativeTo` 等),RN 侧同样要求该节点模板已声明 **空 wx:ref** 并完成编译期映射,其余行为依赖 `@mpxjs/api-proxy` 的 RN 实现。 |
190190
| `$refs` | 属性 | 共用 | 模板 **`wx:ref="refName"`** 对应的懒解析访问器(如 `this.$refs.refName`);**空 wx:ref 不会注册具名 ref**,但与 selector 映射可并存——需按名取子实例时再写 **`wx:ref="refName"`**|
191191
| `$watch` | 方法 | 共用 | 动态创建对数据路径或表达式的侦听,返回用于停止侦听的函数,行为与选项式 `watch` 对齐。 |
192192
| `$forceUpdate` | 方法 | 共用 | 强制触发视图更新,可传入数据对象参与本次刷新,RN 侧由 `MpxProxy` 与 React 更新调度配合完成。 |

.agents/skills/skill-creator/LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright [yyyy] [name of copyright owner]
190+
Copyright 2026 Anthropic, PBC.
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ jobs:
5555
- name: build-plugin
5656
run: npm run build --prefix test/e2e/plugin-project
5757

58-
- name: build-perf
59-
run: npm run build -w @mpxjs/perf
58+
- name: build-tsc
59+
run: npm run build:tsc
6060

6161
- name: exec unit test
6262
run: npm t && npm t --prefix test/e2e/miniprogram-project && npm t --prefix test/e2e/plugin-project

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ dev-dist
2424
packages/webpack-plugin/lib/runtime/components/react/dist/
2525
packages/perf/dist/
2626
.agent-workflows/
27+
.agents/skills/mpx/

docs-vitepress/.vitepress/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ const sidebar: ExtendedSidebar = {
209209
text: 'arrayBufferToBase64',
210210
link: '/api-proxy/base/arrayBufferToBase64',
211211
},
212+
{
213+
text: 'canIUse',
214+
link: '/api-proxy/base/canIUse',
215+
},
212216
{
213217
text: '系统',
214218
collapsed: true,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## mpx.canIUse(string schema)
2+
3+
判断当前环境是否支持指定的 API、对象或方法。
4+
5+
RN 支持情况:支持。RN 下使用静态能力表判断,不会为了检测能力而加载原生模块。
6+
7+
[参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.canIUse.html)
8+
9+
### 参数 {#parameters}
10+
11+
**string schema**\
12+
API、对象或方法的能力描述,写法遵循小程序 `canIUse``schema` 约定。
13+
14+
RN 静态能力表只收录抹平层已有实际能力的内置 API、对象与方法,不收录 `envError`、空实现或明确未实现的兼容占位能力。该判断不会检测可选原生依赖是否安装、运行时权限是否授予,也不包含通过 `custom` 注入的业务 API。
15+
16+
### 返回值 {#return-value}
17+
18+
**boolean**\
19+
支持返回 `true`,否则返回 `false`
20+
21+
### 示例代码 {#example-code}
22+
23+
```js
24+
mpx.canIUse('request') // true
25+
mpx.canIUse('RequestTask.abort') // true
26+
mpx.canIUse('RequestTask.onHeadersReceived') // false(RN 暂未实现)
27+
mpx.canIUse('previewImage') // false(RN 暂未实现)
28+
```

docs-vitepress/api-proxy/base/system/getSystemInfo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
</tbody>
116116
</table>
117117
</td></tr>
118-
<tr><td>deviceOrientation</td><td>string</td><td>设备方向(注意:IOS客户端横屏游戏获取deviceOrientation可能不准,建议以屏幕宽高为准)值: portrait(竖屏)/landscape(横屏)</td><td></td><td><span style="color: red; font-weight: bold;">✗</span></td><td><span style="color: green; font-weight: bold;">✓</span></td><td><span style="color: red; font-weight: bold;">✗</span></td></tr>
118+
<tr><td>deviceOrientation</td><td>string</td><td>设备方向,值:portrait(竖屏)/ landscape(横屏)。RN 端根据屏幕宽高计算。</td><td></td><td><span style="color: red; font-weight: bold;">✗</span></td><td><span style="color: green; font-weight: bold;">✓</span></td><td><span style="color: red; font-weight: bold;">✗</span></td></tr>
119119
</tbody>
120120
</table>
121121

docs-vitepress/api-proxy/device/bluetooth-ble/closeBLEConnection.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ mpx.closeBLEConnection(Object object)
1616
| fail | function | || 接口调用失败的回调函数 |
1717
| complete | function | || 接口调用结束的回调函数(调用成功、失败都会执行) |
1818

19+
> RN 平台未传 `deviceId` 时进入 `fail` 回调,`errMsg``closeBLEConnection:fail parameter error`,随后以同一结果调用 `complete`
20+
1921
### 错误 {#error}
2022

2123
| 错误码 | 错误信息 | 说明 | 支付宝 |

docs-vitepress/api-proxy/device/bluetooth-ble/createBLEConnection.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ mpx.createBLEConnection(Object object)
1919
| fail | function | || 接口调用失败的回调函数 | **<span style="color: green;">✓</span>** |
2020
| complete | function | || 接口调用结束的回调函数(调用成功、失败都会执行) | **<span style="color: green;">✓</span>** |
2121

22+
> RN 平台未传 `deviceId` 时进入 `fail` 回调,`errMsg``createBLEConnection:fail parameter error`,随后以同一结果调用 `complete`
23+
2224

2325
### 错误 {#error}
2426

0 commit comments

Comments
 (0)