Skip to content

Commit b081d9d

Browse files
committed
bump vue version
1 parent 58a0fbd commit b081d9d

File tree

4 files changed

+86
-78
lines changed

4 files changed

+86
-78
lines changed

src/guide/installation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: インストール
33
type: guide
44
order: 0
5-
vue_version: 1.0.27
6-
dev_size: "269.16"
7-
min_size: "75.95"
8-
gz_size: "26.31"
5+
vue_version: 1.0.28
6+
dev_size: "269.97"
7+
min_size: "75.75"
8+
gz_size: "26.27"
99
---
1010

1111
### 互換性の注意

themes/vue/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
google_analytics: UA-46852172-1
22
root_domain: vuejs.org
3-
vue_version: 1.0.27
3+
vue_version: 1.0.28

themes/vue/source/js/vue.js

Lines changed: 77 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v1.0.27
2+
* Vue.js v1.0.28
33
* (c) 2016 Evan You
44
* Released under the MIT License.
55
*/
@@ -405,6 +405,7 @@
405405
var isIE = UA && UA.indexOf('trident') > 0;
406406
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
407407
var isAndroid = UA && UA.indexOf('android') > 0;
408+
var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
408409

409410
var transitionProp = undefined;
410411
var transitionEndEvent = undefined;
@@ -421,6 +422,12 @@
421422
animationEndEvent = isWebkitAnim ? 'webkitAnimationEnd' : 'animationend';
422423
}
423424

425+
/* istanbul ignore next */
426+
function isNative(Ctor) {
427+
return (/native code/.test(Ctor.toString())
428+
);
429+
}
430+
424431
/**
425432
* Defer a task to execute it asynchronously. Ideally this
426433
* should be executed as a microtask, so we leverage
@@ -434,33 +441,53 @@
434441
var nextTick = (function () {
435442
var callbacks = [];
436443
var pending = false;
437-
var timerFunc;
444+
var timerFunc = undefined;
445+
438446
function nextTickHandler() {
439447
pending = false;
440448
var copies = callbacks.slice(0);
441-
callbacks = [];
449+
callbacks.length = 0;
442450
for (var i = 0; i < copies.length; i++) {
443451
copies[i]();
444452
}
445453
}
446454

447-
/* istanbul ignore else */
448-
if (inBrowser && window.postMessage && !window.importScripts && // not in WebWorker
449-
!(isAndroid && !window.requestAnimationFrame) // not in Android <= 4.3
450-
) {
451-
(function () {
452-
var NEXT_TICK_TOKEN = '__vue__nextTick__';
453-
window.addEventListener('message', function (e) {
454-
if (e.source === window && e.data === NEXT_TICK_TOKEN) {
455-
nextTickHandler();
456-
}
457-
});
458-
timerFunc = function () {
459-
window.postMessage(NEXT_TICK_TOKEN, '*');
460-
};
461-
})();
462-
} else {
463-
timerFunc = typeof global !== 'undefined' && global.setImmediate || setTimeout;
455+
// the nextTick behavior leverages the microtask queue, which can be accessed
456+
// via either native Promise.then or MutationObserver.
457+
// MutationObserver has wider support, however it is seriously bugged in
458+
// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
459+
// completely stops working after triggering a few times... so, if native
460+
// Promise is available, we will use it:
461+
/* istanbul ignore if */
462+
if (typeof Promise !== 'undefined' && isNative(Promise)) {
463+
var p = Promise.resolve();
464+
var noop = function noop() {};
465+
timerFunc = function () {
466+
p.then(nextTickHandler);
467+
// in problematic UIWebViews, Promise.then doesn't completely break, but
468+
// it can get stuck in a weird state where callbacks are pushed into the
469+
// microtask queue but the queue isn't being flushed, until the browser
470+
// needs to do some other work, e.g. handle a timer. Therefore we can
471+
// "force" the microtask queue to be flushed by adding an empty timer.
472+
if (isIOS) setTimeout(noop);
473+
};
474+
} else if (typeof MutationObserver !== 'undefined') {
475+
// use MutationObserver where native Promise is not available,
476+
// e.g. IE11, iOS7, Android 4.4
477+
var counter = 1;
478+
var observer = new MutationObserver(nextTickHandler);
479+
var textNode = document.createTextNode(String(counter));
480+
observer.observe(textNode, {
481+
characterData: true
482+
});
483+
timerFunc = function () {
484+
counter = (counter + 1) % 2;
485+
textNode.data = String(counter);
486+
};
487+
} else {
488+
// fallback to setTimeout
489+
/* istanbul ignore next */
490+
timerFunc = setTimeout;
464491
}
465492

466493
return function (cb, ctx) {
@@ -476,7 +503,7 @@
476503

477504
var Set$1 = undefined;
478505
/* istanbul ignore if */
479-
if (typeof Set !== 'undefined' && Set.toString().match(/native code/)) {
506+
if (typeof Set !== 'undefined' && isNative(Set)) {
480507
// use native Set when available.
481508
Set$1 = Set;
482509
} else {
@@ -1555,24 +1582,6 @@
15551582
}
15561583
}
15571584

1558-
/**
1559-
* Find a vm from a fragment.
1560-
*
1561-
* @param {Fragment} frag
1562-
* @return {Vue|undefined}
1563-
*/
1564-
1565-
function findVmFromFrag(frag) {
1566-
var node = frag.node;
1567-
// handle multi-node frag
1568-
if (frag.end) {
1569-
while (!node.__vue__ && node !== frag.end && node.nextSibling) {
1570-
node = node.nextSibling;
1571-
}
1572-
}
1573-
return node.__vue__;
1574-
}
1575-
15761585
var uid = 0;
15771586

15781587
function initMixin (Vue) {
@@ -4079,10 +4088,8 @@
40794088
if (value) {
40804089
if (!this.frag) {
40814090
this.insert();
4082-
this.updateRef(value);
40834091
}
40844092
} else {
4085-
this.updateRef(value);
40864093
this.remove();
40874094
}
40884095
},
@@ -4114,29 +4121,6 @@
41144121
}
41154122
},
41164123

