@mpxjs/core 2.8.23-alpha → 2.8.23-alpha.1

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.23-alpha",
3
+ "version": "2.8.23-alpha.1",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -49,5 +49,5 @@
49
49
  "url": "https://github.com/didi/mpx/issues"
50
50
  },
51
51
  "sideEffects": false,
52
- "gitHead": "3a6dff432fd46bab36a9866f92cffb6501e69909"
52
+ "gitHead": "7c267ed965671fa83836ab099c3ccac59d69baa3"
53
53
  }
@@ -2,9 +2,9 @@ import * as wxLifecycle from '../platform/patch/wx/lifecycle'
2
2
  import * as tenonLifecycle from '../platform/patch/tenon/lifecycle'
3
3
  import { mergeLifecycle } from './mergeLifecycle'
4
4
  import { error } from '../helper/log'
5
- import { isObject, diffAndCloneA, hasOwn } from '../helper/utils'
5
+ import { isObject, diffAndCloneA, hasOwn } from '@mpxjs/utils'
6
6
  import { implemented } from '../core/implement'
7
- import { CREATED, DESTROYED } from '../core/innerLifecycle'
7
+ import { CREATED, UNMOUNTED } from '../core/innerLifecycle'
8
8
 
9
9
  // 暂不支持的wx选项,后期需要各种花式支持
10
10
  const unsupported = [
@@ -50,7 +50,7 @@ export default {
50
50
  // wx输出tenon时额外将onLoad代理到CREATED
51
51
  lifecycleProxyMap: Object.assign({}, wxLifecycle.lifecycleProxyMap, {
52
52
  [CREATED]: ['created', 'attached', 'onLoad'],
53
- [DESTROYED]: ['destroyed', 'detached', 'onUnload', 'unmounted']
53
+ [UNMOUNTED]: ['destroyed', 'detached', 'onUnload', 'unmounted']
54
54
  }),
55
55
  convert (options) {
56
56
  const props = Object.assign({}, options.properties, options.props)
package/src/core/proxy.js CHANGED
@@ -102,7 +102,7 @@ export default class MpxProxy {
102
102
  this.ignoreProxyMap = makeMap(Mpx.config.ignoreProxyWhiteList)
103
103
  // 收集setup中动态注册的hooks,小程序与web环境都需要
104
104
  this.hooks = {}
105
- if (__mpx_mode__ !== 'web' || __mpx_mode__ !== 'tenon') {
105
+ if (__mpx_mode__ !== 'web' && __mpx_mode__ !== 'tenon') {
106
106
  this.scope = effectScope(true)
107
107
  // props响应式数据代理
108
108
  this.props = {}
@@ -124,7 +124,7 @@ export default class MpxProxy {
124
124
  }
125
125
 
126
126
  created () {
127
- if (__mpx_mode__ !== 'web' || __mpx_mode__ !== 'tenon') {
127
+ if (__mpx_mode__ !== 'web' && __mpx_mode__ !== 'tenon') {
128
128
  // web和tenon中BEFORECREATE钩子通过vue的beforeCreate钩子单独驱动
129
129
  this.callHook(BEFORECREATE)
130
130
  setCurrentInstance(this)
@@ -139,7 +139,7 @@ export default class MpxProxy {
139
139
  this.state = CREATED
140
140
  this.callHook(CREATED)
141
141
 
142
- if (__mpx_mode__ !== 'web' || __mpx_mode__ !== 'tenon') {
142
+ if (__mpx_mode__ !== 'web' && __mpx_mode__ !== 'tenon') {
143
143
  this.initRender()
144
144
  }
145
145
 
@@ -210,7 +210,7 @@ export default class MpxProxy {
210
210
  }
211
211
  // 挂载$rawOptions
212
212
  this.target.$rawOptions = this.options
213
- if (__mpx_mode__ !== 'web' || __mpx_mode__ !== 'tenon') {
213
+ if (__mpx_mode__ !== 'web' && __mpx_mode__ !== 'tenon') {
214
214
  // 挂载$watch
215
215
  this.target.$watch = this.watch.bind(this)
216
216
  // 强制执行render
@@ -1,4 +1,4 @@
1
- import { setByPath } from '../../helper/utils'
1
+ import { setByPath } from '@mpxjs/utils'
2
2
 
3
3
  export default function proxyEventMixin () {
4
4
  const methods = {
@@ -1,7 +1,7 @@
1
1
  import builtInKeysMap from '../builtInKeysMap'
2
2
  import mergeOptions from '../../../core/mergeOptions'
3
3
  import MPXProxy from '../../../core/proxy'
4
- import { diffAndCloneA } from '../../../helper/utils'
4
+ import { diffAndCloneA } from '@mpxjs/utils'
5
5
 
6
6
  function filterOptions (options) {
7
7
  const newOptions = {}
@@ -46,7 +46,7 @@ export function getDefaultOptions (type, { rawOptions = {}, currentInject }) {
46
46
  this.__mpxProxy && this.__mpxProxy.updated()
47
47
  },
48
48
  [hookNames[2]] () {
49
- this.__mpxProxy && this.__mpxProxy.destroyed()
49
+ this.__mpxProxy && this.__mpxProxy.unmounted()
50
50
  }
51
51
  }]
52
52
  // 为了在builtMixin中可以使用某些rootMixin实现的特性(如数据响应等),此处builtInMixin在rootMixin之后执行,但是当builtInMixin使用存在对应内建生命周期的目标平台声明周期写法时,可能会出现用户生命周期比builtInMixin中的生命周期先执行的情况,为了避免这种情况发生,builtInMixin应该尽可能使用内建生命周期来编写