reca 2.2.0 → 2.3.4
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 +32 -18
- package/package.json +25 -12
package/README.md
CHANGED
|
@@ -1,39 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
# ReCA - React Clean Architecture state manager
|
|
2
|
+
|
|
2
3
|
[](https://www.npmjs.com/package/reca)
|
|
3
|
-
[](CODE_OF_CONDUCT.md)
|
|
4
4
|
[](https://github.com/LabEG/reca/blob/main/LICENSE)
|
|
5
|
+

|
|
6
|
+
[](https://www.codacy.com/gh/LabEG/reca/dashboard?utm_source=github.com&utm_medium=referral&utm_content=LabEG/reca&utm_campaign=Badge_Grade)
|
|
7
|
+

|
|
8
|
+
[](https://github.com/LabEG/code-style/security/code-scanning)
|
|
9
|
+
[](CODE_OF_CONDUCT.md)
|
|
5
10
|
|
|
6
|
-
# ReCA - React Clean Architecture state manager
|
|
7
11
|
Created at the intersection of Functional style and OOP technologies. It is based on the simplicity of the functional style of the view, enriched with OOP technologies for writing business logic. Perfect for beginner developers and complex enterprise applications
|
|
8
12
|
|
|
9
13
|
## Features
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
|
|
15
|
+
- **Microstores** - calculations state of components don't affect to other components, small CPU usage for update states,
|
|
16
|
+
- **Direct Functions Call** - don't need heavy CPU utilization for search function in reducer, just call the function directly,
|
|
17
|
+
- **No Boilerplate** - write only business code without those debt,
|
|
18
|
+
- **Dependency Injection** - override any part of your application for unit test or other customer,
|
|
19
|
+
- **Microfrontend** - perfect support microfrontends out the box without any boilerplates,
|
|
20
|
+
- **Simple Data Flow** - don't need search functions call chain for debug your reducers,
|
|
21
|
+
- **Code Organization** - structures the code easily even for large enterprise applications,
|
|
22
|
+
- **Extra Small Size** - only 1kb of minified code.
|
|
23
|
+
|
|
24
|
+
## Why not Redux or Flux?
|
|
25
|
+
|
|
26
|
+
- **Monostore** - as the application grows, the cost of maintaining a monostore greatly exceeds the useful work.
|
|
27
|
+
- **Reducers** - a large number of reducers makes you spend a lot of time searching for the necessary function.
|
|
28
|
+
- **Architecture problem** - forces you to use tons of additional packages to solve problems, such as saga, thunk, toolkit and many others.
|
|
23
29
|
|
|
24
30
|
## Instalation
|
|
31
|
+
|
|
25
32
|
npm:
|
|
26
|
-
|
|
33
|
+
|
|
34
|
+
``` bash
|
|
27
35
|
npm install reca
|
|
28
36
|
```
|
|
29
37
|
|
|
30
38
|
yarn
|
|
31
|
-
|
|
39
|
+
|
|
40
|
+
``` bash
|
|
32
41
|
yarn add reca
|
|
33
42
|
```
|
|
34
43
|
|
|
35
44
|
## Examples
|
|
45
|
+
|
|
36
46
|
### Example AutoStore
|
|
47
|
+
|
|
37
48
|
Create your Store by inheriting from AutoStore, and use it in a component via useStore hook.
|
|
38
49
|
|
|
39
50
|
``` typescript
|
|
@@ -169,6 +180,7 @@ export const ToDoComponent = (): JSX.Element => {
|
|
|
169
180
|
```
|
|
170
181
|
|
|
171
182
|
### Example using DI
|
|
183
|
+
|
|
172
184
|
This example demonstrates the simplicity of the business logic and the simplified principles of code organization according to the Clean Architecture methodology. The example is simplified for readme, but following the same principles you can organize a full-fledged Clean Architecture. Through the service constructor, you can pass other DI dependencies, such as Repository, Provider, and others.
|
|
173
185
|
|
|
174
186
|
``` typescript
|
|
@@ -273,9 +285,11 @@ export const TestStoreComponent = (): JSX.Element => {
|
|
|
273
285
|
```
|
|
274
286
|
|
|
275
287
|
## Support and Documentation
|
|
288
|
+
|
|
276
289
|
Discord server: [click here](https://discordapp.com/channels/974049080454045796/974049142022209566)
|
|
277
290
|
|
|
278
291
|
Wiki: [click here](https://github.com/LabEG/reca/wiki)
|
|
279
292
|
|
|
280
293
|
## License
|
|
294
|
+
|
|
281
295
|
ReCA is [MIT licensed](https://github.com/LabEG/reca/blob/main/LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reca",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.4",
|
|
4
4
|
"description": "ReCA - React Clean Architecture state manager",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -20,8 +20,21 @@
|
|
|
20
20
|
],
|
|
21
21
|
"author": "LabEG",
|
|
22
22
|
"license": "MIT",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/LabEG/reca.git"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/LabEG/reca/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/LabEG/reca#readme",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
23
36
|
"dependencies": {
|
|
24
|
-
"first-di": "^3.
|
|
37
|
+
"first-di": "^3.4.5"
|
|
25
38
|
},
|
|
26
39
|
"peerDependencies": {
|
|
27
40
|
"react": ">=16.0.0",
|
|
@@ -29,18 +42,18 @@
|
|
|
29
42
|
},
|
|
30
43
|
"devDependencies": {
|
|
31
44
|
"@testing-library/react": "^16.3.0",
|
|
32
|
-
"@swc-node/register": "^1.
|
|
33
|
-
"@types/chai": "^5.2.
|
|
34
|
-
"@types/react": "^19.
|
|
35
|
-
"chai": "^
|
|
36
|
-
"global-jsdom": "^
|
|
37
|
-
"jsdom": "^
|
|
38
|
-
"react": "^19.
|
|
39
|
-
"react-dom": "^19.
|
|
45
|
+
"@swc-node/register": "^1.11.1",
|
|
46
|
+
"@types/chai": "^5.2.3",
|
|
47
|
+
"@types/react": "^19.2.7",
|
|
48
|
+
"chai": "^6.2.1",
|
|
49
|
+
"global-jsdom": "^27.0.0",
|
|
50
|
+
"jsdom": "^27.3.0",
|
|
51
|
+
"react": "^19.2.3",
|
|
52
|
+
"react-dom": "^19.2.3",
|
|
40
53
|
"reflect-metadata": "^0.2.2",
|
|
41
|
-
"rimraf": "^6.
|
|
54
|
+
"rimraf": "^6.1.2",
|
|
42
55
|
"standard-version": "^9.5.0",
|
|
43
56
|
"ts-node": "^10.9.2",
|
|
44
|
-
"typescript": "^5.
|
|
57
|
+
"typescript": "^5.9.3"
|
|
45
58
|
}
|
|
46
59
|
}
|