annil 1.5.9 → 1.5.11
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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/computedUpdater.d.ts +6 -0
- package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/computedUpdater.js +3 -3
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/computedUpdater.js.map +1 -0
- package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/data-tracer.d.ts +1 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/data-tracer.js.map +1 -0
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/getPathsValue.js.map +1 -0
- package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/getPropertiesValue.d.ts +1 -1
- package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/getPropertiesValue.js +1 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/getPropertiesValue.js.map +1 -0
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/index.d.ts +2 -0
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/index.js +50 -0
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/index.js.map +1 -0
- package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/initComputed.d.ts +8 -5
- package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/initComputed.js +1 -1
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/initComputed.js.map +1 -0
- package/dist/api/DefineComponent/assignOptions/computedWatchHandle/isEqual.js.map +1 -0
- package/dist/api/DefineComponent/assignOptions/index.d.ts +48 -0
- package/dist/api/DefineComponent/{collectOptionsForComponent.js → assignOptions/index.js} +34 -23
- package/dist/api/DefineComponent/assignOptions/index.js.map +1 -0
- package/dist/api/DefineComponent/assignOptions/initStore/index.d.ts +2 -0
- package/dist/api/DefineComponent/assignOptions/initStore/index.js +12 -0
- package/dist/api/DefineComponent/assignOptions/initStore/index.js.map +1 -0
- package/dist/api/DefineComponent/index.d.ts +1 -1
- package/dist/api/DefineComponent/index.js +2 -2
- package/dist/api/DefineComponent/index.js.map +1 -1
- package/dist/api/RootComponent/Lifetimes/LifetimesConstraint.d.ts +1 -1
- package/dist/api/RootComponent/Observers/ObserversOption.d.ts +1 -1
- package/dist/behaviors/BStore.js +2 -14
- package/dist/behaviors/BStore.js.map +1 -1
- package/dist/utils/deepClone.js.map +1 -1
- package/package.json +1 -1
- package/src/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/computedUpdater.ts +6 -5
- package/src/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/data-tracer.ts +1 -1
- package/src/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/getPropertiesValue.ts +3 -5
- package/src/api/DefineComponent/assignOptions/computedWatchHandle/index.ts +79 -0
- package/src/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/initComputed.ts +13 -8
- package/src/api/DefineComponent/{collectOptionsForComponent.ts → assignOptions/index.ts} +104 -59
- package/src/api/DefineComponent/assignOptions/initStore/index.ts +16 -0
- package/src/api/DefineComponent/index.ts +3 -6
- package/src/api/RootComponent/Lifetimes/LifetimesConstraint.ts +1 -1
- package/src/api/RootComponent/Observers/ObserversOption.ts +2 -2
- package/src/behaviors/BStore.ts +5 -22
- package/src/behaviors/BbeforeCreated.ts +1 -1
- package/src/utils/deepClone.ts +1 -2
- package/dist/api/DefineComponent/collectOptionsForComponent.d.ts +0 -31
- package/dist/api/DefineComponent/collectOptionsForComponent.js.map +0 -1
- package/dist/behaviors/BComputedAndWatch/computedUpdater.d.ts +0 -2
- package/dist/behaviors/BComputedAndWatch/computedUpdater.js.map +0 -1
- package/dist/behaviors/BComputedAndWatch/data-tracer.js.map +0 -1
- package/dist/behaviors/BComputedAndWatch/getPathsValue.js.map +0 -1
- package/dist/behaviors/BComputedAndWatch/getPropertiesValue.js.map +0 -1
- package/dist/behaviors/BComputedAndWatch/index.d.ts +0 -1
- package/dist/behaviors/BComputedAndWatch/index.js +0 -85
- package/dist/behaviors/BComputedAndWatch/index.js.map +0 -1
- package/dist/behaviors/BComputedAndWatch/initComputed.js.map +0 -1
- package/dist/behaviors/BComputedAndWatch/isEqual.js.map +0 -1
- package/dist/behaviors/BComputedAndWatch/types.d.ts +0 -24
- package/dist/behaviors/BComputedAndWatch/types.js +0 -2
- package/dist/behaviors/BComputedAndWatch/types.js.map +0 -1
- package/dist/utils/deleteProtoField.d.ts +0 -1
- package/dist/utils/deleteProtoField.js +0 -4
- package/dist/utils/deleteProtoField.js.map +0 -1
- package/src/behaviors/BComputedAndWatch/index.ts +0 -135
- package/src/behaviors/BComputedAndWatch/types.ts +0 -30
- package/src/utils/deleteProtoField.ts +0 -6
- /package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/data-tracer.js +0 -0
- /package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/getPathsValue.d.ts +0 -0
- /package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/getPathsValue.js +0 -0
- /package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/isEqual.d.ts +0 -0
- /package/dist/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/isEqual.js +0 -0
- /package/src/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/getPathsValue.ts +0 -0
- /package/src/{behaviors/BComputedAndWatch → api/DefineComponent/assignOptions/computedWatchHandle}/isEqual.ts +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Func } from "hry-types/src/Misc/Func";
|
|
2
|
+
import { computedUpdater } from "./computedUpdater";
|
|
3
|
+
import { getPathsValue } from "./getPathsValue";
|
|
4
|
+
import { getPropertiesValue } from "./getPropertiesValue";
|
|
5
|
+
import { initComputed } from "./initComputed";
|
|
6
|
+
import { isEqual } from "./isEqual";
|
|
7
|
+
|
|
8
|
+
import { deepClone } from "../../../../utils/deepClone";
|
|
9
|
+
import { isEmptyObject } from "../../../../utils/isEmptyObject";
|
|
10
|
+
import type { FinalOptionsOfComponent, Instance } from "..";
|
|
11
|
+
|
|
12
|
+
type WatchOldValue = Record<string, unknown[]>;
|
|
13
|
+
|
|
14
|
+
function initWatchOldValue(data: FinalOptionsOfComponent["data"], watchConfig: object): WatchOldValue {
|
|
15
|
+
const watchOldValue = {};
|
|
16
|
+
for (const key in watchConfig) {
|
|
17
|
+
// watchOldValue[key] = deepClone(getPathsValue(data, key));
|
|
18
|
+
|
|
19
|
+
// watchOldValue[key] = getPathsValue(data, key);
|
|
20
|
+
|
|
21
|
+
// @ts-ignore 隐式索引
|
|
22
|
+
watchOldValue[key] = deepClone(getPathsValue(data, key));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return watchOldValue;
|
|
26
|
+
}
|
|
27
|
+
export function computedWatchHandle(options: FinalOptionsOfComponent) {
|
|
28
|
+
// 计算属性初始化
|
|
29
|
+
const computedConfig = options.computed;
|
|
30
|
+
const rawPropertiesValue = getPropertiesValue(options.properties);
|
|
31
|
+
if (computedConfig && !isEmptyObject(computedConfig)) {
|
|
32
|
+
// 此时store已经初始化数据到data了
|
|
33
|
+
|
|
34
|
+
const __computedInitCache__ = initComputed(options, computedConfig, { ...options.data, ...rawPropertiesValue });
|
|
35
|
+
|
|
36
|
+
options.data.__computedCache__ = __computedInitCache__;
|
|
37
|
+
|
|
38
|
+
options.methods.__computedUpdater__ = computedUpdater;
|
|
39
|
+
// // 把计算属性缓存从方法中带入到实例中,在created周期加入实例后删除
|
|
40
|
+
// methodOpt.__computedInitCache__ = () => computedCache;
|
|
41
|
+
}
|
|
42
|
+
const observersConfig = options.observers;
|
|
43
|
+
// 通过observers加入`**`字段来触发计算属性更新
|
|
44
|
+
const originalFunc = observersConfig["**"] as Func | undefined;
|
|
45
|
+
|
|
46
|
+
observersConfig["**"] = function(this: Instance): undefined {
|
|
47
|
+
this.__computedUpdater__?.();
|
|
48
|
+
|
|
49
|
+
originalFunc && originalFunc.call(this);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// watch handle
|
|
53
|
+
const watchConfig = options.watch;
|
|
54
|
+
|
|
55
|
+
if (watchConfig && !isEmptyObject(watchConfig)) {
|
|
56
|
+
const data = options.data;
|
|
57
|
+
|
|
58
|
+
data.__watchOldValue__ = initWatchOldValue({ ...data, ...rawPropertiesValue }, watchConfig);
|
|
59
|
+
|
|
60
|
+
const observersConfig = options.observers;
|
|
61
|
+
for (const key in watchConfig) {
|
|
62
|
+
const watchHadle = watchConfig[key];
|
|
63
|
+
const originObserversHandle = observersConfig[key] as Func | undefined;
|
|
64
|
+
|
|
65
|
+
// 在监控多个数据时,参数是多个值
|
|
66
|
+
observersConfig[key] = function(this: Instance, ...newValue: unknown[]) {
|
|
67
|
+
originObserversHandle && originObserversHandle.call(this, ...newValue);
|
|
68
|
+
|
|
69
|
+
const watchOldValue = this.data.__watchOldValue__!;
|
|
70
|
+
const oldValue = watchOldValue[key];
|
|
71
|
+
|
|
72
|
+
if (isEqual(newValue, oldValue)) return;
|
|
73
|
+
watchOldValue[key] = deepClone(newValue);
|
|
74
|
+
|
|
75
|
+
watchHadle.call(this, ...newValue, ...oldValue);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
// import type { ComponentInstance } from "../../api/RootComponent/Instance/RootComponentInstance";
|
|
2
|
-
// import type { IsDependOnOthers } from "./data-tracer";
|
|
3
|
-
|
|
4
1
|
import type { Func } from "hry-types/src/Misc/Func";
|
|
5
|
-
import type { FinalOptionsOfComponent } from "
|
|
2
|
+
import type { FinalOptionsOfComponent } from "..";
|
|
3
|
+
|
|
4
|
+
import type { ComputedDependence } from "./computedUpdater";
|
|
6
5
|
import { deepProxy, unwrap } from "./data-tracer";
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
type ItemCache = {
|
|
8
|
+
dependences: ComputedDependence[];
|
|
9
|
+
method: Func;
|
|
10
|
+
value: unknown;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type ComputedCache = Record<string, ItemCache>;
|
|
9
14
|
|
|
10
15
|
/**
|
|
11
16
|
* 如果依赖列表某项的首个字段值为undefined并且字段为其他计算属性字段 返回false(即被依赖的计算字段写在了依赖他的计算字段后面), 否则返回ComputedInfo。
|
|
@@ -97,6 +102,7 @@ export function initComputed(
|
|
|
97
102
|
computedCache: ComputedCache = {},
|
|
98
103
|
): ComputedCache {
|
|
99
104
|
// 收集依赖 uninitedkeys不受内部2处重新赋值的影响
|
|
105
|
+
|
|
100
106
|
for (const key of uninitedkeys) {
|
|
101
107
|
// uninitedkeys 受2处重新赋值的影响
|
|
102
108
|
const itemCache = getItemCache(initAllData, uninitedkeys, computedConfig[key]);
|
|
@@ -108,8 +114,7 @@ export function initComputed(
|
|
|
108
114
|
// 把当前依赖不正确的key放到后面去
|
|
109
115
|
uninitedkeys.push(key);
|
|
110
116
|
} else {
|
|
111
|
-
|
|
112
|
-
const dataOpt = options.data ||= {};
|
|
117
|
+
const dataOpt = options.data;
|
|
113
118
|
|
|
114
119
|
dataOpt[key] = itemCache.value;
|
|
115
120
|
|
|
@@ -1,47 +1,74 @@
|
|
|
1
1
|
import type { Func } from "hry-types/src/Misc/_api";
|
|
2
|
-
import { BBeforeCreate } from "
|
|
3
|
-
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import type { RootComponentTrueOptions } from "../RootComponent";
|
|
13
|
-
import type { ComputedConstraint } from "../RootComponent/Computed/ComputedConstraint";
|
|
2
|
+
import { BBeforeCreate } from "../../../behaviors/BbeforeCreated";
|
|
3
|
+
|
|
4
|
+
import type { Assign } from "../../../types/Assign";
|
|
5
|
+
import type { WMComponent } from "../../../types/OfficialTypeAlias";
|
|
6
|
+
import { deepClone } from "../../../utils/deepClone";
|
|
7
|
+
import { INNERMARKER } from "../../../utils/InnerMarker";
|
|
8
|
+
import { isEmptyObject } from "../../../utils/isEmptyObject";
|
|
9
|
+
import { instanceConfig } from "../../InstanceInject/instanceConfig";
|
|
10
|
+
import type { RootComponentTrueOptions } from "../../RootComponent";
|
|
11
|
+
import type { ComputedConstraint } from "../../RootComponent/Computed/ComputedConstraint";
|
|
14
12
|
import type {
|
|
15
13
|
CustomEventConstraint,
|
|
16
14
|
CustomEvents,
|
|
17
15
|
FullCustomEvents,
|
|
18
|
-
} from "
|
|
19
|
-
import type { DataConstraint } from "
|
|
20
|
-
import type { EventsConstraint } from "
|
|
21
|
-
import type { PageInstance } from "
|
|
22
|
-
import type { LifetimesConstraint } from "
|
|
23
|
-
import type { MethodsConstraint } from "
|
|
24
|
-
import type { PageLifetimesOption } from "
|
|
25
|
-
import type { PropertiesConstraint } from "
|
|
26
|
-
import type { StoreConstraint } from "
|
|
27
|
-
import type { SubComponentTrueOptions } from "
|
|
28
|
-
import type { DefineComponentOption } from "
|
|
16
|
+
} from "../../RootComponent/CustomEvents/CustomEventConstraint";
|
|
17
|
+
import type { DataConstraint } from "../../RootComponent/Data/DataConstraint";
|
|
18
|
+
import type { EventsConstraint } from "../../RootComponent/Events/EventsConstraint";
|
|
19
|
+
import type { ComponentInstance, PageInstance } from "../../RootComponent/Instance/RootComponentInstance";
|
|
20
|
+
import type { LifetimesConstraint } from "../../RootComponent/Lifetimes/LifetimesConstraint";
|
|
21
|
+
import type { MethodsConstraint } from "../../RootComponent/Methods/MethodsConstraint";
|
|
22
|
+
import type { PageLifetimesOption } from "../../RootComponent/PageLifetimes/PageLifetimesOption";
|
|
23
|
+
import type { PropertiesConstraint } from "../../RootComponent/Properties/PropertiesConstraint";
|
|
24
|
+
import type { StoreConstraint } from "../../RootComponent/Store/StoreConstraint";
|
|
25
|
+
import type { SubComponentTrueOptions } from "../../SubComponent";
|
|
26
|
+
import type { DefineComponentOption } from "..";
|
|
27
|
+
|
|
28
|
+
import { BStore } from "../../../behaviors/BStore";
|
|
29
|
+
import { computedWatchHandle } from "./computedWatchHandle";
|
|
30
|
+
|
|
31
|
+
import type { ComputedCache } from "./computedWatchHandle/initComputed";
|
|
32
|
+
import { initStore } from "./initStore";
|
|
33
|
+
|
|
34
|
+
type InstanceInnerFields = {
|
|
35
|
+
data: OptionsInnerFields["data"];
|
|
36
|
+
disposer: Record<string, Func>;
|
|
37
|
+
} & OptionsInnerFields["methods"];
|
|
38
|
+
|
|
39
|
+
export type Instance =
|
|
40
|
+
& (ComponentInstance | PageInstance)
|
|
41
|
+
& InstanceInnerFields;
|
|
42
|
+
|
|
29
43
|
/**
|
|
30
44
|
* 临时的函数配置项
|
|
31
45
|
* 把根组件与子组件中配置类型为函数的相同字段配置收集在一起(数组)
|
|
32
46
|
*/
|
|
33
|
-
export type FuncOptions = Record<"pageLifetimes" | "lifetimes" | "watch", Record<string, Func[]>>;
|
|
47
|
+
export type FuncOptions = Record<"pageLifetimes" | "lifetimes" | "watch" | "observers", Record<string, Func[]>>;
|
|
48
|
+
|
|
49
|
+
export type WatchOldValue = Record<string, unknown[]>;
|
|
50
|
+
|
|
51
|
+
export type OptionsInnerFields = {
|
|
52
|
+
data: {
|
|
53
|
+
__computedCache__?: ComputedCache;
|
|
54
|
+
__storeConfig__?: StoreConstraint;
|
|
55
|
+
__watchOldValue__?: WatchOldValue;
|
|
56
|
+
};
|
|
57
|
+
methods: {
|
|
58
|
+
disposer?: Record<string, Func>;
|
|
59
|
+
// computedHandle加入
|
|
60
|
+
__computedUpdater__?: Func;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
34
63
|
|
|
35
64
|
/**
|
|
36
65
|
* 最终传入原生Component的配置项
|
|
37
66
|
*/
|
|
38
67
|
export type FinalOptionsOfComponent = {
|
|
39
|
-
data: DataConstraint;
|
|
68
|
+
data: DataConstraint & OptionsInnerFields["data"];
|
|
40
69
|
observers: Record<string, Func>;
|
|
41
70
|
behaviors: string[];
|
|
42
|
-
methods: MethodsConstraint &
|
|
43
|
-
__computedInitCache__?: () => ComputedCache;
|
|
44
|
-
};
|
|
71
|
+
methods: MethodsConstraint & OptionsInnerFields["methods"];
|
|
45
72
|
externalClasses: string[];
|
|
46
73
|
pageLifetimes: PageLifetimesOption<false, object>["pageLifetimes"] & {};
|
|
47
74
|
isPage?: boolean;
|
|
@@ -81,7 +108,7 @@ export function isPageCheck(isPage: boolean | undefined) {
|
|
|
81
108
|
* 1. 使用wx.navigateTo传值的。这种情况无内置字段 option[INNERMARKER.url] 等于 undefined
|
|
82
109
|
* 2. 使用插件提供的navigateTo传值。这种情况 INNERMARKER.url被load周期劫持函数解码后赋值INNERMARKER.url字段为本身,即option[INNERMARKER.url] 等于 INNERMARKER.url
|
|
83
110
|
*/
|
|
84
|
-
/* istanbul ignore next
|
|
111
|
+
/* istanbul ignore next miniprogram-simulate(当前版本 1.6.1) 无法测试页面生命周期 */
|
|
85
112
|
function onLoadReceivedDataHandle(
|
|
86
113
|
this: PageInstance,
|
|
87
114
|
option: Record<typeof INNERMARKER.url, string>,
|
|
@@ -107,7 +134,7 @@ function onLoadReceivedDataHandle(
|
|
|
107
134
|
* 针对通过 navigateTo传过来的数据对组件load周期传入数据解析
|
|
108
135
|
* @param option - option中的url是拼接了encodeURIComponent转码的data对象的,key为INNERMARKER.url
|
|
109
136
|
*/
|
|
110
|
-
/* istanbul ignore next
|
|
137
|
+
/* istanbul ignore next miniprogram-simulate(当前版本 1.6.1) 无法测试load */
|
|
111
138
|
function loadReceivedDataHandle(
|
|
112
139
|
this: PageInstance,
|
|
113
140
|
option: Record<typeof INNERMARKER.url, string>,
|
|
@@ -173,7 +200,7 @@ function _funcOptionsHandle(config: object, configList: Record<string, Func[]>)
|
|
|
173
200
|
/**
|
|
174
201
|
* 把函数列表配置放入一个配置中循环一次运行
|
|
175
202
|
*/
|
|
176
|
-
function
|
|
203
|
+
function assignFuncOptions(
|
|
177
204
|
finalOptionsForComponent: FinalOptionsOfComponent,
|
|
178
205
|
isPage: boolean | undefined,
|
|
179
206
|
funcOptions: FuncOptions,
|
|
@@ -198,14 +225,13 @@ function funcFieldsCollect(
|
|
|
198
225
|
options: SubComponentTrueOptions | RootComponentTrueOptions,
|
|
199
226
|
funcOptions: FuncOptions,
|
|
200
227
|
) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
(funcOptions[key][_key] ||= []).push(options[key][_key]);
|
|
228
|
+
let key: keyof FuncOptions;
|
|
229
|
+
for (key in funcOptions) {
|
|
230
|
+
const optionsKeyConfig = options[key];
|
|
231
|
+
if (optionsKeyConfig) {
|
|
232
|
+
for (const _key in optionsKeyConfig) {
|
|
233
|
+
// @ts-ignore
|
|
234
|
+
(funcOptions[key][_key] ||= []).push(optionsKeyConfig[_key]);
|
|
209
235
|
}
|
|
210
236
|
}
|
|
211
237
|
}
|
|
@@ -241,7 +267,7 @@ function otherFieldsHandle(
|
|
|
241
267
|
function eventsHandle(methods: FinalOptionsOfComponent["methods"], eventsConfig: EventsConstraint) {
|
|
242
268
|
Object.assign(methods, eventsConfig);
|
|
243
269
|
}
|
|
244
|
-
function
|
|
270
|
+
function assignSubComponentsOption(
|
|
245
271
|
componentOptions: FinalOptionsOfComponent,
|
|
246
272
|
subComponents: SubComponentTrueOptions[],
|
|
247
273
|
funcOptions: FuncOptions,
|
|
@@ -289,7 +315,7 @@ function customEventsHandle(
|
|
|
289
315
|
* @param funcOptions - 收集特殊配置对象字段
|
|
290
316
|
* @param rootComponentOptions - 被收集的源配置对象
|
|
291
317
|
*/
|
|
292
|
-
function
|
|
318
|
+
function assignRootComponentOption(
|
|
293
319
|
finalOptions: FinalOptionsOfComponent,
|
|
294
320
|
funcOptions: FuncOptions,
|
|
295
321
|
rootComponentOptions: RootComponentTrueOptions,
|
|
@@ -347,20 +373,23 @@ function merge<Target extends object, Source extends object>(target: Target, sou
|
|
|
347
373
|
* @param subComponentsList -
|
|
348
374
|
* @returns FinalOptionsForComponent
|
|
349
375
|
*/
|
|
350
|
-
export function
|
|
376
|
+
export function assignOptions(
|
|
351
377
|
defineComponentOption: DefineComponentOption,
|
|
352
378
|
): FinalOptionsOfComponent {
|
|
353
379
|
const rootComponentOption = defineComponentOption.rootComponent;
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
const finalOptionsForComponent: FinalOptionsOfComponent = merge(
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
380
|
+
const subComponentsOption = defineComponentOption.subComponents;
|
|
381
|
+
// 注入injectInfo和给默认配置(便于后续判断)
|
|
382
|
+
const finalOptionsForComponent: FinalOptionsOfComponent = merge(
|
|
383
|
+
{ ...deepClone(instanceConfig.injectInfo) },
|
|
384
|
+
{
|
|
385
|
+
observers: {},
|
|
386
|
+
data: {},
|
|
387
|
+
methods: {},
|
|
388
|
+
behaviors: [BStore],
|
|
389
|
+
externalClasses: [],
|
|
390
|
+
pageLifetimes: {},
|
|
391
|
+
},
|
|
392
|
+
);
|
|
364
393
|
|
|
365
394
|
/**
|
|
366
395
|
* 有些字段配置同时存在根组件和子组件当中(如pageLifetimes,lifetimes,watch字段), 且key相同值类型为函数。funcConfig对象用于收集这些配置为数组形式,最终再一起整合进finalOptionsForComponent配置中。即funcConfig是一个临时中介对象。
|
|
@@ -369,20 +398,29 @@ export function collectOptionsForComponent(
|
|
|
369
398
|
pageLifetimes: {},
|
|
370
399
|
lifetimes: {},
|
|
371
400
|
watch: {},
|
|
401
|
+
observers: {},
|
|
372
402
|
};
|
|
373
403
|
|
|
374
404
|
if (rootComponentOption && !isEmptyObject(rootComponentOption)) {
|
|
375
|
-
|
|
405
|
+
// 把rootComponentOption配置并入finalOptionsForComponent,其中FuncOptions字段配置收集到funcOptions中
|
|
406
|
+
assignRootComponentOption(finalOptionsForComponent, funcOptions, rootComponentOption);
|
|
376
407
|
}
|
|
377
408
|
|
|
378
|
-
if (
|
|
379
|
-
|
|
409
|
+
if (subComponentsOption && !isEmptyObject(subComponentsOption)) {
|
|
410
|
+
// 把subComponentsList配置并入finalOptionsForComponent,其中FuncOptions字段配置收集到funcOptions中
|
|
411
|
+
assignSubComponentsOption(finalOptionsForComponent, subComponentsOption, funcOptions);
|
|
380
412
|
}
|
|
413
|
+
// 把收集好的funcOptions并入finalOptionsForComponent
|
|
414
|
+
assignFuncOptions(finalOptionsForComponent, rootComponentOption?.isPage, funcOptions);
|
|
381
415
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
InternalFieldProtection(finalOptionsForComponent.methods, ["disposer"]);
|
|
416
|
+
// 配置与内部字段冲突验证
|
|
417
|
+
InternalFieldProtection(finalOptionsForComponent.methods, ["disposer", "__computedUpdater__"]);
|
|
385
418
|
|
|
419
|
+
InternalFieldProtection(finalOptionsForComponent.data, [
|
|
420
|
+
"__computedCache__",
|
|
421
|
+
"__storeConfig__",
|
|
422
|
+
"__watchOldValue__",
|
|
423
|
+
]);
|
|
386
424
|
// 对页面传入参数进行处理 老框架劫持页面methods.onLoad,新框架劫持页面pageLifetimes.load
|
|
387
425
|
|
|
388
426
|
finalOptionsForComponent.isPage
|
|
@@ -394,16 +432,23 @@ export function collectOptionsForComponent(
|
|
|
394
432
|
[onLoadReceivedDataHandle],
|
|
395
433
|
);
|
|
396
434
|
|
|
435
|
+
// 验证isPage字段是否配置正确
|
|
397
436
|
hijack(
|
|
398
437
|
finalOptionsForComponent.lifetimes!,
|
|
399
438
|
"attached",
|
|
400
439
|
[isPageCheck(rootComponentOption?.isPage)],
|
|
401
440
|
);
|
|
402
441
|
|
|
442
|
+
// 页面时删除预设的虚拟组件字段
|
|
403
443
|
finalOptionsForComponent.isPage
|
|
404
|
-
// 页面时删除预设的虚拟组件字段
|
|
405
444
|
&& finalOptionsForComponent.options && Reflect.deleteProperty(finalOptionsForComponent.options, "virtualHost");
|
|
406
445
|
|
|
446
|
+
// 初始化store数据到data并把store配置放入到data的__storeConfig__下
|
|
447
|
+
initStore(finalOptionsForComponent);
|
|
448
|
+
|
|
449
|
+
// 处理computed和watch配置
|
|
450
|
+
computedWatchHandle(finalOptionsForComponent);
|
|
451
|
+
|
|
407
452
|
// BBeforeCreate在最后面,让BeforeCreate生命周期运行在最终建立组件时。
|
|
408
453
|
finalOptionsForComponent.behaviors!.push(BBeforeCreate);
|
|
409
454
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type mobx from "mobx";
|
|
2
|
+
import type { FinalOptionsOfComponent } from "..";
|
|
3
|
+
export function initStore(finalOptionsForComponent: FinalOptionsOfComponent) {
|
|
4
|
+
const storeConfig = finalOptionsForComponent.store;
|
|
5
|
+
if (storeConfig) {
|
|
6
|
+
const { toJS } = require("mobx") as typeof mobx;
|
|
7
|
+
for (const key in storeConfig) {
|
|
8
|
+
finalOptionsForComponent.data[key] = toJS(storeConfig[key]());
|
|
9
|
+
|
|
10
|
+
// 把响应式数据配置保留在methods的__storeConfig__字段下带入到组件实例中(不用函数返回方式也可以,但不符合methods字段类型),后续再从原型上删除。
|
|
11
|
+
}
|
|
12
|
+
finalOptionsForComponent.data.__storeConfig__ = storeConfig;
|
|
13
|
+
|
|
14
|
+
delete finalOptionsForComponent.store;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -9,9 +9,8 @@ import type { RootComponentOption } from "./RootComponent/RootComponentOption";
|
|
|
9
9
|
import type { SubComponentsOption } from "./SubComponents/SubComponentsOption";
|
|
10
10
|
|
|
11
11
|
import type { RootComponentTrueOptions } from "../RootComponent";
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
type Path = `/${string}`;
|
|
12
|
+
import { assignOptions } from "./assignOptions";
|
|
13
|
+
export type Path = `/${string}`;
|
|
15
14
|
|
|
16
15
|
type RootOptions<
|
|
17
16
|
TRootComponentDoc extends RootComponentDoc,
|
|
@@ -53,9 +52,7 @@ export type DefineComponentOption = {
|
|
|
53
52
|
* 把根组件选项和子组件选项转化为原生Component API选项并执行
|
|
54
53
|
*/
|
|
55
54
|
export const DefineComponent: DefineComponentConstructor = function(options): any {
|
|
56
|
-
// console.log("---------------------------");
|
|
57
|
-
|
|
58
55
|
Component(
|
|
59
|
-
|
|
56
|
+
assignOptions(options as DefineComponentOption) as any,
|
|
60
57
|
);
|
|
61
58
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComputeIntersection } from "hry-types/src/Object/ComputeIntersection";
|
|
2
2
|
import type { WMCompLifetimes } from "../../../types/OfficialTypeAlias";
|
|
3
|
-
import type { FinalOptionsOfComponent } from "../../DefineComponent/
|
|
3
|
+
import type { FinalOptionsOfComponent } from "../../DefineComponent/assignOptions";
|
|
4
4
|
|
|
5
5
|
export type LifetimesConstraint = // 官方组件生命周期
|
|
6
6
|
ComputeIntersection<
|
|
@@ -45,8 +45,8 @@ export type ObserversOption<TWatchData extends object, _WatchKeys extends keyof
|
|
|
45
45
|
// 不加NoInfer会导致只监控计算字段时错误
|
|
46
46
|
NoInfer<
|
|
47
47
|
& {
|
|
48
|
-
[k in _WatchKeys]?: (
|
|
49
|
-
newValue: ReadonlyDeep<TWatchData[k]
|
|
48
|
+
[k in _WatchKeys | "**"]?: (
|
|
49
|
+
newValue: k extends keyof TWatchData ? ReadonlyDeep<TWatchData[k]> : unknown,
|
|
50
50
|
) => void;
|
|
51
51
|
}
|
|
52
52
|
// 解决单独书写计算书写字段的报错(或许是:ts字面量约束检测提前计算属性key引起的错误提示)
|
package/src/behaviors/BStore.ts
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
import type mobx from "mobx";
|
|
2
|
-
|
|
3
|
-
import type { FinalOptionsOfComponent } from "../api/DefineComponent/collectOptionsForComponent";
|
|
4
|
-
import { deleteProtoField } from "../utils/deleteProtoField";
|
|
5
|
-
import type { Instance } from "./BComputedAndWatch/types";
|
|
2
|
+
import type { Instance } from "../api/DefineComponent/assignOptions";
|
|
6
3
|
|
|
7
4
|
export const BStore = Behavior({
|
|
8
|
-
// @ts-ignore
|
|
9
|
-
definitionFilter(options: FinalOptionsOfComponent) {
|
|
10
|
-
// 初始化store
|
|
11
|
-
const storeConfig = options.store;
|
|
12
|
-
if (!storeConfig) return;
|
|
13
|
-
const { toJS } = require("mobx") as typeof mobx;
|
|
14
|
-
for (const key in storeConfig) {
|
|
15
|
-
options.data[key] = toJS(storeConfig[key]());
|
|
16
|
-
|
|
17
|
-
// 把响应式数据配置保留在methods的__storeConfig__字段下带入到组件实例中(不用函数返回方式也可以,但不符合methods字段类型),后续再从原型上删除。
|
|
18
|
-
options.methods.__storeConfig__ = () => storeConfig;
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
5
|
lifetimes: {
|
|
22
6
|
created(this: Instance) {
|
|
23
|
-
|
|
24
|
-
const storeConfig = this.__storeConfig__?.();
|
|
7
|
+
const storeConfig = this.data.__storeConfig__;
|
|
25
8
|
if (!storeConfig) return;
|
|
26
|
-
deleteProtoField(this, "__storeConfig__");
|
|
27
9
|
|
|
28
10
|
const { comparer, reaction, toJS } = require("mobx") as typeof mobx;
|
|
29
11
|
|
|
@@ -44,10 +26,11 @@ export const BStore = Behavior({
|
|
|
44
26
|
},
|
|
45
27
|
);
|
|
46
28
|
}
|
|
29
|
+
delete this.data.__storeConfig__;
|
|
47
30
|
},
|
|
48
|
-
|
|
31
|
+
|
|
49
32
|
detached(this: Instance) {
|
|
50
|
-
|
|
33
|
+
/* istanbul ignore next 清除store数据 test中模拟了测试,所以忽略 框架(1.6.1)不支持 issue {@link https://github.com/wechat-miniprogram/miniprogram-simulate/issues/110}*/
|
|
51
34
|
for (const key in this.disposer) {
|
|
52
35
|
this.disposer[key]();
|
|
53
36
|
}
|
package/src/utils/deepClone.ts
CHANGED
|
@@ -5,12 +5,11 @@ export function deepClone<T>(value: T): T {
|
|
|
5
5
|
if (typeof value !== "object" || value === null || value instanceof RegExp) {
|
|
6
6
|
return value;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
const clone = (Array.isArray(value) ? [] : {}) as T;
|
|
10
10
|
|
|
11
11
|
Object.setPrototypeOf(clone, Object.getPrototypeOf(value));
|
|
12
12
|
|
|
13
|
-
/* istanbul ignore next */
|
|
14
13
|
for (const key in value) {
|
|
15
14
|
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
16
15
|
clone[key] = deepClone(value[key]);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Func } from "hry-types/src/Misc/_api";
|
|
2
|
-
import type { ComputedCache, Instance } from "../../behaviors/BComputedAndWatch/types";
|
|
3
|
-
import type { WMComponent } from "../../types/OfficialTypeAlias";
|
|
4
|
-
import type { ComputedConstraint } from "../RootComponent/Computed/ComputedConstraint";
|
|
5
|
-
import type { DataConstraint } from "../RootComponent/Data/DataConstraint";
|
|
6
|
-
import type { LifetimesConstraint } from "../RootComponent/Lifetimes/LifetimesConstraint";
|
|
7
|
-
import type { MethodsConstraint } from "../RootComponent/Methods/MethodsConstraint";
|
|
8
|
-
import type { PageLifetimesOption } from "../RootComponent/PageLifetimes/PageLifetimesOption";
|
|
9
|
-
import type { PropertiesConstraint } from "../RootComponent/Properties/PropertiesConstraint";
|
|
10
|
-
import type { StoreConstraint } from "../RootComponent/Store/StoreConstraint";
|
|
11
|
-
import type { DefineComponentOption } from ".";
|
|
12
|
-
export type FuncOptions = Record<"pageLifetimes" | "lifetimes" | "watch", Record<string, Func[]>>;
|
|
13
|
-
export type FinalOptionsOfComponent = {
|
|
14
|
-
data: DataConstraint;
|
|
15
|
-
observers: Record<string, Func>;
|
|
16
|
-
behaviors: string[];
|
|
17
|
-
methods: MethodsConstraint & {
|
|
18
|
-
__computedInitCache__?: () => ComputedCache;
|
|
19
|
-
};
|
|
20
|
-
externalClasses: string[];
|
|
21
|
-
pageLifetimes: PageLifetimesOption<false, object>["pageLifetimes"] & {};
|
|
22
|
-
isPage?: boolean;
|
|
23
|
-
options?: WMComponent.Options;
|
|
24
|
-
properties?: PropertiesConstraint;
|
|
25
|
-
store?: StoreConstraint;
|
|
26
|
-
computed?: ComputedConstraint;
|
|
27
|
-
watch?: Record<string, Func>;
|
|
28
|
-
lifetimes?: LifetimesConstraint;
|
|
29
|
-
};
|
|
30
|
-
export declare function isPageCheck(isPage: boolean | undefined): (this: Instance) => void;
|
|
31
|
-
export declare function collectOptionsForComponent(defineComponentOption: DefineComponentOption): FinalOptionsOfComponent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collectOptionsForComponent.js","sourceRoot":"","sources":["../../../src/api/DefineComponent/collectOptionsForComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAgDlE,MAAM,UAAU,WAAW,CAAC,MAA2B;IACrD,OAAO;QACL,MAAM,KAAK,GAAI,IAAqB,CAAC,KAA2B,CAAC;QACjE,IAAI,KAAK,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YAE7B,MAAM,KAAK,CACT,OAAO,KAAK,yCAAyC,CACtD,CAAC;QACJ,C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