hyperscript-rxjs 1.2.7 → 1.3.1

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/package.json CHANGED
@@ -1,34 +1,47 @@
1
1
  {
2
- "dependencies": {},
3
2
  "devDependencies": {
4
- "rxjs": "7.5.5",
5
- "@babel/core": "7.17.7",
6
- "@babel/plugin-proposal-class-properties": "7.16.7",
7
- "@babel/plugin-proposal-export-default-from": "7.16.7",
8
- "@babel/plugin-proposal-export-namespace-from": "7.16.7",
9
- "@babel/plugin-proposal-pipeline-operator": "7.17.6",
10
- "@babel/preset-env": "7.16.11",
11
- "@webpack-cli/serve": "1.6.1",
12
- "babel-jest": "27.5.1",
13
- "babel-loader": "8.2.3",
3
+ "@babel/core": "7.27.1",
4
+ "@babel/preset-env": "7.27.2",
5
+ "@microsoft/api-extractor": "7.52.8",
6
+ "@webpack-cli/serve": "3.0.1",
7
+ "babel-jest": "29.7.0",
8
+ "babel-loader": "10.0.0",
14
9
  "clean-webpack-plugin": "4.0.0",
15
- "core-js": "3.21.1",
16
- "jest": "27.5.1",
17
- "node-fetch": "3.2.3",
18
- "webpack": "5.70.0",
19
- "webpack-cli": "4.9.2",
20
- "webpack-dev-server": "4.7.4",
21
- "webpack-merge": "5.8.0"
10
+ "core-js": "3.42.0",
11
+ "jest": "29.7.0",
12
+ "jest-environment-jsdom": "29.7.0",
13
+ "jsdom": "26.1.0",
14
+ "node-fetch": "3.3.2",
15
+ "regenerator-runtime": "0.14.1",
16
+ "rxjs": "7.8.2",
17
+ "tslib": "2.8.1",
18
+ "typescript": "5.8.3",
19
+ "webpack": "5.99.8",
20
+ "webpack-cli": "6.0.1",
21
+ "webpack-dev-server": "5.2.1",
22
+ "webpack-merge": "6.0.1"
23
+ },
24
+ "jest": {
25
+ "testEnvironment": "jsdom",
26
+ "transform": {
27
+ "^.+\\.jsx?$": "babel-jest"
28
+ },
29
+ "transformIgnorePatterns": [
30
+ "/node_modules/(?!rxjs)"
31
+ ]
22
32
  },
23
33
  "scripts": {
24
34
  "build": "webpack --config webpack.prod.js",
25
35
  "start": "webpack serve --config webpack.dev.js",
26
- "test": "jest"
36
+ "test": "jest",
37
+ "dts:build": "tsc",
38
+ "dts:extract": "api-extractor run --local"
27
39
  },
28
40
  "name": "hyperscript-rxjs",
29
- "description": "A js UI library that uses rxjs to react dom directly.",
41
+ "description": "A js UI library that uses rxjs to handle dom directly.",
30
42
  "main": "dist/hyperscript-rxjs.js",
31
- "version": "1.2.7",
43
+ "types": "dist/hyperscript-rxjs.d.ts",
44
+ "version": "1.3.1",
32
45
  "author": "cuishengli<34696643@qq.com>",
33
46
  "keywords": [
34
47
  "ui",
@@ -40,5 +53,9 @@
40
53
  "type": "git",
41
54
  "url": "https://github.com/xp44mm/hyperscript-rxjs"
42
55
  },
43
- "license": "LGPL-3.0-or-later"
56
+ "license": "LGPL-3.0-or-later",
57
+ "files": [
58
+ "dist",
59
+ "README.md"
60
+ ]
44
61
  }
package/readme.md CHANGED
@@ -1,45 +1,151 @@
1
- `hyperscript-rxjs`是一个直接操作DOM的js前端框架库。`hyperscript-rxjs`具有如下特点:
2
1
 
3
- * 相比操作DOM模型的命令式代码,`hyperscript-rxjs`更具声明性。
2
+ # hyperscript-rxjs
4
3
 
5
- * `hyperscript-rxjs`修复或绕开了很多DOM的历史缺陷。
4
+ A JavaScript UI library that uses RxJS to handle DOM directly.
6
5
 
7
- * 像knockout一样,`hyperscript-rxjs`使用MVVM分离视图与视图模型,不同的是`hyperscript-rxjs`采取通用的rxjs库来观察变化。
6
+ ## Features
8
7
 
9
- * 像react一样,`hyperscript-rxjs`操作DOM,与html无关。不同的是`hyperscript-rxjs`直接操作DOM本身,无虚拟DOM。
8
+ - Reactive programming with RxJS.
9
+ - Direct DOM manipulation.
10
+ - Lightweight and flexible.
10
11
 
