@mpxjs/core 2.8.31 → 2.8.33

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 CHANGED
@@ -128,6 +128,8 @@ interface ComponentOpt<D, P, C, M, Mi extends Array<any>, S extends Record<any,
128
128
 
129
129
  pageHide?: () => void
130
130
 
131
+ initData?: Record<string, any>
132
+
131
133
  [index: string]: any
132
134
  }
133
135
 
@@ -484,6 +486,8 @@ export function reactive<T extends object> (target: T): Reactive<T>
484
486
 
485
487
  export function isReactive (value: unknown): boolean
486
488
 
489
+ export function markRaw<T extends object>(value: T): T
490
+
487
491
  export function shallowReactive<T extends object> (target: T): ShallowReactive<T>
488
492
 
489
493
  export function computed<T> (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/core",
3
- "version": "2.8.31",
3
+ "version": "2.8.33",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -47,5 +47,5 @@
47
47
  "url": "https://github.com/didi/mpx/issues"
48
48
  },
49
49
  "sideEffects": false,
50
- "gitHead": "00db3e700a9fd0a06ad188c1d9972182cac96db7"
50
+ "gitHead": "6838a99375bfce3ebd8046e86f8806920f4f2b37"
51
51
  }
@@ -132,7 +132,9 @@ function extractObservers (options) {
132
132
  },
133
133
  deep: true,
134
134
  // 延迟触发首次回调,处理转换支付宝时在observer中查询组件的行为,如vant/picker中,如不考虑该特殊情形可用immediate代替
135
- immediateAsync: true
135
+ // immediateAsync: true
136
+ // 为了数据响应的标准化,不再提供immediateAsync选项,之前处理vant等原生组件跨平台转换遇到的问题推荐使用条件编译patch进行处理
137
+ immediate: true
136
138
  })
137
139
  }
138
140
  })
@@ -174,7 +176,9 @@ function extractObservers (options) {
174
176
  }
175
177
  },
176
178
  deep,
177
- immediateAsync: watchProp
179
+ // immediateAsync: watchProp
180
+ // 为了数据响应的标准化,不再提供immediateAsync选项,之前处理vant等原生组件跨平台转换遇到的问题推荐使用条件编译patch进行处理
181
+ immediate: watchProp
178
182
  })
179
183
  }
180
184
  })
@@ -42,7 +42,7 @@ const processWatchOptionsCompat = (options) => {
42
42
  }
43
43
 
44
44
  export function watch (source, cb, options = {}) {
45
- let { immediate, deep, flush, immediateAsync } = processWatchOptionsCompat(options)
45
+ let { immediate, deep, flush } = processWatchOptionsCompat(options)
46
46
  const instance = currentInstance
47
47
  let getter
48
48
  let isMultiSource = false
@@ -139,8 +139,6 @@ export function watch (source, cb, options = {}) {
139
139
  if (cb) {
140
140
  if (immediate) {
141
141
  job()
142
- } else if (immediateAsync) {
143
- queuePreFlushCb(job)
144
142
  } else {
145
143
  oldValue = effect.run()
146
144
  }