cabloy 5.1.59 → 5.1.61
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/.claude/hooks/contract-loop-gate.ts +296 -0
- package/.claude/settings.json +16 -0
- package/.claude/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +1 -0
- package/.claude/skills/cabloy-contract-loop/SKILL.md +103 -14
- package/.claude/skills/cabloy-contract-loop/references/contract-loop-map.md +126 -12
- package/.claude/skills/cabloy-contract-loop/references/resource-custom-state-pattern.md +148 -0
- package/.claude/skills/cabloy-contract-loop/references/verification-checklist.md +49 -13
- package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +11 -0
- package/.claude/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md +2 -0
- package/.claude/skills/cabloy-module-removal/SKILL.md +144 -0
- package/.claude/skills/cabloy-resource-field-update/SKILL.md +274 -0
- package/.claude/skills/cabloy-resource-field-update/evals/evals.json +53 -0
- package/.claude/skills/cabloy-resource-field-update/references/custom-renderer-demo-checklist.md +102 -0
- package/.claude/skills/cabloy-resource-field-update/references/field-update-decision-tree.md +120 -0
- package/.claude/skills/cabloy-resource-field-update/references/follow-up-checklist.md +80 -0
- package/.claude/skills/cabloy-resource-field-update/references/verification-checklist.md +97 -0
- package/.claude/skills/cabloy-zova-source-reading/SKILL.md +221 -0
- package/.claude/skills/cabloy-zova-source-reading/references/analysis-modes.md +91 -0
- package/.claude/skills/cabloy-zova-source-reading/references/core-reading-paths.md +117 -0
- package/.github/workflows/docs-pages.yml +2 -0
- package/.github/workflows/vona-cov-pg.yml +2 -0
- package/.github/workflows/vona-test-crud.yml +4 -2
- package/.github/workflows/vona-test-mysql.yml +2 -0
- package/.github/workflows/vona-test-pg.yml +2 -0
- package/.github/workflows/vona-test-sqlite3.yml +2 -0
- package/.github/workflows/vona-tsc.yml +2 -0
- package/.github/workflows/zova-ui.yml +2 -0
- package/.gitignore +0 -4
- package/CHANGELOG.md +52 -0
- package/CLAUDE.md +12 -0
- package/README.md +15 -0
- package/cabloy-docs/.vitepress/config.mjs +89 -0
- package/cabloy-docs/ai/class-placement-rule.md +2 -0
- package/cabloy-docs/ai/cli-to-skill-map.md +14 -0
- package/cabloy-docs/ai/docs-skills-rules-mapping.md +14 -0
- package/cabloy-docs/ai/future-skill-roadmap.md +27 -9
- package/cabloy-docs/ai/introduction.md +1 -0
- package/cabloy-docs/ai/playbook-backend-module.md +6 -0
- package/cabloy-docs/ai/playbook-module-removal.md +164 -0
- package/cabloy-docs/ai/skills.md +11 -0
- package/cabloy-docs/backend/bean-scene-authoring.md +350 -0
- package/cabloy-docs/backend/cli.md +26 -1
- package/cabloy-docs/backend/dto-guide.md +6 -0
- package/cabloy-docs/backend/entity-guide.md +18 -0
- package/cabloy-docs/backend/foundation.md +28 -3
- package/cabloy-docs/backend/introduction.md +10 -0
- package/cabloy-docs/backend/serialization-guide.md +10 -0
- package/cabloy-docs/backend/service-guide.md +2 -0
- package/cabloy-docs/backend/status-guide.md +271 -0
- package/cabloy-docs/backend/websocket-call-flow.md +435 -0
- package/cabloy-docs/backend/websocket-guide.md +455 -0
- package/cabloy-docs/backend/websocket-protocol-guide.md +381 -0
- package/cabloy-docs/backend/websocket-usage-guide.md +356 -0
- package/cabloy-docs/frontend/api-guide.md +2 -0
- package/cabloy-docs/frontend/bean-scene-authoring.md +374 -0
- package/cabloy-docs/frontend/behavior-guide.md +449 -0
- package/cabloy-docs/frontend/cli.md +24 -0
- package/cabloy-docs/frontend/command-scene-authoring.md +495 -0
- package/cabloy-docs/frontend/design-principles.md +6 -0
- package/cabloy-docs/frontend/fetch-interceptor-guide.md +440 -0
- package/cabloy-docs/frontend/form-guide.md +795 -0
- package/cabloy-docs/frontend/foundation.md +29 -0
- package/cabloy-docs/frontend/introduction.md +17 -1
- package/cabloy-docs/frontend/ioc-and-beans.md +16 -9
- package/cabloy-docs/frontend/mock-guide.md +1 -0
- package/cabloy-docs/frontend/model-architecture.md +252 -39
- package/cabloy-docs/frontend/model-resource-best-practices.md +379 -0
- package/cabloy-docs/frontend/model-resource-cookbook.md +505 -0
- package/cabloy-docs/frontend/model-resource-owner-pattern.md +382 -0
- package/cabloy-docs/frontend/model-resource-usage-guide.md +318 -0
- package/cabloy-docs/frontend/model-state-guide.md +366 -13
- package/cabloy-docs/frontend/openapi-sdk-guide.md +5 -2
- package/cabloy-docs/frontend/page-guide.md +6 -0
- package/cabloy-docs/frontend/quickstart.md +4 -0
- package/cabloy-docs/frontend/reading-zova-for-vue-developers.md +266 -0
- package/cabloy-docs/frontend/router-tabs-admin-web-comparison.md +206 -0
- package/cabloy-docs/frontend/router-tabs-introduction.md +106 -0
- package/cabloy-docs/frontend/router-tabs-mechanism.md +469 -0
- package/cabloy-docs/frontend/router-tabs-overview.md +227 -0
- package/cabloy-docs/frontend/router-tabs-route-meta-cookbook.md +343 -0
- package/cabloy-docs/frontend/server-data.md +2 -0
- package/cabloy-docs/frontend/ssr-architecture-overview.md +211 -0
- package/cabloy-docs/frontend/ssr-build-deploy-guide.md +308 -0
- package/cabloy-docs/frontend/ssr-review-checklist.md +184 -0
- package/cabloy-docs/frontend/ssr-troubleshooting-guide.md +301 -0
- package/cabloy-docs/frontend/zova-form-source-reading-map.md +295 -0
- package/cabloy-docs/frontend/zova-form-under-the-hood.md +556 -0
- package/cabloy-docs/frontend/zova-reactivity-under-the-hood.md +320 -0
- package/cabloy-docs/frontend/zova-source-reading-map.md +327 -0
- package/cabloy-docs/frontend/zova-vs-vue3-comparison.md +308 -0
- package/cabloy-docs/fullstack/contract-loop-playbook.md +350 -0
- package/cabloy-docs/fullstack/framework-performance.md +3 -3
- package/cabloy-docs/fullstack/frontend-metadata-to-backend.md +44 -1
- package/cabloy-docs/fullstack/introduction.md +40 -0
- package/cabloy-docs/fullstack/openapi-to-sdk.md +19 -9
- package/cabloy-docs/fullstack/quickstart.md +7 -1
- package/cabloy-docs/fullstack/tutorial-1-first-module.md +111 -0
- package/cabloy-docs/fullstack/tutorial-2-first-crud.md +122 -0
- package/cabloy-docs/fullstack/tutorial-3-frontend-metadata-sharing.md +131 -0
- package/cabloy-docs/fullstack/tutorial-4-custom-level-renderers.md +144 -0
- package/cabloy-docs/fullstack/tutorial-5-backend-contract-sharing.md +146 -0
- package/cabloy-docs/fullstack/tutorial-6-one-contract-four-uses.md +170 -0
- package/cabloy-docs/fullstack/tutorials-overview.md +192 -0
- package/cabloy-docs/index.md +4 -3
- package/cabloy-docs/reference/bean-scene-boilerplates.md +75 -0
- package/cabloy-docs/reference/cli-reference.md +2 -0
- package/package.json +7 -2
- package/scripts/initTestData.ts +25 -0
- package/scripts/upgrade.ts +17 -2
- package/vona/packages-cli/cabloy-cli/package.json +2 -2
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.module.ts +4 -0
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/pnpm-lock.yaml +226 -1091
- package/vona/pnpm-workspace.yaml +0 -1
- package/vona/src/suite-vendor/a-vona/modules/a-core/assets/static/img/vona.svg +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/bean.permission.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-upload/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/package.original.json +1 -1
- package/zova/packages-cli/cli/package.json +3 -3
- package/zova/packages-cli/cli-set-front/cli/templates/init/icon/boilerplate/icons/default/zova.svg +1 -1
- package/zova/packages-cli/cli-set-front/cli/templates/openapi/config/boilerplate/module/openapi.config.ts +6 -1
- package/zova/packages-cli/cli-set-front/package.json +3 -3
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.module.ts +4 -0
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.generate.ts +34 -4
- package/zova/packages-cli/cli-set-front/src/lib/command/create.bean.ts +5 -1
- package/zova/packages-utils/zova-vite/package.json +2 -2
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +282 -1311
- package/zova/pnpm-workspace.yaml +0 -1
- package/zova/src/suite/a-home/modules/home-icon/icons/social/cabloy.svg +1 -1
- package/zova/src/suite/a-home/modules/home-icon/icons/social/vona.svg +1 -1
- package/zova/src/suite/a-home/modules/home-icon/icons/social/zova.svg +1 -1
- package/zova/src/suite/a-home/modules/home-icon/src/.metadata/icons/groups/social.svg +3 -3
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/formFieldSelect/controller.tsx +9 -0
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +1 -1
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/model/resource.ts +66 -16
- package/zova/src/suite-vendor/a-cabloy/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-routertabs/src/model/tabs.ts +60 -18
- package/zova/src/suite-vendor/a-zova/modules/a-table/cli/tableActionRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-table/cli/tableCell/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +4 -4
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# Zova Reactivity Under the Hood
|
|
2
|
+
|
|
3
|
+
This guide explains the source-level runtime path behind Zova’s reactive page and component authoring model.
|
|
4
|
+
|
|
5
|
+
Use this page after [Reading Zova for Vue Developers](/frontend/reading-zova-for-vue-developers) when you want to move from the public mental model to the core source path that makes plain controller fields behave reactively.
|
|
6
|
+
|
|
7
|
+
## Why this page exists
|
|
8
|
+
|
|
9
|
+
The public frontend docs already explain the architectural intent:
|
|
10
|
+
|
|
11
|
+
- Zova keeps Vue 3 reactive strengths
|
|
12
|
+
- Zova prefers controller-oriented and bean-oriented authoring
|
|
13
|
+
- IoC and bean scopes organize state and behavior sharing
|
|
14
|
+
|
|
15
|
+
What many source readers still want next is the implementation bridge:
|
|
16
|
+
|
|
17
|
+
- where the controller instance is created
|
|
18
|
+
- where it becomes reactive
|
|
19
|
+
- where `$computed` connects back to Vue `computed`
|
|
20
|
+
- where page route state is pushed onto the controller
|
|
21
|
+
- where controller-driven render logic joins the normal update flow
|
|
22
|
+
|
|
23
|
+
This page is that bridge.
|
|
24
|
+
|
|
25
|
+
## The shortest accurate runtime model
|
|
26
|
+
|
|
27
|
+
For a page controller, the shortest accurate model is:
|
|
28
|
+
|
|
29
|
+
1. `useControllerPage(...)` creates the Zova context and controller load path
|
|
30
|
+
2. the bean container creates the controller bean with `markReactive = true`
|
|
31
|
+
3. the bean container wraps the controller instance with Vue `reactive(...)`
|
|
32
|
+
4. bean helpers such as `$computed()` and `$watch()` wrap Vue reactive APIs inside the controller instance scope
|
|
33
|
+
5. the component runtime patches render so the controller or render bean becomes the effective render entry
|
|
34
|
+
6. before each render, page-controller route data can be refreshed onto the controller surface
|
|
35
|
+
7. when a controller field changes, Vue dependency tracking drives recomputation and rerender
|
|
36
|
+
|
|
37
|
+
That is why Zova can offer direct-looking class-field authoring while still using Vue runtime behavior underneath.
|
|
38
|
+
|
|
39
|
+
## A concrete source specimen
|
|
40
|
+
|
|
41
|
+
A small public example that shows the pattern clearly is:
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
zova/src/suite/a-demo/modules/demo-basic/src/page/state/controller.tsx
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Representative shape:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
@Controller()
|
|
51
|
+
export class ControllerPageState extends BeanControllerPageBase {
|
|
52
|
+
count: number = 0;
|
|
53
|
+
count2: string;
|
|
54
|
+
|
|
55
|
+
protected async __init__() {
|
|
56
|
+
this.count2 = this.$computed(() => {
|
|
57
|
+
return `=== ${this.count} ===`;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
increment() {
|
|
62
|
+
this.count++;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
protected render() {
|
|
66
|
+
return <div>{this.count2}</div>;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
What matters here is not only the syntax.
|
|
72
|
+
|
|
73
|
+
What matters is that:
|
|
74
|
+
|
|
75
|
+
- `count` is a plain class field
|
|
76
|
+
- `count2` is instance-level derived state
|
|
77
|
+
- `increment()` mutates the controller instance directly
|
|
78
|
+
- `render()` reads controller fields directly
|
|
79
|
+
|
|
80
|
+
The rest of this page explains how that becomes real runtime reactivity.
|
|
81
|
+
|
|
82
|
+
## The core source-reading path
|
|
83
|
+
|
|
84
|
+
When you want to trace the implementation, read these files in order:
|
|
85
|
+
|
|
86
|
+
1. `zova/packages-zova/zova-core/src/composables/useController.ts`
|
|
87
|
+
2. `zova/packages-zova/zova-core/src/bean/beanContainer.ts`
|
|
88
|
+
3. `zova/packages-zova/zova-core/src/bean/beanBase.ts`
|
|
89
|
+
4. `zova/packages-zova/zova-core/src/bean/beanControllerPageBase.ts`
|
|
90
|
+
5. `zova/packages-zova/zova-core/src/core/context/component.ts`
|
|
91
|
+
6. `zova/src/suite-vendor/a-zova/modules/a-router/src/monkey.ts`
|
|
92
|
+
|
|
93
|
+
A compact role map is:
|
|
94
|
+
|
|
95
|
+
- `useController.ts` creates and loads controller, style, and render beans
|
|
96
|
+
- `beanContainer.ts` instantiates beans, injects context, and applies `reactive(...)`
|
|
97
|
+
- `beanBase.ts` exposes instance-scoped wrappers around Vue helpers such as `computed` and `watch`
|
|
98
|
+
- `beanControllerPageBase.ts` provides the page-controller hook points for route-aware controller data updates
|
|
99
|
+
- `component.ts` redirects component render toward controller-oriented render flow
|
|
100
|
+
- `a-router/src/monkey.ts` pushes page route state onto page controllers
|
|
101
|
+
|
|
102
|
+
## Step-by-step runtime path
|
|
103
|
+
|
|
104
|
+
### 1. `useControllerPage(...)` starts the controller load path
|
|
105
|
+
|
|
106
|
+
The public entrypoint for a page is `useControllerPage(...)` in:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
zova/packages-zova/zova-core/src/composables/useController.ts
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The important job here is not only creating a helper.
|
|
113
|
+
|
|
114
|
+
It creates the Zova context, prepares controller data, and registers the async load path that will create the controller bean and related beans.
|
|
115
|
+
|
|
116
|
+
A practical reading takeaway is:
|
|
117
|
+
|
|
118
|
+
- **the page controller is not an ad hoc class instance created by page code**
|
|
119
|
+
- **it is created by the framework runtime inside the bean/container model**
|
|
120
|
+
|
|
121
|
+
### 2. The controller bean is created with `markReactive = true`
|
|
122
|
+
|
|
123
|
+
Inside the controller load path, the framework calls the bean container to create the controller bean with reactive wrapping enabled.
|
|
124
|
+
|
|
125
|
+
That is the key bridge between:
|
|
126
|
+
|
|
127
|
+
- plain class authoring in user code
|
|
128
|
+
- real Vue reactive behavior at runtime
|
|
129
|
+
|
|
130
|
+
A practical reading takeaway is:
|
|
131
|
+
|
|
132
|
+
- **the framework decides that the controller instance itself is a reactive host**
|
|
133
|
+
|
|
134
|
+
### 3. The bean container wraps the instance with Vue `reactive(...)`
|
|
135
|
+
|
|
136
|
+
In:
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
zova/packages-zova/zova-core/src/bean/beanContainer.ts
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The bean container:
|
|
143
|
+
|
|
144
|
+
- creates the class instance
|
|
145
|
+
- attaches framework context such as `sys`, `app`, and `ctx`
|
|
146
|
+
- records bean identity metadata
|
|
147
|
+
- applies Vue `reactive(...)` when the bean should be reactive
|
|
148
|
+
- may also patch the bean with AOP-oriented proxy behavior before the final reactive wrapper is exposed
|
|
149
|
+
|
|
150
|
+
This is one of the most important source-level facts for understanding Zova.
|
|
151
|
+
|
|
152
|
+
Zova does not require the business author to write `reactive({ ... })` around controller state, because the framework already treats the controller bean as the reactive object.
|
|
153
|
+
|
|
154
|
+
### 4. `$computed()` is an instance-scoped wrapper around Vue `computed(...)`
|
|
155
|
+
|
|
156
|
+
In:
|
|
157
|
+
|
|
158
|
+
```text
|
|
159
|
+
zova/packages-zova/zova-core/src/bean/beanBase.ts
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Helpers such as these are exposed from the bean surface:
|
|
163
|
+
|
|
164
|
+
- `$computed()`
|
|
165
|
+
- `$watch()`
|
|
166
|
+
- `$watchEffect()`
|
|
167
|
+
- `$watchPostEffect()`
|
|
168
|
+
- `$watchSyncEffect()`
|
|
169
|
+
- `$toRef()`
|
|
170
|
+
- `$customRef()`
|
|
171
|
+
|
|
172
|
+
The important reading point is:
|
|
173
|
+
|
|
174
|
+
- **Zova is not replacing Vue `computed` with a different reactive theory**
|
|
175
|
+
- **Zova is exposing Vue’s reactive capabilities through a bean-oriented, instance-scoped API surface**
|
|
176
|
+
|
|
177
|
+
So when a controller writes:
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
this.count2 = this.$computed(() => {
|
|
181
|
+
return `=== ${this.count} ===`;
|
|
182
|
+
});
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
what really happens is still dependency tracking through Vue’s computed system.
|
|
186
|
+
|
|
187
|
+
### 5. Page-controller route data uses a controller-data update path
|
|
188
|
+
|
|
189
|
+
In:
|
|
190
|
+
|
|
191
|
+
```text
|
|
192
|
+
zova/packages-zova/zova-core/src/bean/beanControllerPageBase.ts
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
page controllers expose page-oriented controller data refresh hooks.
|
|
196
|
+
|
|
197
|
+
Then in:
|
|
198
|
+
|
|
199
|
+
```text
|
|
200
|
+
zova/src/suite-vendor/a-zova/modules/a-router/src/monkey.ts
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
route-aware controller data is prepared, initialized, and updated.
|
|
204
|
+
|
|
205
|
+
That is where page-controller members such as these are maintained:
|
|
206
|
+
|
|
207
|
+
- `$route`
|
|
208
|
+
- `$params`
|
|
209
|
+
- `$query`
|
|
210
|
+
|
|
211
|
+
A practical reading takeaway is:
|
|
212
|
+
|
|
213
|
+
- **page route state is not only pulled ad hoc by the page**
|
|
214
|
+
- **the framework pushes and refreshes route-aware controller data as part of the page-controller runtime path**
|
|
215
|
+
|
|
216
|
+
This is one of the biggest differences a Vue-first reader usually notices.
|
|
217
|
+
|
|
218
|
+
### 6. The component runtime patches render toward the controller/render bean path
|
|
219
|
+
|
|
220
|
+
In:
|
|
221
|
+
|
|
222
|
+
```text
|
|
223
|
+
zova/packages-zova/zova-core/src/core/context/component.ts
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Zova patches the component instance render method so the effective render flow becomes controller-oriented.
|
|
227
|
+
|
|
228
|
+
That is why the framework can support these patterns consistently:
|
|
229
|
+
|
|
230
|
+
- render directly inside the controller
|
|
231
|
+
- split render into a dedicated render bean later
|
|
232
|
+
- keep the higher-level page/component authoring model stable while the implementation grows
|
|
233
|
+
|
|
234
|
+
A practical reading takeaway is:
|
|
235
|
+
|
|
236
|
+
- **render is not treated as only a local component-file concern**
|
|
237
|
+
- **render is part of the controller/bean architecture**
|
|
238
|
+
|
|
239
|
+
### 7. Field mutation becomes normal reactive invalidation and rerender
|
|
240
|
+
|
|
241
|
+
Once the controller bean is reactive and render has read its fields, changes such as:
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
this.count++;
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
behave the way a Vue reader would expect at the reactive-engine level:
|
|
248
|
+
|
|
249
|
+
- the field change invalidates dependencies
|
|
250
|
+
- computed values depending on that field are recomputed
|
|
251
|
+
- the next render sees the updated values
|
|
252
|
+
|
|
253
|
+
So the runtime behavior is still recognizably Vue-like.
|
|
254
|
+
|
|
255
|
+
The architectural surface is what changed.
|
|
256
|
+
|
|
257
|
+
## A compact call-flow sketch
|
|
258
|
+
|
|
259
|
+
```text
|
|
260
|
+
useControllerPage(...)
|
|
261
|
+
-> _useController(...)
|
|
262
|
+
-> ctx.bean._newBeanInner(..., markReactive = true)
|
|
263
|
+
-> BeanContainer creates controller bean
|
|
264
|
+
-> BeanContainer applies reactive(...)
|
|
265
|
+
-> controller __init__ wires $computed / $watch helpers
|
|
266
|
+
-> component render is patched toward controller/render bean
|
|
267
|
+
-> render-time controller data update refreshes page route data
|
|
268
|
+
-> render reads controller fields
|
|
269
|
+
-> field mutation invalidates dependencies
|
|
270
|
+
-> rerender produces updated UI
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Use this sketch as the durable mental model even if lower-level implementation details evolve over time.
|
|
274
|
+
|
|
275
|
+
## What is stable vs what is implementation detail
|
|
276
|
+
|
|
277
|
+
### Stable public architectural idea
|
|
278
|
+
|
|
279
|
+
The following ideas are durable and should guide how you read and extend Zova code:
|
|
280
|
+
|
|
281
|
+
- controller and bean instances are first-class authoring surfaces
|
|
282
|
+
- Vue reactivity is still the foundation underneath
|
|
283
|
+
- bean lifecycle and IoC scope are central to the architecture
|
|
284
|
+
- render flow is controller-oriented
|
|
285
|
+
- route-aware page state is part of the page-controller surface
|
|
286
|
+
|
|
287
|
+
### More implementation-shaped detail
|
|
288
|
+
|
|
289
|
+
The following details are helpful for source reading, but are not the main public design lesson:
|
|
290
|
+
|
|
291
|
+
- the exact internal helper names
|
|
292
|
+
- the exact order of intermediate load helpers
|
|
293
|
+
- the exact proxy or monkey hook boundaries used by the runtime
|
|
294
|
+
- the exact render patch mechanics inside the component context implementation
|
|
295
|
+
|
|
296
|
+
This distinction matters because public docs should teach the durable model first, then use source details only to clarify that model.
|
|
297
|
+
|
|
298
|
+
## When to use this page
|
|
299
|
+
|
|
300
|
+
Use this page when:
|
|
301
|
+
|
|
302
|
+
- you already understand the public Zova architecture but want to trace the runtime source path
|
|
303
|
+
- you need to debug why a page controller field updates the UI
|
|
304
|
+
- you need to understand where route state is refreshed before render
|
|
305
|
+
- you are deciding whether a change belongs in controller authoring, bean lifecycle, route synchronization, or render-flow plumbing
|
|
306
|
+
|
|
307
|
+
If you are still learning the public mental model first, start with:
|
|
308
|
+
|
|
309
|
+
- [Reading Zova for Vue Developers](/frontend/reading-zova-for-vue-developers)
|
|
310
|
+
- [Design Principles](/frontend/design-principles)
|
|
311
|
+
- [IoC and Beans](/frontend/ioc-and-beans)
|
|
312
|
+
- [Page Guide](/frontend/page-guide)
|
|
313
|
+
|
|
314
|
+
## Final takeaway
|
|
315
|
+
|
|
316
|
+
The most important source-reading insight is simple:
|
|
317
|
+
|
|
318
|
+
> Zova does not remove Vue reactivity. It relocates the business-facing reactive surface from local reactive primitives toward framework-managed reactive bean instances.
|
|
319
|
+
|
|
320
|
+
Once that clicks, the rest of the controller, render-bean, route, and lifecycle design becomes much easier to follow.
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
# Zova Source Reading Map
|
|
2
|
+
|
|
3
|
+
This page is a practical map for contributors and AI workflows that need to read Zova source code efficiently.
|
|
4
|
+
|
|
5
|
+
It does not try to teach every subsystem from scratch. Instead, it answers a narrower question:
|
|
6
|
+
|
|
7
|
+
> when I need to understand one kind of Zova frontend behavior, which files should I read first, and in what order?
|
|
8
|
+
|
|
9
|
+
Use this page together with the architectural guides:
|
|
10
|
+
|
|
11
|
+
- [Foundation](/frontend/foundation)
|
|
12
|
+
- [Design Principles](/frontend/design-principles)
|
|
13
|
+
- [IoC and Beans](/frontend/ioc-and-beans)
|
|
14
|
+
- [Reading Zova for Vue Developers](/frontend/reading-zova-for-vue-developers)
|
|
15
|
+
- [Zova Reactivity Under the Hood](/frontend/zova-reactivity-under-the-hood)
|
|
16
|
+
|
|
17
|
+
## Why this page exists
|
|
18
|
+
|
|
19
|
+
In a framework-sized codebase, source reading usually becomes slow for one reason:
|
|
20
|
+
|
|
21
|
+
- you can already find *a* relevant file
|
|
22
|
+
- but you do not yet know the shortest path to the *next* file
|
|
23
|
+
|
|
24
|
+
Zova especially benefits from a reading map because several layers cooperate at once:
|
|
25
|
+
|
|
26
|
+
- public wrappers and generated surfaces
|
|
27
|
+
- controller or bean authoring surfaces
|
|
28
|
+
- container and lifecycle runtime
|
|
29
|
+
- route or SSR integration
|
|
30
|
+
- module and suite boundaries
|
|
31
|
+
|
|
32
|
+
This page gives a starting sequence for each major topic so readers can move from public surface to runtime layer without drifting.
|
|
33
|
+
|
|
34
|
+
## How to use this page
|
|
35
|
+
|
|
36
|
+
For each topic below:
|
|
37
|
+
|
|
38
|
+
1. start with the public guide to refresh the architectural intent
|
|
39
|
+
2. read the first source file to identify the public surface
|
|
40
|
+
3. continue into the next runtime file only if you still need the implementation detail
|
|
41
|
+
4. stop as soon as you have enough information for the task
|
|
42
|
+
|
|
43
|
+
The goal is not to read the entire framework every time. The goal is to choose the shortest accurate path.
|
|
44
|
+
|
|
45
|
+
## 1. Page controller and page reactivity
|
|
46
|
+
|
|
47
|
+
Use this path when you are asking questions like:
|
|
48
|
+
|
|
49
|
+
- why does a plain page-controller field update the UI?
|
|
50
|
+
- where do `$params` and `$query` come from?
|
|
51
|
+
- how does page render enter the runtime?
|
|
52
|
+
|
|
53
|
+
### Read the docs first
|
|
54
|
+
|
|
55
|
+
- [Page Guide](/frontend/page-guide)
|
|
56
|
+
- [Reading Zova for Vue Developers](/frontend/reading-zova-for-vue-developers)
|
|
57
|
+
- [Zova Reactivity Under the Hood](/frontend/zova-reactivity-under-the-hood)
|
|
58
|
+
|
|
59
|
+
### Then read source in this order
|
|
60
|
+
|
|
61
|
+
1. `zova/src/suite/a-demo/modules/demo-basic/src/page/state/controller.tsx`
|
|
62
|
+
2. `zova/packages-zova/zova-core/src/composables/useController.ts`
|
|
63
|
+
3. `zova/packages-zova/zova-core/src/bean/beanContainer.ts`
|
|
64
|
+
4. `zova/packages-zova/zova-core/src/bean/beanBase.ts`
|
|
65
|
+
5. `zova/packages-zova/zova-core/src/bean/beanControllerPageBase.ts`
|
|
66
|
+
6. `zova/packages-zova/zova-core/src/core/context/component.ts`
|
|
67
|
+
7. `zova/src/suite-vendor/a-zova/modules/a-router/src/monkey.ts`
|
|
68
|
+
|
|
69
|
+
### What each file clarifies
|
|
70
|
+
|
|
71
|
+
- `controller.tsx` shows the public authoring pattern
|
|
72
|
+
- `useController.ts` shows controller creation and load timing
|
|
73
|
+
- `beanContainer.ts` shows when beans become reactive and context-managed
|
|
74
|
+
- `beanBase.ts` shows helper wrappers such as `$computed` and `$watch`
|
|
75
|
+
- `beanControllerPageBase.ts` shows page-controller data-refresh hooks
|
|
76
|
+
- `component.ts` shows controller-oriented render redirection
|
|
77
|
+
- `a-router/src/monkey.ts` shows how route-aware state is pushed onto the controller
|
|
78
|
+
|
|
79
|
+
## 2. Component controller and component wrapper behavior
|
|
80
|
+
|
|
81
|
+
Use this path when you are asking questions like:
|
|
82
|
+
|
|
83
|
+
- how do Z-prefixed wrapper components fit into the runtime?
|
|
84
|
+
- how does `controllerRef` expose the controller instance?
|
|
85
|
+
- how do component controllers differ from page controllers?
|
|
86
|
+
|
|
87
|
+
### Read the docs first
|
|
88
|
+
|
|
89
|
+
- [Component Guide](/frontend/component-guide)
|
|
90
|
+
- [IoC and Beans](/frontend/ioc-and-beans)
|
|
91
|
+
- [Reading Zova for Vue Developers](/frontend/reading-zova-for-vue-developers)
|
|
92
|
+
|
|
93
|
+
### Then read source in this order
|
|
94
|
+
|
|
95
|
+
1. a representative component metadata wrapper under `src/.metadata/component/*.ts`
|
|
96
|
+
2. `zova/packages-zova/zova-core/src/composables/useController.ts`
|
|
97
|
+
3. `zova/packages-zova/zova-core/src/bean/beanControllerBase.ts`
|
|
98
|
+
4. `zova/packages-zova/zova-core/src/core/context/component.ts`
|
|
99
|
+
5. the component controller source you are actually analyzing
|
|
100
|
+
|
|
101
|
+
### What each file clarifies
|
|
102
|
+
|
|
103
|
+
- metadata wrapper files show how the public component wrapper enters `useController(...)`
|
|
104
|
+
- `useController.ts` shows how component-local controller data is prepared
|
|
105
|
+
- `beanControllerBase.ts` shows component-controller data refresh rules such as props updates
|
|
106
|
+
- `component.ts` shows how render is patched toward controller/render beans
|
|
107
|
+
- the concrete component controller shows the public authoring pattern for the case you care about
|
|
108
|
+
|
|
109
|
+
## 3. Bean lifecycle, instance scope, and helper APIs
|
|
110
|
+
|
|
111
|
+
Use this path when you are asking questions like:
|
|
112
|
+
|
|
113
|
+
- where should reactive setup happen?
|
|
114
|
+
- what is the role of `__init__` and `__dispose__`?
|
|
115
|
+
- how are helpers such as `$watch`, `$toRef`, or `$customRef` exposed?
|
|
116
|
+
|
|
117
|
+
### Read the docs first
|
|
118
|
+
|
|
119
|
+
- [IoC and Beans](/frontend/ioc-and-beans)
|
|
120
|
+
- [Design Principles](/frontend/design-principles)
|
|
121
|
+
|
|
122
|
+
### Then read source in this order
|
|
123
|
+
|
|
124
|
+
1. `zova/packages-zova/zova-core/src/bean/beanBase.ts`
|
|
125
|
+
2. `zova/packages-zova/zova-core/src/bean/beanBaseSimple.ts`
|
|
126
|
+
3. `zova/packages-zova/zova-core/src/bean/beanContainer.ts`
|
|
127
|
+
4. `zova/packages-zova/zova-core/src/core/context/util.ts`
|
|
128
|
+
|
|
129
|
+
### What each file clarifies
|
|
130
|
+
|
|
131
|
+
- `beanBase.ts` shows the main helper surface available to beans
|
|
132
|
+
- `beanBaseSimple.ts` shows the lower-level bean identity/base surface
|
|
133
|
+
- `beanContainer.ts` shows init, inject, and dispose flow
|
|
134
|
+
- `context/util.ts` shows how instance scope is applied around framework operations
|
|
135
|
+
|
|
136
|
+
## 4. Page routing, params, query, and layout-oriented route behavior
|
|
137
|
+
|
|
138
|
+
Use this path when you are asking questions like:
|
|
139
|
+
|
|
140
|
+
- where are typed params/query resolved?
|
|
141
|
+
- how does a route record connect to a page wrapper?
|
|
142
|
+
- where should route-aware page changes be debugged?
|
|
143
|
+
|
|
144
|
+
### Read the docs first
|
|
145
|
+
|
|
146
|
+
- [Page Route Guide](/frontend/page-route-guide)
|
|
147
|
+
- [Page Params Guide](/frontend/page-params-guide)
|
|
148
|
+
- [Page Query Guide](/frontend/page-query-guide)
|
|
149
|
+
- [Navigation Guards Guide](/frontend/navigation-guards-guide)
|
|
150
|
+
|
|
151
|
+
### Then read source in this order
|
|
152
|
+
|
|
153
|
+
1. the page `routes.ts` file for the module you care about
|
|
154
|
+
2. `zova/src/suite-vendor/a-zova/modules/a-router/src/monkey.ts`
|
|
155
|
+
3. `zova/src/suite-vendor/a-zova/modules/a-router/src/lib/utils.ts`
|
|
156
|
+
4. the relevant route schema metadata or module page schema source
|
|
157
|
+
5. `zova/packages-zova/zova-core/src/bean/beanControllerPageBase.ts`
|
|
158
|
+
|
|
159
|
+
### What each file clarifies
|
|
160
|
+
|
|
161
|
+
- route files show the public route declaration surface
|
|
162
|
+
- `monkey.ts` shows controller data prepare/init/update behavior
|
|
163
|
+
- route utils show how current/page route resolution is derived
|
|
164
|
+
- route schema sources show typed parsing behavior for params and query
|
|
165
|
+
- `beanControllerPageBase.ts` shows the page-controller refresh hook surface
|
|
166
|
+
|
|
167
|
+
## 5. Model state, cache-oriented state, and broader data ownership
|
|
168
|
+
|
|
169
|
+
Use this path when you are asking questions like:
|
|
170
|
+
|
|
171
|
+
- should this state live in a model bean?
|
|
172
|
+
- how does Zova unify async and sync state categories?
|
|
173
|
+
- where should I debug model-owned state instead of controller-owned state?
|
|
174
|
+
|
|
175
|
+
### Read the docs first
|
|
176
|
+
|
|
177
|
+
- [Model Architecture](/frontend/model-architecture)
|
|
178
|
+
- [Model State Guide](/frontend/model-state-guide)
|
|
179
|
+
- [Design Principles](/frontend/design-principles)
|
|
180
|
+
|
|
181
|
+
### Then read source in this order
|
|
182
|
+
|
|
183
|
+
1. the relevant model bean in the module you are studying
|
|
184
|
+
2. `zova/src/suite-vendor/a-zova/modules/a-model/src/bean/bean.model/bean.model.useState.ts`
|
|
185
|
+
3. representative built-in model beans such as router tabs or resource models
|
|
186
|
+
4. nearby state-owner service/controller code that consumes the model
|
|
187
|
+
|
|
188
|
+
### What each file clarifies
|
|
189
|
+
|
|
190
|
+
- the local model bean shows the public business-facing ownership pattern
|
|
191
|
+
- `bean.model.useState.ts` shows framework-level state helper behavior
|
|
192
|
+
- built-in model beans show how the architecture is used in nontrivial cases
|
|
193
|
+
- consuming code shows whether the state really belongs in the model or only uses the model result
|
|
194
|
+
|
|
195
|
+
## 6. Command scene and command-bean invocation
|
|
196
|
+
|
|
197
|
+
Use this path when you are asking questions like:
|
|
198
|
+
|
|
199
|
+
- how does `$performCommand(...)` resolve a command bean?
|
|
200
|
+
- when should an action live in a command bean instead of a page/controller method?
|
|
201
|
+
- where do command names, helper bases, and generated command typing come from?
|
|
202
|
+
|
|
203
|
+
### Read the docs first
|
|
204
|
+
|
|
205
|
+
- [Command Scene Authoring](/frontend/command-scene-authoring)
|
|
206
|
+
- [IoC and Beans](/frontend/ioc-and-beans)
|
|
207
|
+
- [Frontend CLI](/frontend/cli)
|
|
208
|
+
|
|
209
|
+
### Then read source in this order
|
|
210
|
+
|
|
211
|
+
1. `zova/src/suite-vendor/a-zova/modules/a-command/src/lib/command.ts`
|
|
212
|
+
2. `zova/src/suite-vendor/a-zova/modules/a-command/src/monkey.ts`
|
|
213
|
+
3. `zova/src/suite-vendor/a-zova/modules/a-command/src/lib/performCommand.ts`
|
|
214
|
+
4. `zova/src/suite-vendor/a-zova/modules/a-command/src/types/command.ts`
|
|
215
|
+
5. one generated downstream metadata file such as `zova/src/suite/cabloy-basic/modules/basic-commands/src/.metadata/index.ts`
|
|
216
|
+
6. representative command beans such as `command.create.tsx`, `command.delete.tsx`, `command.setValue.tsx`, or `command.log.tsx`
|
|
217
|
+
|
|
218
|
+
### What each file clarifies
|
|
219
|
+
|
|
220
|
+
- `command.ts` shows the public decorator surface and confirms the `sys` container scope
|
|
221
|
+
- `monkey.ts` shows how `$performCommand(...)` is injected onto bean instances and how default `renderContext` data is synthesized from the host bean
|
|
222
|
+
- `performCommand.ts` shows onion-name to bean resolution, sync-first then async bean loading, option merging, and command execution
|
|
223
|
+
- `types/command.ts` shows the command-scene type contract, including `ICommandRecord`, `IDecoratorCommandOptions`, and `SymbolCommandResult`
|
|
224
|
+
- generated downstream metadata shows the real command names and bean full names exposed by consuming modules
|
|
225
|
+
- representative command beans show when to use the plain, bulk, row, or scene-sensitive command shapes
|
|
226
|
+
|
|
227
|
+
## 7. Behavior scene and render-time interception
|
|
228
|
+
|
|
229
|
+
Use this path when you are asking questions like:
|
|
230
|
+
|
|
231
|
+
- should this concern be a Behavior, a Component, or a Helper?
|
|
232
|
+
- how do behaviors wrap render targets?
|
|
233
|
+
- where does the behavior pipeline actually compose?
|
|
234
|
+
|
|
235
|
+
### Read the docs first
|
|
236
|
+
|
|
237
|
+
- [Behavior Guide](/frontend/behavior-guide)
|
|
238
|
+
- [IoC and Beans](/frontend/ioc-and-beans)
|
|
239
|
+
|
|
240
|
+
### Then read source in this order
|
|
241
|
+
|
|
242
|
+
1. the public behavior wrapper and controller path referenced in the docs
|
|
243
|
+
2. the concrete behavior bean you are studying
|
|
244
|
+
3. the composer/service files used by the behavior scene
|
|
245
|
+
4. any host-injected controller or bean that the behavior depends on
|
|
246
|
+
|
|
247
|
+
### What each file clarifies
|
|
248
|
+
|
|
249
|
+
- wrapper/controller files show the public entry into the behavior system
|
|
250
|
+
- concrete behavior beans show authoring-time render interception
|
|
251
|
+
- composer/service files show how behavior chains are normalized and executed
|
|
252
|
+
- host dependencies show why host-scoped injection is part of the behavior design
|
|
253
|
+
|
|
254
|
+
## 8. SSR runtime and hydration handoff
|
|
255
|
+
|
|
256
|
+
Use this path when you are asking questions like:
|
|
257
|
+
|
|
258
|
+
- is this SSR issue owned by Vona or Zova?
|
|
259
|
+
- where does the frontend SSR runtime begin?
|
|
260
|
+
- where should hydration-sensitive debugging start?
|
|
261
|
+
|
|
262
|
+
### Read the docs first
|
|
263
|
+
|
|
264
|
+
- [SSR Architecture Overview](/frontend/ssr-architecture-overview)
|
|
265
|
+
- [SSR Overview](/frontend/ssr-overview)
|
|
266
|
+
- [SSR Init Data](/frontend/ssr-init-data)
|
|
267
|
+
- [SSR Troubleshooting Guide](/frontend/ssr-troubleshooting-guide)
|
|
268
|
+
|
|
269
|
+
### Then read source in this order
|
|
270
|
+
|
|
271
|
+
1. the frontend SSR site entry or generated SSR bundle entry for the affected app/site
|
|
272
|
+
2. the SSR-related context/runtime files in `zova-core`
|
|
273
|
+
3. the relevant page/controller/model code whose output differs between server and client
|
|
274
|
+
4. if needed, the Vona SSR integration layer for the site entry and request handoff
|
|
275
|
+
|
|
276
|
+
### What each file clarifies
|
|
277
|
+
|
|
278
|
+
- SSR entry files show where the frontend runtime starts during SSR
|
|
279
|
+
- SSR runtime/context files show how render context and state transfer are assembled
|
|
280
|
+
- page/controller/model files show whether the bug is actually page-level logic
|
|
281
|
+
- the Vona side shows whether the problem happens before the Zova runtime is even entered
|
|
282
|
+
|
|
283
|
+
## 9. Modules, suites, and architectural placement
|
|
284
|
+
|
|
285
|
+
Use this path when you are asking questions like:
|
|
286
|
+
|
|
287
|
+
- where should new frontend code live?
|
|
288
|
+
- does this belong in an existing module, a new module, or a different suite?
|
|
289
|
+
- which source-tree boundary expresses the intended business architecture?
|
|
290
|
+
|
|
291
|
+
### Read the docs first
|
|
292
|
+
|
|
293
|
+
- [Modules and Suites](/frontend/modules-and-suites)
|
|
294
|
+
- [Module Scope](/frontend/module-scope)
|
|
295
|
+
- [Frontend Directory Structure](/reference/frontend-directory-structure)
|
|
296
|
+
|
|
297
|
+
### Then read source in this order
|
|
298
|
+
|
|
299
|
+
1. the nearby suite/module layout under `zova/src/suite*`
|
|
300
|
+
2. the target module `package.json` and metadata if relevant
|
|
301
|
+
3. representative peer modules in the same suite
|
|
302
|
+
4. only then the exact controller/component/model/service file you intend to change
|
|
303
|
+
|
|
304
|
+
### What each file clarifies
|
|
305
|
+
|
|
306
|
+
- source-tree layout shows the real architectural neighborhood
|
|
307
|
+
- module metadata shows naming, dependencies, and bundle-related declarations
|
|
308
|
+
- peer modules show current placement conventions
|
|
309
|
+
- the final target file then makes sense inside the correct architectural boundary
|
|
310
|
+
|
|
311
|
+
## A compact reading strategy
|
|
312
|
+
|
|
313
|
+
When in doubt, use this sequence:
|
|
314
|
+
|
|
315
|
+
1. public guide
|
|
316
|
+
2. representative example in app/module code
|
|
317
|
+
3. public wrapper or controller entrypoint
|
|
318
|
+
4. bean/container/runtime source
|
|
319
|
+
5. integration layer such as router, behavior, model, or SSR
|
|
320
|
+
|
|
321
|
+
That order usually gets you to the answer faster than starting from deep runtime files first.
|
|
322
|
+
|
|
323
|
+
## Final takeaway
|
|
324
|
+
|
|
325
|
+
The fastest way to read Zova source accurately is not to memorize every core file.
|
|
326
|
+
|
|
327
|
+
It is to recognize which architectural topic you are in, then start from the smallest public surface that matches that topic and only descend into runtime files as needed.
|