Skip to content

Commit b1b70fa

Browse files
committedOct 23, 2015
[release] 1.0.0-rc.2-migration
1 parent 8a23ca0 commit b1b70fa

File tree

4 files changed

+109
-76
lines changed

4 files changed

+109
-76
lines changed
 

‎dist/vue.js

+103-70
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v1.0.0-alpha.8
2+
* Vue.js v1.0.0-rc.2-migration
33
* (c) 2015 Evan You
44
* Released under the MIT License.
55
*/
@@ -163,7 +163,7 @@ return /******/ (function(modules) { // webpackBootstrap
163163
extend(p, __webpack_require__(69))
164164
extend(p, __webpack_require__(70))
165165

166-
Vue.version = '1.0.0-beta.3'
166+
Vue.version = '1.0.0-alpha.8'
167167
module.exports = _.Vue = Vue
168168

169169

@@ -1748,6 +1748,7 @@ return /******/ (function(modules) { // webpackBootstrap
17481748
* Hooks and param attributes are merged as arrays.
17491749
*/
17501750

1751+
strats.init =
17511752
strats.created =
17521753
strats.ready =
17531754
strats.attached =
@@ -1870,8 +1871,8 @@ return /******/ (function(modules) { // webpackBootstrap
18701871
}
18711872
def = components[key]
18721873
if (_.isPlainObject(def)) {
1873-
def.id = def.id || key
1874-
components[key] = def._Ctor || (def._Ctor = _.Vue.extend(def))
1874+
def.name = def.name || key
1875+
components[key] = _.Vue.extend(def)
18751876
}
18761877
}
18771878
}
@@ -1919,10 +1920,10 @@ return /******/ (function(modules) { // webpackBootstrap
19191920
var asset
19201921
while (i--) {
19211922
asset = assets[i]
1922-
var id = asset.id || (asset.options && asset.options.id)
1923+
var id = asset.name || (asset.options && asset.options.name)
19231924
if (!id) {
19241925
("development") !== 'production' && _.warn(
1925-
'Array-syntax assets must provide an id field.'
1926+
'Array-syntax assets must provide a "name" field.'
19261927
)
19271928
} else {
19281929
res[id] = asset
@@ -2264,21 +2265,21 @@ return /******/ (function(modules) { // webpackBootstrap
22642265
_.warn('{DEPRECATION} ' + msg)
22652266
}
22662267

2267-
var newBindingSyntaxLink = ' See https://github.com/yyx990803/vue/issues/1325 for details.'
2268+
var newBindingSyntaxLink = ' See https://github.com/vuejs/vue/issues/1325 for details.'
22682269

22692270
_.deprecation = {
22702271

22712272
REPEAT: function () {
22722273
warn(
22732274
'v-repeat will be deprecated in favor of v-for in 1.0.0. ' +
2274-
'See https://github.com/yyx990803/vue/issues/1200 for details.'
2275+
'See https://github.com/vuejs/vue/issues/1200 for details.'
22752276
)
22762277
},
22772278

22782279
ADD: function () {
22792280
warn(
22802281
'$add() will be deprecated in 1.0.0. Use $set() instead. ' +
2281-
'See https://github.com/yyx990803/vue/issues/1171 for details.'
2282+
'See https://github.com/vuejs/vue/issues/1171 for details.'
22822283
)
22832284
},
22842285

@@ -2299,36 +2300,36 @@ return /******/ (function(modules) { // webpackBootstrap
22992300
WAIT_FOR: function () {
23002301
warn(
23012302
'"wait-for" will be deprecated in 1.0.0. Use `activate` hook instead. ' +
2302-
'See https://github.com/yyx990803/vue/issues/1169 for details.'
2303+
'See https://github.com/vuejs/vue/issues/1169 for details.'
23032304
)
23042305
},
23052306

23062307
STRICT_MODE: function (type, id) {
23072308
warn(
23082309
'Falling through to parent when resolving ' + type + ' with id "' + id +
23092310
'". Strict mode will be the default in 1.0.0. ' +
2310-
'See https://github.com/yyx990803/vue/issues/1170 for details.'
2311+
'See https://github.com/vuejs/vue/issues/1170 for details.'
23112312
)
23122313
},
23132314

23142315
CONTENT: function () {
23152316
warn(
23162317
'<content> insertion points will be deprecated in in 1.0.0. in favor of <slot>. ' +
2317-
'See https://github.com/yyx990803/vue/issues/1167 for details.'
2318+
'See https://github.com/vuejs/vue/issues/1167 for details.'
23182319
)
23192320
},
23202321

23212322
DATA_AS_PROP: function () {
23222323
warn(
23232324
'$data will no longer be usable as a prop in 1.0.0. ' +
2324-
'See https://github.com/yyx990803/vue/issues/1198 for details.'
2325+
'See https://github.com/vuejs/vue/issues/1198 for details.'
23252326
)
23262327
},
23272328

23282329
INHERIT: function () {
23292330
warn(
23302331
'The "inherit" option will be deprecated in 1.0.0. ' +
2331-
'See https://github.com/yyx990803/vue/issues/1198 for details.'
2332+
'See https://github.com/vuejs/vue/issues/1198 for details.'
23322333
)
23332334
},
23342335

@@ -2357,15 +2358,15 @@ return /******/ (function(modules) { // webpackBootstrap
23572358
warn(
23582359
'v-ref will no longer take an attribute value in 1.0.0. Use "v-ref:id" syntax ' +
23592360
'instead. Also, refs will be registered under vm.$refs instead of vm.$. ' +
2360-
'See https://github.com/yyx990803/vue/issues/1292 for more details.'
2361+
'See https://github.com/vuejs/vue/issues/1292 for more details.'
23612362
)
23622363
},
23632364

23642365
V_EL: function () {
23652366
warn(
23662367
'v-el will no longer take an attribute value in 1.0.0. Use "v-el:id" syntax ' +
23672368
'instead. Also, nodes will be registered under vm.$els instead of vm.$$. ' +
2368-
'See https://github.com/yyx990803/vue/issues/1292 for more details.'
2369+
'See https://github.com/vuejs/vue/issues/1292 for more details.'
23692370
)
23702371
},
23712372

@@ -2399,9 +2400,9 @@ return /******/ (function(modules) { // webpackBootstrap
23992400

24002401
ATTR_INVALID: function (name) {
24012402
warn(
2402-
'Mustache interpolation found in non-native attribute "' + name + '": ' +
2403+
'Mustache interpolation found in vue-specific attribute "' + name + '": ' +
24032404
'attribute interpolation will be limited to native attributes only ' +
2404-
'in 1.0.0. Use v-bind for custom attributes and props.'
2405+
'in 1.0.0. Use v-bind for vue directives and props.'
24052406
)
24062407
},
24072408

@@ -2462,7 +2463,7 @@ return /******/ (function(modules) { // webpackBootstrap
24622463
warn(
24632464
'No need to return false in handler for event "' + event + '": events ' +
24642465
'no longer propagate beyond the first triggered handler unless the ' +
2465-
'handler explicitly returns true. See https://github.com/yyx990803/vue/issues/1175 ' +
2466+
'handler explicitly returns true. See https://github.com/vuejs/vue/issues/1175 ' +
24662467
'for more details.'
24672468
)
24682469
},
@@ -2477,7 +2478,7 @@ return /******/ (function(modules) { // webpackBootstrap
24772478
SELECT_OPTIONS: function () {
24782479
warn(
24792480
'The "options" param for <select v-model> will be deprecated in 1.0.0. ' +
2480-
'Use v-for to render the options. See https://github.com/yyx990803/vue/issues/1229 ' +
2481+
'Use v-for to render the options. See https://github.com/vuejs/vue/issues/1229 ' +
24812482
'for more details.'
24822483
)
24832484
},
@@ -2508,7 +2509,7 @@ return /******/ (function(modules) { // webpackBootstrap
25082509
V_COMPONENT: function () {
25092510
warn(
25102511
'v-component will be deprecated in 1.0.0. Use "is" attribute instead. ' +
2511-
'See https://github.com/yyx990803/vue/issues/1278 for more details.'
2512+
'See https://github.com/vuejs/vue/issues/1278 for more details.'
25122513
)
25132514
},
25142515

@@ -2593,6 +2594,10 @@ return /******/ (function(modules) { // webpackBootstrap
25932594
exports.extend = function (extendOptions) {
25942595
extendOptions = extendOptions || {}
25952596
var Super = this
2597+
var isFirstExtend = Super.cid === 0
2598+
if (isFirstExtend && extendOptions._Ctor) {
2599+
return extendOptions._Ctor
2600+
}
25962601
var name = extendOptions.name || Super.options.name
25972602
var Sub = createClass(name || 'VueComponent')
25982603
Sub.prototype = Object.create(Super.prototype)
@@ -2614,6 +2619,10 @@ return /******/ (function(modules) { // webpackBootstrap
26142619
if (name) {
26152620
Sub.options.components[name] = Sub
26162621
}
2622+
// cache constructor
2623+
if (isFirstExtend) {
2624+
extendOptions._Ctor = Sub
2625+
}
26172626
return Sub
26182627
}
26192628

@@ -2889,10 +2898,11 @@ return /******/ (function(modules) { // webpackBootstrap
28892898
* @param {Vue} vm
28902899
* @param {Element} el
28912900
* @param {Object} options
2901+
* @param {Object} contextOptions
28922902
* @return {Function}
28932903
*/
28942904

2895-
exports.compileRoot = function (el, options) {
2905+
exports.compileRoot = function (el, options, contextOptions) {
28962906
var containerAttrs = options._containerAttrs
28972907
var replacerAttrs = options._replacerAttrs
28982908
var contextLinkFn, replacerLinkFn
@@ -2904,8 +2914,8 @@ return /******/ (function(modules) { // webpackBootstrap
29042914
// compiled separately and linked in different scopes.
29052915
if (options._asComponent) {
29062916
// 2. container attributes
2907-
if (containerAttrs) {
2908-
contextLinkFn = compileDirectives(containerAttrs, options)
2917+
if (containerAttrs && contextOptions) {
2918+
contextLinkFn = compileDirectives(containerAttrs, contextOptions)
29092919
}
29102920
if (replacerAttrs) {
29112921
// 3. replacer attributes
@@ -3599,7 +3609,7 @@ return /******/ (function(modules) { // webpackBootstrap
35993609
prop.filters = parsed.filters
36003610
// check literal
36013611
if (literalValueRE.test(value)) {
3602-
prop.mode = propBindingModes.ONE_TIME
3612+
prop.raw = _.stripQuotes(value) || value
36033613
} else {
36043614
prop.dynamic = true
36053615
// check non-settable path for two-way bindings
@@ -3821,7 +3831,7 @@ return /******/ (function(modules) { // webpackBootstrap
38213831
inSingle = inDouble = false
38223832
curly = square = paren = 0
38233833
lastFilterIndex = 0
3824-
dir = {}
3834+
dir = { raw: s }
38253835

38263836
for (i = 0, l = str.length; i < l; i++) {
38273837
c = str.charCodeAt(i)
@@ -6090,33 +6100,36 @@ return /******/ (function(modules) { // webpackBootstrap
60906100

60916101
/**
60926102
* Remove fragment, single node version
6103+
*
6104+
* @param {Boolean} [destroy]
60936105
*/
60946106

6095-
function singleRemove () {
6107+
function singleRemove (destroy) {
60966108
var shouldCallRemove = _.inDoc(this.node)
6097-
transition.remove(this.node, this.vm)
6098-
this.inserted = false
6099-
if (shouldCallRemove) {
6100-
this.callHook(detach)
6101-
}
6109+
var self = this
6110+
transition.remove(this.node, this.vm, function () {
6111+
self.inserted = false
6112+
if (shouldCallRemove) {
6113+
self.callHook(detach)
6114+
}
6115+
if (destroy) {
6116+
self.destroy()
6117+
}
6118+
})
61026119
}
61036120

61046121
/**
61056122
* Insert fragment before target, multi-nodes version
61066123
*
61076124
* @param {Node} target
6108-
* @param {Boolean} trans
61096125
*/
61106126

6111-
function multiBefore (target, trans) {
6127+
function multiBefore (target) {
61126128
_.before(this.node, target)
61136129
var nodes = this.nodes
61146130
var vm = this.vm
6115-
var method = trans !== false
6116-
? transition.before
6117-
: _.before
61186131
for (var i = 0, l = nodes.length; i < l; i++) {
6119-
method(nodes[i], target, vm)
6132+
_.before(nodes[i], target, vm)
61206133
}
61216134
_.before(this.end, target)
61226135
this.inserted = true
@@ -6127,9 +6140,11 @@ return /******/ (function(modules) { // webpackBootstrap
61276140

61286141
/**
61296142
* Remove fragment, multi-nodes version
6143+
*
6144+
* @param {Boolean} [destroy]
61306145
*/
61316146

6132-
function multiRemove () {
6147+
function multiRemove (destroy) {
61336148
var shouldCallRemove = _.inDoc(this.node)
61346149
var parent = this.node.parentNode
61356150
var node = this.node.nextSibling
@@ -6139,7 +6154,7 @@ return /******/ (function(modules) { // webpackBootstrap
61396154
while (node !== this.end) {
61406155
nodes.push(node)
61416156
next = node.nextSibling
6142-
transition.remove(node, vm)
6157+
parent.removeChild(node, vm)
61436158
node = next
61446159
}
61456160
parent.removeChild(this.node)
@@ -6148,6 +6163,9 @@ return /******/ (function(modules) { // webpackBootstrap
61486163
if (shouldCallRemove) {
61496164
this.callHook(detach)
61506165
}
6166+
if (destroy) {
6167+
this.destroy()
6168+
}
61516169
}
61526170

61536171
/**
@@ -6406,25 +6424,20 @@ return /******/ (function(modules) { // webpackBootstrap
64066424
'false-value': '_falseValue'
64076425
}
64086426

6427+
// check for attribtues that prohibit interpolations
6428+
var disallowedInterpAttrRE = /^v-|^:|^@|^(is|transition|transition-mode|debounce|track-by|stagger|enter-stagger|leave-stagger)$/
6429+
64096430
module.exports = {
64106431

64116432
priority: 850,
64126433

64136434
update: function (value) {
64146435
if (this.arg) {
6415-
64166436
if (true) {
6417-
var attr = this.arg
6418-
if (!(
6419-
attr === 'class' ||
6420-
/^data-/.test(attr) ||
6421-
(attr === 'for' && 'htmlFor' in this.el) ||
6422-
_.camelize(attr) in this.el
6423-
)) {
6424-
_.deprecation.ATTR_INVALID(attr)
6437+
if (disallowedInterpAttrRE.test(this.arg)) {
6438+
_.deprecation.ATTR_INVALID(this.arg)
64256439
}
64266440
}
6427-
64286441
this.setAttr(this.arg, value)
64296442
} else if (typeof value === 'object') {
64306443
// TODO no longer need to support object in 1.0.0
@@ -6580,15 +6593,15 @@ return /******/ (function(modules) { // webpackBootstrap
65806593
addClass(this.el, value[i])
65816594
}
65826595
}
6583-
this.prevKeys = value
6596+
this.prevKeys = value.slice()
65846597
},
65856598

65866599
cleanup: function (value) {
65876600
if (this.prevKeys) {
65886601
var i = this.prevKeys.length
65896602
while (i--) {
65906603
var key = this.prevKeys[i]
6591-
if (!value || !contains(value, key)) {
6604+
if (key && (!value || !contains(value, key))) {
65926605
removeClass(this.el, key)
65936606
}
65946607
}
@@ -7363,6 +7376,12 @@ return /******/ (function(modules) { // webpackBootstrap
73637376
},
73647377

73657378
update: function (handler) {
7379+
// stub a noop for v-on with no value,
7380+
// e.g. @mousedown.prevent
7381+
if (!this._descriptor.raw) {
7382+
handler = function () {}
7383+
}
7384+
73667385
if (typeof handler !== 'function') {
73677386
("development") !== 'production' && _.warn(
73687387
'v-on:' + this.arg + '="' +
@@ -8835,7 +8854,13 @@ return /******/ (function(modules) { // webpackBootstrap
88358854
// support "item in items" syntax
88368855
var inMatch = this.expression.match(/(.*) in (.*)/)
88378856
if (inMatch) {
8838-
this.alias = inMatch[1]
8857+
var itMatch = inMatch[1].match(/\((.*),(.*)\)/)
8858+
if (itMatch) {
8859+
this.iterator = itMatch[1].trim()
8860+
this.alias = itMatch[2].trim()
8861+
} else {
8862+
this.alias = inMatch[1].trim()
8863+
}
88398864
this._watcherExp = inMatch[2]
88408865
}
88418866

@@ -8922,6 +8947,7 @@ return /******/ (function(modules) { // webpackBootstrap
89228947
var oldFrags = this.frags
89238948
var frags = this.frags = new Array(data.length)
89248949
var alias = this.alias
8950+
var iterator = this.iterator
89258951
var start = this.start
89268952
var end = this.end
89278953
var inDoc = _.inDoc(start)
@@ -8945,6 +8971,9 @@ return /******/ (function(modules) { // webpackBootstrap
89458971
// update $key
89468972
if (key) {
89478973
frag.scope.$key = key
8974+
if (iterator) {
8975+
frag.scope[iterator] = key
8976+
}
89488977
}
89498978
// update data for track-by, object repeat &
89508979
// primitive values.
@@ -8975,7 +9004,6 @@ return /******/ (function(modules) { // webpackBootstrap
89759004
frag = oldFrags[i]
89769005
if (!frag.reused) {
89779006
this.deleteCachedFrag(frag)
8978-
frag.destroy()
89799007
this.remove(frag, removalIndex++, totalRemoved, inDoc)
89809008
}
89819009
}
@@ -9037,6 +9065,9 @@ return /******/ (function(modules) { // webpackBootstrap
90379065
// avoid accidental fallback
90389066
_.define(scope, '$key', null)
90399067
}
9068+
if (this.iterator) {
9069+
_.defineReactive(scope, this.iterator, key || index)
9070+
}
90409071
var frag = this.factory.create(host, scope, this._frag)
90419072
frag.forId = this.id
90429073
this.cacheFrag(value, frag, index, key)
@@ -9142,11 +9173,11 @@ return /******/ (function(modules) { // webpackBootstrap
91429173
if (inDoc && staggerAmount) {
91439174
var op = frag.staggerCb = _.cancellable(function () {
91449175
frag.staggerCb = null
9145-
frag.remove()
9176+
frag.remove(true)
91469177
})
91479178
setTimeout(op, staggerAmount)
91489179
} else {
9149-
frag.remove()
9180+
frag.remove(true)
91509181
}
91519182
},
91529183

@@ -9462,8 +9493,7 @@ return /******/ (function(modules) { // webpackBootstrap
94629493

94639494
insert: function () {
94649495
if (this.elseFrag) {
9465-
this.elseFrag.remove()
9466-
this.elseFrag.destroy()
9496+
this.elseFrag.remove(true)
94679497
this.elseFrag = null
94689498
}
94699499
this.frag = this.factory.create(this._host, this._scope, this._frag)
@@ -9472,8 +9502,7 @@ return /******/ (function(modules) { // webpackBootstrap
94729502

94739503
remove: function () {
94749504
if (this.frag) {
9475-
this.frag.remove()
9476-
this.frag.destroy()
9505+
this.frag.remove(true)
94779506
this.frag = null
94789507
}
94799508
if (this.elseFactory) {
@@ -10103,6 +10132,9 @@ return /******/ (function(modules) { // webpackBootstrap
1010310132
// it will be filled up in _initScope().
1010410133
this._data = {}
1010510134

10135+
// call init hook
10136+
this._callHook('init')
10137+
1010610138
// initialize data observation and scope inheritance.
1010710139
this._initState()
1010810140

@@ -11005,7 +11037,8 @@ return /******/ (function(modules) { // webpackBootstrap
1100511037

1100611038
// root is always compiled per-instance, because
1100711039
// container attrs and props can be different every time.
11008-
var rootLinker = compiler.compileRoot(el, options)
11040+
var contextOptions = this._context && this._context.$options
11041+
var rootLinker = compiler.compileRoot(el, options, contextOptions)
1100911042

1101011043
// compile and link the rest
1101111044
var contentLinkFn
@@ -11106,6 +11139,14 @@ return /******/ (function(modules) { // webpackBootstrap
1110611139
var parent = this.$parent
1110711140
if (parent && !parent._isBeingDestroyed) {
1110811141
parent.$children.$remove(this)
11142+
// unregister ref
11143+
var ref = this.$options._ref
11144+
if (ref) {
11145+
var scope = this._scope || this._context
11146+
if (scope.$refs[ref] === this) {
11147+
scope.$refs[ref] = null
11148+
}
11149+
}
1110911150
}
1111011151
// remove self from owner fragment
1111111152
if (this._frag) {
@@ -11129,14 +11170,6 @@ return /******/ (function(modules) { // webpackBootstrap
1112911170
while (i--) {
1113011171
this._watchers[i].teardown()
1113111172
}
11132-
// unregister ref
11133-
var ref = this.$options._ref
11134-
if (ref) {
11135-
var scope = this._scope || this._context
11136-
if (scope.$[ref] === this) {
11137-
scope.$[ref] = null
11138-
}
11139-
}
1114011173
// remove reference to self on $el
1114111174
if (this.$el) {
1114211175
this.$el.__vue__ = null
@@ -11300,7 +11333,7 @@ return /******/ (function(modules) { // webpackBootstrap
1130011333
if (this._literal) {
1130111334
this.update && this.update(this.expression)
1130211335
} else if (
11303-
this._watcherExp &&
11336+
(this._watcherExp || this.modifiers) &&
1130411337
(this.update || this.twoWay) &&
1130511338
(!this.isLiteral || this._isDynamicLiteral) &&
1130611339
!this._checkStatement()

‎dist/vue.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue",
3-
"version": "1.0.0-alpha.8",
3+
"version": "1.0.0-rc.2-migration",
44
"author": "Evan You <yyx990803@gmail.com>",
55
"license": "MIT",
66
"description": "Simple, Fast & Composable MVVM for building interative interfaces",

‎src/vue.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ extend(p, require('./api/events'))
102102
extend(p, require('./api/child'))
103103
extend(p, require('./api/lifecycle'))
104104

105-
Vue.version = '1.0.0-alpha.8'
105+
Vue.version = '1.0.0-rc.2-migration'
106106
module.exports = _.Vue = Vue

0 commit comments

Comments
 (0)
Please sign in to comment.