收口原生网络查询边界

将 Expo 网络状态查询收口到 HostBridge network 模块

将 Tauri 网络状态查询收口到 HostBridge network 模块

同步原生壳结构门禁、架构文档和共享记忆
This commit is contained in:
2026-06-19 22:08:19 +08:00
parent 177c18ddcd
commit c0940bc790
11 changed files with 87 additions and 12 deletions
@@ -2792,3 +2792,10 @@
- 决策:Expo 移动壳新增 `apps/mobile-shell/src/host-bridge/navigation.ts`,统一承接 HostBridge 外链打开、受控 H5 跳转和 WebView 刷新,底层继续复用 `src/shell/navigation.ts``src/shell/url.ts`Tauri 桌面壳新增 `apps/desktop-shell/src-tauri/src/host_bridge/navigation.rs`,统一承接外链打开、同源 H5 跳转和主窗口刷新,底层继续复用 `shell::navigation` 的 URL 归一和宿主上下文补写。两端 `dispatch` 只保留 method 委托和响应包装,配置检查会拒绝分发层直接调用外链 opener、URL 归一或 WebView navigate / reload 细节。
- 影响范围:`apps/mobile-shell/src/host-bridge/navigation.ts``apps/mobile-shell/src/host-bridge/dispatch.ts``apps/mobile-shell/scripts/check-config.mjs``apps/desktop-shell/src-tauri/src/host_bridge/navigation.rs``apps/desktop-shell/src-tauri/src/host_bridge/dispatch.rs``apps/desktop-shell/scripts/check-config.mjs``scripts/check-native-shells.mjs`、宿主壳能力统一协议文档、Expo / Tauri HostBridge 方案文档。
- 验证方式:`npm run mobile-shell:typecheck``npm run mobile-shell:test -- src/host-bridge/bridge.test.ts``npm run desktop-shell:typecheck``cargo test --manifest-path apps/desktop-shell/src-tauri/Cargo.toml``npm run check:native-shells``npm run check:encoding``git diff --check`
## 2026-06-19 原生壳网络查询桥接边界
- 背景:`network.status` 已由 Expo shell network 和 Tauri shell network 承接真实系统 / 主站可达性查询,但两端 HostBridge `dispatch` 仍直接调用底层 network helper 或异步阻塞包装,继续补壳能力时容易让分发层重新承接宿主细节。
- 决策:Expo 移动壳新增 `apps/mobile-shell/src/host-bridge/network.ts`,统一承接 `network.status` HostBridge 查询并复用 `src/shell/network.ts`Tauri 桌面壳新增 `apps/desktop-shell/src-tauri/src/host_bridge/network.rs`,统一承接 `network.status` HostBridge 查询并复用 `shell::network::resolve_desktop_network_status`。两端 `dispatch` 只保留 method 委托和响应包装,配置检查会拒绝分发层直接导入 shell network 或直接执行 `resolve_desktop_network_status`
- 影响范围:`apps/mobile-shell/src/host-bridge/network.ts``apps/mobile-shell/src/host-bridge/dispatch.ts``apps/mobile-shell/scripts/check-config.mjs``apps/desktop-shell/src-tauri/src/host_bridge/network.rs``apps/desktop-shell/src-tauri/src/host_bridge/dispatch.rs``apps/desktop-shell/scripts/check-config.mjs``scripts/check-native-shells.mjs`、宿主壳能力统一协议文档、Expo / Tauri HostBridge 方案文档。
- 验证方式:`npm run mobile-shell:typecheck``npm run mobile-shell:test -- src/host-bridge/bridge.test.ts``npm run desktop-shell:typecheck``cargo test --manifest-path apps/desktop-shell/src-tauri/Cargo.toml``npm run check:native-shells``npm run check:encoding``git diff --check`
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long