4117-
updateRef: function updateRef(value) {
4118-
var ref = this.descriptor.ref;
4119-
if (!ref) return;
4120-
var hash = (this.vm || this._scope).$refs;
4121-
var refs = hash[ref];
4122-
var key = this._frag.scope.$key;
4123-
if (!refs) return;
4124-
if (value) {
4125-
if (Array.isArray(refs)) {
4126-
refs.push(findVmFromFrag(this._frag));
4127-
} else {
4128-
refs[key] = findVmFromFrag(this._frag);
4129-
}
4130-
} else {
4131-
if (Array.isArray(refs)) {
4132-
refs.$remove(findVmFromFrag(this._frag));
4133-
} else {
4134-
refs[key] = null;
4135-
delete refs[key];
4136-
}
4137-
}
4138-
},
4139-
41404124
unbind: function unbind() {
41414125
if (this.frag) {
41424126
this.frag.destroy();
@@ -4449,6 +4433,10 @@
44494433
params: ['track-by', 'stagger', 'enter-stagger', 'leave-stagger'],
44504434

44514435
bind: function bind() {
4436+
if ('development' !== 'production' && this.el.hasAttribute('v-if')) {
4437+
warn('<' + this.el.tagName.toLowerCase() + ' v-for="' + this.expression + '" v-if="' + this.el.getAttribute('v-if') + '">: ' + 'Using v-if and v-for on the same element is not recommended - ' + 'consider filtering the source Array instead.', this.vm);
4438+
}
4439+
44524440
// support "item in/of items" syntax
44534441
var inMatch = this.expression.match(/(.*) (?:in|of) (.*)/);
44544442
if (inMatch) {
@@ -5028,6 +5016,24 @@
50285016
};
50295017
}
50305018

5019+
/**
5020+
* Find a vm from a fragment.
5021+
*
5022+
* @param {Fragment} frag
5023+
* @return {Vue|undefined}
5024+
*/
5025+
5026+
function findVmFromFrag(frag) {
5027+
var node = frag.node;
5028+
// handle multi-node frag
5029+
if (frag.end) {
5030+
while (!node.__vue__ && node !== frag.end && node.nextSibling) {
5031+
node = node.nextSibling;
5032+
}
5033+
}
5034+
return node.__vue__;
5035+
}
5036+
50315037
var html = {
50325038

50335039
bind: function bind() {
@@ -6500,18 +6506,20 @@
65006506

65016507
var groupedMap = {};
65026508
var i, j, k, l;
6509+
var index = 0;
6510+
var priorities = [];
65036511
for (i = 0, j = dirs.length; i < j; i++) {
65046512
var dir = dirs[i];
65056513
var priority = dir.descriptor.def.priority || DEFAULT_PRIORITY;
65066514
var array = groupedMap[priority];
65076515
if (!array) {
65086516
array = groupedMap[priority] = [];
6517+
priorities.push(priority);
65096518
}
65106519
array.push(dir);
65116520
}
65126521

6513-
var index = 0;
6514-
var priorities = Object.keys(groupedMap).sort(function (a, b) {
6522+
priorities.sort(function (a, b) {
65156523
return a > b ? -1 : a === b ? 0 : 1;
65166524
});
65176525
for (i = 0, j = priorities.length; i < j; i++) {
@@ -7033,7 +7041,7 @@
70337041
def: def
70347042
};
70357043
// check ref for v-for, v-if and router-view
7036-
if (dirName === 'for' || dirName === 'if' || dirName === 'router-view') {
7044+
if (dirName === 'for' || dirName === 'router-view') {
70377045
descriptor.ref = findRef(el);
70387046
}
70397047
var fn = function terminalNodeLinkFn(vm, el, host, scope, frag) {
@@ -9544,6 +9552,7 @@
95449552
isIE: isIE,
95459553
isIE9: isIE9,
95469554
isAndroid: isAndroid,
9555+
isIOS: isIOS,
95479556
get transitionProp () { return transitionProp; },
95489557
get transitionEndEvent () { return transitionEndEvent; },
95499558
get animationProp () { return animationProp; },
@@ -9574,7 +9583,6 @@
95749583
removeNodeRange: removeNodeRange,
95759584
isFragment: isFragment,
95769585
getOuterHTML: getOuterHTML,
9577-
findVmFromFrag: findVmFromFrag,
95789586
mergeOptions: mergeOptions,
95799587
resolveAsset: resolveAsset,
95809588
checkComponentAttr: checkComponentAttr,
@@ -10200,7 +10208,7 @@
1020010208

1020110209
installGlobalAPI(Vue);
1020210210

10203-
Vue.version = '1.0.27';
10211+
Vue.version = '1.0.28';
1020410212

1020510213
// devtools global hook
1020610214
/* istanbul ignore next */

themes/vue/source/js/vue.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)