Skip to content

Commit

Permalink
[release] 0.11.8
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 21, 2015
1 parent 111bcb1 commit 6c84105
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 107 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue",
"version": "0.11.7",
"version": "0.11.8",
"main": "dist/vue.js",
"description": "Simple, Fast & Composable MVVM for building interative interfaces",
"authors": ["Evan You <[email protected]>"],
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue",
"version": "0.11.7",
"version": "0.11.8",
"main": "src/vue.js",
"author": "Evan You <[email protected]>",
"description": "Simple, Fast & Composable MVVM for building interative interfaces",
Expand Down
112 changes: 11 additions & 101 deletions dist/vue.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Vue.js v0.11.7
* Vue.js v0.11.8
* (c) 2015 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -364,6 +364,10 @@ return /******/ (function(modules) { // webpackBootstrap
// attached/detached hooks on them.
this._transCpnts = null

// props used in v-repeat diffing
this._new = true
this._reused = false

// merge options.
options = this.$options = mergeOptions(
this.constructor.options,
Expand Down Expand Up @@ -6011,7 +6015,6 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) {

var _ = __webpack_require__(11)
var config = __webpack_require__(15)
var isObject = _.isObject
var isPlainObject = _.isPlainObject
var textParser = __webpack_require__(19)
Expand Down Expand Up @@ -6061,7 +6064,6 @@ return /******/ (function(modules) { // webpackBootstrap
this._checkParam('track-by') ||
this._checkParam('trackby') // 0.11.0 compat
this.cache = Object.create(null)
this.checkUpdateStrategy()
},

/**
Expand Down Expand Up @@ -6102,8 +6104,10 @@ return /******/ (function(modules) { // webpackBootstrap
var id = _.attr(this.el, 'component')
var options = this.vm.$options
if (!id) {
this.Ctor = _.Vue // default constructor
this.inherit = true // inline repeats should inherit
// default constructor
this.Ctor = _.Vue
// inline repeats should inherit
this.inherit = true
// important: transclude with no options, just
// to ensure block start and block end
this.template = transclude(this.template)
Expand Down Expand Up @@ -6142,30 +6146,6 @@ return /******/ (function(modules) { // webpackBootstrap
}
},

/**
* Check what strategy to use for updates.
*
* If the repeat is simple enough we can use in-place
* updates which simply overwrites existing instances'
* data. This strategy reuses DOM nodes and instances
* as much as possible.
*
* There are two situations where we have to use the
* more complex but more accurate diff algorithm:
* 1. We are using components with or inside v-repeat.
* The components could have private state that needs
* to be preserved across updates.
* 2. We have transitions on the list, which requires
* precise DOM re-positioning.
*/

checkUpdateStrategy: function () {
this.needDiff =
this.asComponent ||
this.el.hasAttribute(config.prefix + 'transition') ||
this.template.querySelector('[' + config.prefix + 'component]')
},

/**
* Update.
* This is called whenever the Array mutates.
Expand All @@ -6181,9 +6161,7 @@ return /******/ (function(modules) { // webpackBootstrap
} else if (type === 'string') {
data = _.toArray(data)
}
this.vms = this.needDiff
? this.diff(data, this.vms)
: this.inplaceUpdate(data, this.vms)
this.vms = this.diff(data, this.vms)
// update v-ref
if (this.refID) {
this.vm.$[this.refID] = this.vms
Expand All @@ -6195,43 +6173,6 @@ return /******/ (function(modules) { // webpackBootstrap
}
},

/**
* Inplace update that maximally reuses existing vm
* instances and DOM nodes by simply swapping data into
* existing vms.
*
* @param {Array} data
* @param {Array} oldVms
* @return {Array}
*/

inplaceUpdate: function (data, oldVms) {
oldVms = oldVms || []
var vms
var dir = this
var alias = dir.arg
var converted = dir.converted
if (data.length < oldVms.length) {
oldVms.slice(data.length).forEach(function (vm) {
vm.$destroy(true)
})
vms = oldVms.slice(0, data.length)
overwrite(data, vms, alias, converted)
} else if (data.length > oldVms.length) {
var newVms = data.slice(oldVms.length).map(function (data, i) {
var vm = dir.build(data, i + oldVms.length)
vm.$before(dir.ref)
return vm
})
overwrite(data.slice(0, oldVms.length), oldVms, alias, converted)
vms = oldVms.concat(newVms)
} else {
overwrite(data, oldVms, alias, converted)
vms = oldVms
}
return vms
},

/**
* Diff, based on new data and old data, determine the
* minimum amount of DOM manipulations needed to make the
Expand Down Expand Up @@ -6440,9 +6381,7 @@ return /******/ (function(modules) { // webpackBootstrap
var vm
while (i--) {
vm = this.vms[i]
if (this.needDiff) {
this.uncacheVm(vm)
}
this.uncacheVm(vm)
vm.$destroy()
}
}
Expand Down Expand Up @@ -6615,35 +6554,6 @@ return /******/ (function(modules) { // webpackBootstrap
return ret
}

/**
* Helper function to overwrite new data Array on to
* existing vms. Used in `inplaceUpdate`.
*
* @param {Array} arr
* @param {Array} vms
* @param {String|undefined} alias
* @param {Boolean} converted
*/

function overwrite (arr, vms, alias, converted) {
var vm, data, raw
for (var i = 0, l = arr.length; i < l; i++) {
vm = vms[i]
data = raw = arr[i]
if (converted) {
vm.$key = data.$key
raw = data.$value
}
if (alias) {
vm[alias] = raw
} else if (!isObject(raw)) {
vm.$value = raw
} else {
vm._setData(raw)
}
}
}

/***/ },
/* 45 */
/***/ function(module, exports, __webpack_require__) {
Expand Down
6 changes: 3 additions & 3 deletions dist/vue.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue",
"version": "0.11.7",
"version": "0.11.8",
"author": "Evan You <[email protected]>",
"license": "MIT",
"description": "Simple, Fast & Composable MVVM for building interative interfaces",
Expand Down

0 comments on commit 6c84105

Please sign in to comment.