@mpxjs/core 2.6.96 → 2.6.102
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/@types/index.d.ts +8 -7
- package/package.json +2 -2
- package/src/convertor/wxToTt.js +0 -8
- package/src/index.js +2 -1
- package/src/observer/scheduler.js +3 -0
package/@types/index.d.ts
CHANGED
|
@@ -93,14 +93,14 @@ interface ObserversDefs {
|
|
|
93
93
|
type GetDataType<T> = T extends () => any ? ReturnType<T> : T
|
|
94
94
|
|
|
95
95
|
type PropValueType<Def> = Def extends {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
96
|
+
type: (...args: any[]) => infer T;
|
|
97
|
+
optionalType?: ((...args: any[]) => infer T)[];
|
|
98
|
+
value?: infer T;
|
|
99
|
+
}
|
|
100
100
|
? T
|
|
101
101
|
: Def extends (...args: any[]) => infer T
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
? T
|
|
103
|
+
: any;
|
|
104
104
|
|
|
105
105
|
type GetPropsType<T> = {
|
|
106
106
|
readonly [K in keyof T]: PropValueType<T[K]>
|
|
@@ -286,7 +286,7 @@ export function createActionsWithThis<S = {}, G = {}, M extends MutationsAndActi
|
|
|
286
286
|
|
|
287
287
|
type MixinType = 'app' | 'page' | 'component'
|
|
288
288
|
|
|
289
|
-
export function injectMixins (mixins: object | Array<object>, options?: {
|
|
289
|
+
export function injectMixins (mixins: object | Array<object>, options?: MixinType | MixinType[] | { types?: MixinType | MixinType[], stage?: number }): void
|
|
290
290
|
|
|
291
291
|
export function watch (expr: string | (() => any), handler: WatchHandler | WatchOptWithHandler, options?: WatchOpt): () => void
|
|
292
292
|
|
|
@@ -304,6 +304,7 @@ interface MpxConfig {
|
|
|
304
304
|
hookErrorHandler: (e: Error, target: ComponentIns<{}, {}, {}, {}, []>, hookName: string) => any | null
|
|
305
305
|
proxyEventHandler: (e: Event) => any | null
|
|
306
306
|
setDataHandler: (data: object, target: ComponentIns<{}, {}, {}, {}, []>) => any | null
|
|
307
|
+
forceRunWatcherSync: boolean
|
|
307
308
|
}
|
|
308
309
|
|
|
309
310
|
type SupportedMode = 'wx' | 'ali' | 'qq' | 'swan' | 'tt' | 'web' | 'qa'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/core",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.102",
|
|
4
4
|
"description": "mpx runtime core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"miniprogram",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"url": "https://github.com/didi/mpx/issues"
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false,
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "377633613e39511e147269e988e3459f50421de5"
|
|
44
44
|
}
|
package/src/convertor/wxToTt.js
CHANGED
|
@@ -10,13 +10,5 @@ export default {
|
|
|
10
10
|
}
|
|
11
11
|
})
|
|
12
12
|
}
|
|
13
|
-
if (options.pageLifetimes && options.pageLifetimes.resize) {
|
|
14
|
-
error(`Options.pageLifetimes.resize is not supported in tt environment!`, global.currentResource)
|
|
15
|
-
delete options.pageLifetimes.resize
|
|
16
|
-
}
|
|
17
|
-
if (options.onResize) {
|
|
18
|
-
error(`Options.onResize is not supported in tt environment!`, global.currentResource)
|
|
19
|
-
delete options.onResize
|
|
20
|
-
}
|
|
21
13
|
}
|
|
22
14
|
}
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { asyncLock } from '../helper/utils'
|
|
2
2
|
import { error } from '../helper/log'
|
|
3
|
+
import EXPORT_MPX from '../index'
|
|
3
4
|
|
|
4
5
|
const queue = []
|
|
5
6
|
let has = {}
|
|
@@ -16,6 +17,8 @@ export function queueWatcher (watcher) {
|
|
|
16
17
|
run: watcher
|
|
17
18
|
}
|
|
18
19
|
}
|
|
20
|
+
// 开启EXPORT_MPX.config.forceRunWatcherSync时,queueWatcher同步执行,便于调试排查问题
|
|
21
|
+
if (EXPORT_MPX.config.forceRunWatcherSync) return watcher.run()
|
|
19
22
|
if (!has[watcher.id] || watcher.id === Infinity) {
|
|
20
23
|
has[watcher.id] = true
|
|
21
24
|
if (!flushing) {
|