rhine-var 0.3.1 → 0.3.2
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.
- package/README.md +16 -13
- package/README_zh.md +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,40 +12,41 @@ Developing collaborative applications has never been this easy.
|
|
|
12
12
|
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
|
+
<br/>
|
|
15
16
|
|
|
16
17
|
## Why Choose RHINE-VAR ?
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
### Concise and Efficient Syntax Design
|
|
19
20
|
RhineVar draws inspiration from the design philosophy of the Valtio state management library, significantly reducing the learning curve. Developers can easily manage collaborative data as if they were manipulating regular variables.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
### Comprehensive Type Support
|
|
22
23
|
RhineVar offers full type hints and checks, ensuring precise code completion and static analysis during development. This not only improves the development experience but also reduces potential errors, making it especially suitable for TypeScript projects, enhancing code safety and reliability.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
### Distributed Real-time Collaboration Algorithm
|
|
25
26
|
The underlying collaboration algorithm of RhineVar is powered by the robust Yjs library. Using the CRDT (Conflict-free Replicated Data Type) algorithm, it ensures eventual consistency even in multi-user and offline environments.
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
### High Performance with Low Bandwidth Requirements
|
|
28
29
|
The data synchronization and conflict resolution mechanism is highly efficient. Leveraging Yjs's incremental update mechanism, only necessary data changes are transmitted rather than the entire document, making it ideal for bandwidth-constrained environments and reducing unnecessary data transfers.
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
### Strong Offline Support
|
|
31
32
|
Users can continue to work even while offline. Once reconnected, all changes are automatically synchronized, ensuring no data is lost or conflicted. This is crucial for building offline-first applications.
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
### Cross-platform and Framework Agnostic
|
|
34
35
|
RhineVar can be used in various environments, including browsers, Node.js, and other JavaScript platforms. It integrates with multiple frontend frameworks and libraries such as Next.js, React, Vue.js, ProseMirror, and more.
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
### Lightweight and Extensible
|
|
37
38
|
RhineVar is a highly lightweight library, with its core package only a few KB in size, making it suitable for various frontend applications. Its modular architecture supports feature extensions, allowing developers to import or develop custom modules as needed.
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
### Decentralized Architecture
|
|
40
41
|
With a decentralized architecture, collaborative editing becomes more scalable, efficient, and fault-tolerant. Peer-to-peer data transfer is supported without relying on a central server (currently under development).
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
### Native Yjs Support
|
|
43
44
|
RhineVar offers full support for native Yjs object operations, providing lower-level, richer API support. Direct operations on Yjs objects automatically trigger updates in RhineVar.
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
### More Friendly and Complete Event System
|
|
46
47
|
RhineVar offers an extensive event subscription and listening system with intuitive data change events. It also supports deep data change monitoring within objects, catering to a wide range of use cases.
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
<br/>
|
|
49
50
|
|
|
50
51
|
## Contact Us
|
|
51
52
|
Welcome to join our WeChat group for communication. We look forward to having more community members participate in the creation of rhine-var.
|
|
@@ -62,6 +63,8 @@ yarn add rhine-var
|
|
|
62
63
|
```
|
|
63
64
|
If you don't have `yarn`, you can install it via `npm i rhine-var`, or install `yarn` first using `npm i -g yarn` and then use the command above to install.
|
|
64
65
|
|
|
66
|
+
<br/>
|
|
67
|
+
|
|
65
68
|
## Usage
|
|
66
69
|
|
|
67
70
|
```typescript jsx
|
|
@@ -79,11 +82,11 @@ function Counter() {
|
|
|
79
82
|
</div>
|
|
80
83
|
}
|
|
81
84
|
```
|
|
82
|
-
|
|
85
|
+
### Default Value
|
|
83
86
|
|
|
84
87
|
When the room does not exist on the server, a default value will be used to create the room. If not connected to the server, data from the default value will also be returned.
|
|
85
88
|
|
|
86
|
-
|
|
89
|
+
### Room ID
|
|
87
90
|
|
|
88
91
|
The `Same Room ID` manages the `Same State Variables`, and users who join will experience real-time multi-user collaboration.
|
|
89
92
|
|
package/README_zh.md
CHANGED
|
@@ -10,12 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
</div>
|
|
12
12
|
|
|
13
|
+
<br/>
|
|
13
14
|
|
|
14
15
|
## 为什么选择 RHINE-VAR ?
|
|
15
16
|
|
|
16
17
|
**简洁高效的语法设计:** RhineVar 借鉴了 Valtio 状态管理库的设计理念,极大地降低了学习成本。开发者可以像操作普通变量一样轻松操控协同数据。
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
**完备的类型支持:** RhineVar 提供全面的类型提示和类型检查,确保在开发过程中能够获得精确的代码补全和静态分析。这不仅改善了开发体验,还有效降低了潜在的错误风险,特别适用于 TypeScript 项目,提升了代码的安全性和可靠性。
|
|
19
20
|
|
|
20
21
|
**分布式实时协作算法:** RhineVar 的底层协同算法基于强大的 Yjs 库。通过 CRDT (Conflict-free Replicated Data Type,无冲突复制数据类型) 算法,确保多用户同时使用,甚至离线下使用的最终一致性。
|
|
21
22
|
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
|
|
34
35
|
**更友好且完善的事件体系:** RhineVar 提供了丰富的事件订阅监听方式,直观的数据变更事件,更好的支持数据变更的监听和处理。以及提供了对内部深层数据变化的监听,以适用更多场景。
|
|
35
36
|
|
|
37
|
+
<br/>
|
|
36
38
|
|
|
37
39
|
## Contact Us
|
|
38
40
|
|
|
@@ -50,6 +52,8 @@ yarn add rhine-var
|
|
|
50
52
|
```
|
|
51
53
|
如果你的电脑未安装`yarn`, 也可通过 `npm i rhine-var` 安装。或先用 `npm i -g yarn` 安装`yarn`,然后再用上方命令进行安装。
|
|
52
54
|
|
|
55
|
+
<br/>
|
|
56
|
+
|
|
53
57
|
## Usage
|
|
54
58
|
|
|
55
59
|
```typescript jsx
|
|
@@ -67,11 +71,11 @@ function Counter() {
|
|
|
67
71
|
</div>
|
|
68
72
|
}
|
|
69
73
|
```
|
|
70
|
-
|
|
74
|
+
### Default Value
|
|
71
75
|
|
|
72
76
|
当服务端无信息时,将使用 DefaultValue 作为默认内容。未连接到服务器时,也将根据默认值进行返回。
|
|
73
77
|
|
|
74
|
-
|
|
78
|
+
### Room ID
|
|
75
79
|
|
|
76
80
|
一个房间号对应一个状态变量, 加入到一个房间中的用户会参与到多人协同中。
|
|
77
81
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rhine-var",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Variables that support multi-user collaboration and persistence, making collaboration and variable operations as simple as possible, with strict and well-defined type hints.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|