11
- * `hyperscript-rxjs`采用更新的事件标准`addEventListener`,不采用属性事件`onevent`。采用rxjs观察DOM模型的变化,事件通知。
12
+ ---
12
13
 
13
- * 尽管rxjs是技术发展趋势,用户仍然可以基于`hyperscript-rxjs`实现代码,渐进实现不依赖任何框架的代码。
14
+ ## Installation
14
15
 
15
- `hyperscript-rxjs`学习难度小于react,并且其知识兼容底层的DOM,实用性更强。教程见单独的文件。
16
+ Install the library via npm:
16
17
 
17
- ## 依赖库
18
+ ```bash
19
+ npm install hyperscript-rxjs
20
+ ```
21
+
22
+ ---
23
+
24
+ ## Usage
25
+
26
+ ### Basic Example
27
+
28
+ ```javascript
29
+ import { Comparer } from "hyperscript-rxjs";
30
+
31
+ const comparer = new Comparer((a, b) => a - b);
32
+ console.log(comparer.sort([3, 1, 2])); // Output: [1, 2, 3]
33
+ ```
34
+
35
+ ### Importing Specific Modules
36
+
37
+ You can import specific modules as needed:
38
+
39
+ ```javascript
40
+ import { nestedCombineLatest } from "hyperscript-rxjs";
41
+ ```
42
+
43
+ ---
44
+
45
+ ## API
46
+
47
+ ### Exported Modules
48
+
49
+ #### Comparers
50
+ - `Comparer`
51
+ - `defaultComparer`
52
+ - `keyComparer`
53
+ - `keyPathComparer`
54
+ - `entryComparer`
55
+
56
+ #### Reactive Utilities
57
+ - `isRxType`
58
+ - `ObservableArray`
59
+
60
+ #### Other Utilities
61
+ - `Deep`
62
+ - `nodes`
63
+ - `object`
64
+ - `props`
65
+ - `ramda`
66
+ - `structures`
67
+ - `unquoted-json`
68
+
69
+ ---
70
+
71
+ ## Development
72
+
73
+ ### Prerequisites
74
+
75
+ Ensure you have the following installed:
76
+ - Node.js (>= 14.x)
77
+ - npm (>= 6.x)
18
78
 
19
- `hyperscript-rxjs` is based on `rxjs`。
79
+ ### Clone the Repository
20
80
 
21
- ## 入门
81
+ ```bash
82
+ git clone https://github.com/xp44mm/hyperscript-rxjs.git
83
+ cd hyperscript-rxjs
84
+ ```
85
+
86
+ ### Install Dependencies
87
+
88
+ ```bash
89
+ npm install
90
+ ```
22
91
 
23
- 一个Hello World程序,就像写html一样简单。
92
+ ### Build the Project
24
93
 
25
- ```js
26
- import { p } from 'hyperscript-rxjs'
27
- export function hello() { return p('hello world!'); }
94
+ ```bash
95
+ npm run build
28
96
  ```
29
97
 
30
- 本框架API的设计和DOM底层完全一致,即使你将来不使用本框架,也会有益于你的职业生涯。本教程的其余部分将更加详细地涵盖前端库的各种功能以及其它高级用法。
98
+ The build output will be located in the `dist/` directory.
99
+
100
+ ---
31
101
 
32
- ## 教程
102
+ ## Testing
33
103
 
34
- 教程及其源代码位于github库`xp44mm/hyperscript-rxjs-test`中。
104
+ ### Run Tests
35
105
 
36
- ## 相关库
106
+ ```bash
107
+ npm test
108
+ ```
37
109
 
38
- 推荐使用如下库,编写更优美的代码:
110
+ ### Watch Tests
111
+
112
+ ```bash
113
+ npm run test:watch
114
+ ```
115
+
116
+ ### Test Coverage
117
+
118
+ ```bash
119
+ npm run test:coverage
120
+ ```
39
121
 
40
- xp44mm/structural-comparison
122
+ ---
41
123
 
42
- xp44mm/deep-rxjs
124
+ ## Contributing
43
125
 
44
- xp44mm/parse-html
126
+ Contributions are welcome! Please follow these steps:
45
127
 
128
+ 1. Fork the repository.
129
+ 2. Create a new branch for your feature or bugfix.
130
+ 3. Commit your changes and push the branch.
131
+ 4. Submit a pull request.
132
+
133
+ ---
134
+
135
+ ## License
136
+
137
+ This project is licensed under the **LGPL-3.0-or-later** license. See the [LICENSE](LICENSE) file for details.
138
+
139
+ ---
140
+
141
+ ## Repository
142
+
143
+ [GitHub Repository](https://github.com/xp44mm/hyperscript-rxjs)
144
+
145
+ ---
146
+
147
+ ## Author
148
+
149
+ **cuishengli**
150
+ Email: 34696643@qq.com
151
+ ```