@mpxjs/core 2.8.1 → 2.8.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/core",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "main": "src/index.js",
21
21
  "dependencies": {
22
- "@mpxjs/utils": "^2.8.1",
22
+ "@mpxjs/utils": "^2.8.2",
23
23
  "lodash": "^4.1.1",
24
24
  "miniprogram-api-typings": "^3.0.2"
25
25
  },
@@ -47,5 +47,5 @@
47
47
  "url": "https://github.com/didi/mpx/issues"
48
48
  },
49
49
  "sideEffects": false,
50
- "gitHead": "19f21ed57a671536eb1b2e059758118b026bab25"
50
+ "gitHead": "23705e69a1fa13d696316a3593e4f29692fde376"
51
51
  }
@@ -15,7 +15,7 @@ let curType
15
15
  let convertRule
16
16
  let mpxCustomKeysMap
17
17
 
18
- export default function mergeOptions (options = {}, type, needConvert = true) {
18
+ export default function mergeOptions (options = {}, type, needConvert) {
19
19
  // 缓存混合模式下的自定义属性列表
20
20
  mpxCustomKeysMap = makeMap(options.mpxCustomKeysForBlend || [])
21
21
  // needConvert为false,表示衔接原生的root配置,那么此时的配置都是当前原生环境支持的配置,不需要转换
@@ -3,7 +3,7 @@ import mergeOptions from './mergeOptions'
3
3
  import { getConvertMode } from '../convertor/getConvertMode'
4
4
  import { warn, findItem } from '@mpxjs/utils'
5
5
 
6
- export default function transferOptions (options, type) {
6
+ export default function transferOptions (options, type, needConvert = true) {
7
7
  let currentInject
8
8
  if (global.currentInject && global.currentInject.moduleId === global.currentModuleId) {
9
9
  currentInject = global.currentInject
@@ -28,7 +28,7 @@ export default function transferOptions (options, type) {
28
28
  }
29
29
  // 转换mode
30
30
  options.mpxConvertMode = options.mpxConvertMode || getConvertMode(global.currentSrcMode)
31
- const rawOptions = mergeOptions(options, type)
31
+ const rawOptions = mergeOptions(options, type, needConvert)
32
32
 
33
33
  if (currentInject && currentInject.propKeys) {
34
34
  const computedKeys = Object.keys(rawOptions.computed || {})
@@ -1,5 +1,5 @@
1
1
  import { getObserver } from './reactive'
2
- import { def } from '@mpxjs/utils/src/base'
2
+ import { def } from '@mpxjs/utils'
3
3
 
4
4
  const arrayProto = Array.prototype
5
5
 
@@ -4,8 +4,7 @@ import {
4
4
  ONSHOW,
5
5
  ONLOAD
6
6
  } from '../../core/innerLifecycle'
7
- import { isFunction } from '@mpxjs/utils'
8
- import { isBrowser } from '@mpxjs/utils/src/env'
7
+ import { isFunction, isBrowser } from '@mpxjs/utils'
9
8
 
10
9
  let systemInfo = {}
11
10
 
@@ -1,6 +1,5 @@
1
1
  import { CREATED, BEFORECREATE, BEFOREUPDATE, UNMOUNTED } from '../../core/innerLifecycle'
2
- import { noop, error } from '@mpxjs/utils'
3
- import { getEnvObj } from '@mpxjs/utils/src/env'
2
+ import { noop, error, getEnvObj } from '@mpxjs/utils'
4
3
 
5
4
  const envObj = getEnvObj()
6
5
 
@@ -1,8 +1,7 @@
1
1
  import transferOptions from '../core/transferOptions'
2
2
  import mergeOptions from '../core/mergeOptions'
3
3
  import builtInKeysMap from './patch/builtInKeysMap'
4
- import { spreadProp } from '@mpxjs/utils'
5
- import { makeMap } from '@mpxjs/utils/src/array'
4
+ import { makeMap, spreadProp } from '@mpxjs/utils'
6
5
  import * as webLifecycle from '../platform/patch/web/lifecycle'
7
6
  import Mpx from '../index'
8
7
 
@@ -69,7 +68,8 @@ export default function createApp (option, config = {}) {
69
68
  }
70
69
  })
71
70
  }
72
- const { rawOptions } = transferOptions(option, 'app')
71
+ // app选项目前不需要进行转换
72
+ const { rawOptions } = transferOptions(option, 'app', false)
73
73
  rawOptions.mixins = builtInMixins
74
74
  const defaultOptions = filterOptions(spreadProp(mergeOptions(rawOptions, 'app', false), 'methods'), appData)
75
75
 
@@ -1,5 +1,5 @@
1
1
  import { INNER_LIFECYCLES } from '../../core/innerLifecycle'
2
- import { makeMap } from '@mpxjs/utils/src/array'
2
+ import { makeMap } from '@mpxjs/utils'
3
3
 
4
4
  let bulitInKeys
5
5