electron-buff 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +20 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,22 +2,22 @@
2
2
 
3
3
  Electron enhancement utilities for electron-vite projects.
4
4
 
5
- ## Modules
6
-
7
- | Module | Description | Documentation |
8
- |--------|-------------|---------------|
9
- | **XPC** | **Async/await** style cross-process communication | [English](./doc/xpc.doc.md) \| [中文](./doc/xpc_cn.doc.md) |
10
-
11
5
  ## Install
12
6
 
13
7
  ```bash
14
8
  yarn add electron-buff
15
9
  ```
16
10
 
11
+ ## Modules
12
+
13
+ | Module | Description | Documentation |
14
+ |--------|-------------|---------------|
15
+ | **XPC** | **Async/await** style cross-process communication | [English](./doc/xpc.doc.md) \| [中文](./doc/xpc_cn.doc.md) |
16
+
17
17
 
18
18
  ## Module Overview
19
19
 
20
- ### XPC — Cross-Process Communication
20
+ ### XPC — **Async/Await** Style Cross-Process Communication
21
21
 
22
22
  XPC is a bidirectional **async/await** RPC module for **Electron** applications. Unlike Electron's built-in `ipcRenderer.invoke` / `ipcMain.handle`, which only supports renderer-to-main request–response, XPC enables **any process** (renderer or main) to call handlers registered in **any other process** with full `async/await` semantics — including renderer-to-renderer, main-to-renderer, and main-to-main invocations.
23
23
 
@@ -28,6 +28,19 @@ XPC is a bidirectional **async/await** RPC module for **Electron** applications.
28
28
 
29
29
  > Full documentation: [English](./doc/xpc.doc.md) | [中文](./doc/xpc_cn.doc.md)
30
30
 
31
+ ## 模块概览
32
+
33
+ ### XPC — **Async/Await** 风格的跨进程通信
34
+
35
+ XPC 是面向 **Electron** 应用的双向异步 RPC 模块。不同于 Electron 内置的 `ipcRenderer.invoke` / `ipcMain.handle` 仅支持渲染进程到主进程的请求-响应模式,XPC 允许**任意进程**(渲染进程或主进程)以完整的 `async/await` 语义调用**任意其他进程**中注册的处理器——包括渲染进程间、主进程到渲染进程、以及主进程内部的调用。
36
+
37
+ **优点:**
38
+
39
+ 1. **将工作分配到渲染进程** — 可以将耗时或阻塞性任务委托到渲染进程中执行,保持主进程的响应性,降低主进程的性能开销。
40
+ 2. **任意进程间统一的 async/await 语义** — 由于所有跨进程调用均支持 `async/await`,跨多个进程的复杂多步作业流程可以用简洁的顺序逻辑编排,无需深层嵌套回调或手动事件协调。
41
+
42
+ > 完整文档:[English](./doc/xpc.doc.md) | [中文](./doc/xpc_cn.doc.md)
43
+
31
44
  ## License
32
45
 
33
46
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-buff",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Electron enhancement utilities for electron-vite projects",
5
5
  "exports": {
6
6
  "./xpc/main": {