收口原生网络查询边界
将 Expo 网络状态查询收口到 HostBridge network 模块 将 Tauri 网络状态查询收口到 HostBridge network 模块 同步原生壳结构门禁、架构文档和共享记忆
This commit is contained in:
@@ -94,6 +94,14 @@ const desktopHostBridgeNavigationSource = fs.readFileSync(
|
||||
desktopHostBridgeNavigationPath,
|
||||
'utf8',
|
||||
);
|
||||
const desktopHostBridgeNetworkPath = new URL(
|
||||
'../src-tauri/src/host_bridge/network.rs',
|
||||
import.meta.url,
|
||||
);
|
||||
const desktopHostBridgeNetworkSource = fs.readFileSync(
|
||||
desktopHostBridgeNetworkPath,
|
||||
'utf8',
|
||||
);
|
||||
const desktopHostBridgeNotificationsPath = new URL(
|
||||
'../src-tauri/src/host_bridge/notifications.rs',
|
||||
import.meta.url,
|
||||
@@ -225,6 +233,7 @@ const expectedDesktopHostBridgeRustFiles = [
|
||||
'files.rs',
|
||||
'mod.rs',
|
||||
'navigation.rs',
|
||||
'network.rs',
|
||||
'notifications.rs',
|
||||
'protocol.rs',
|
||||
'share.rs',
|
||||
@@ -1692,6 +1701,24 @@ for (const snippet of [
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
!desktopHostBridgeDispatchSource.includes(
|
||||
'resolve_desktop_host_bridge_network_status().await',
|
||||
) ||
|
||||
desktopHostBridgeDispatchSource.includes('resolve_desktop_network_status') ||
|
||||
desktopHostBridgeDispatchSource.includes('spawn_blocking(resolve_desktop_network_status)')
|
||||
) {
|
||||
throw new Error('desktop shell network HostBridge method must delegate to network module');
|
||||
}
|
||||
for (const snippet of [
|
||||
'resolve_desktop_host_bridge_network_status',
|
||||
'spawn_blocking(resolve_desktop_network_status)',
|
||||
]) {
|
||||
if (!desktopHostBridgeNetworkSource.includes(snippet)) {
|
||||
throw new Error(`desktop shell network module is missing ${snippet}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (config.build?.frontendDist !== '../../../dist') {
|
||||
throw new Error('desktop shell must package the root H5 dist');
|
||||
}
|
||||
@@ -1863,6 +1890,7 @@ const expectedRustHostBridgeFiles = [
|
||||
'files.rs',
|
||||
'mod.rs',
|
||||
'navigation.rs',
|
||||
'network.rs',
|
||||
'notifications.rs',
|
||||
'protocol.rs',
|
||||
'share.rs',
|
||||
|
||||
Reference in New Issue
Block a user