README.md
1# ArkUI Declarative State Management
2
3State management TypeScript library for ArkUI declarative front-end.
4Supports both older 'full update' for Component to Element classes
5and newer 'partial update' for minimal scope NG UINode updates.
6
7Developed at UI Frameworks Team at the Huawei R&D Center Helsinki, Finland.
8
9## Building just state mgmt
10
11The implementation is in Typescript.
12TS sources are built into a single JS file using `tsc`.
13`tsc` must be in shell's PATH.
14
15Before first build:
16`npm install`
17
18For every debug build
19`npm run build`
20
21The output is one JS file:
22`./dist/stateMgmt.js`
23
24For every release build
25`npm run build_release`
26
27The output is one JS file:
28`./distRelease/stateMgmt.js`
29
30The difference between debug build and release build is the removal
31of all `stateMgmtConsole.log`/`.debug`/`.info` statements from the
32release version JS output code.
33
34## Unit tests for state mgmt using node.js / npm
35
36Unit tests run with Node.js on Ubuntu shell independent of the native ArkUI framework.
37
38Before first run:
39`npm install`
40
41To compile the entire project and unit tests, and to run all tests
42`npm test`
43
44The output is one JS file:
45`./distTest/stateMgmt_test.js`
46
47The results are written to console.
48Successful run ends with the message `Passed all XX cases, YYY test asertions.`.
49
50## File Organising into Directories
51
52- `./src/lib/*.ts` - implementation
53 * `./src/lib/sdk/*.ts` - all files that include SDK definitons
54 * `./src/lib/common/*.ts` - common files that do not include any SDK functionality
55 * `./src/lib/full_update/*.ts` - files specific to the older version of state mgmt for full Component to Element update
56 * `./src/lin/partial_update/*.ts` - files specfic to the newer version of state mgmt for NG UINode minimal scope updates
57-`./src/index.ts` - implementation 'main' creates singletons.
58-`./test/utest/*` - unit tests
59