Skip to content

Commit 590a7ee

Browse files
committed
Release-v0.7.1
1 parent 7fc537a commit 590a7ee

File tree

6 files changed

+124
-54
lines changed

6 files changed

+124
-54
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"main": "dist/vue.js",
55
"ignore": [
66
".*",

component.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"main": "src/main.js",
55
"description": "Data-driven View Models",
66
"keywords": ["mvvm", "framework", "data binding"],

dist/vue.js

+118-48
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,15 @@ var config = require('./config'),
377377
/**
378378
* Set config options
379379
*/
380-
ViewModel.config = function (opts) {
381-
if (opts) {
380+
ViewModel.config = function (opts, val) {
381+
if (typeof opts === 'string') {
382+
if (val === undefined) {
383+
return config[opts]
384+
} else {
385+
config[opts] = val
386+
}
387+
} else {
382388
utils.extend(config, opts)
383-
if (opts.prefix) updatePrefix()
384389
}
385390
return this
386391
}
@@ -521,29 +526,6 @@ function mergeHook (fn, parentFn) {
521526
}
522527
}
523528

524-
/**
525-
* Update prefix for some special directives
526-
* that are used in compilation.
527-
*/
528-
var specialAttributes = [
529-
'pre',
530-
'text',
531-
'repeat',
532-
'partial',
533-
'component',
534-
'component-id',
535-
'transition'
536-
]
537-
538-
function updatePrefix () {
539-
specialAttributes.forEach(setPrefix)
540-
}
541-
542-
function setPrefix (attr) {
543-
config.attrs[attr] = config.prefix + '-' + attr
544-
}
545-
546-
updatePrefix()
547529
module.exports = ViewModel
548530
});
549531
require.register("vue/src/emitter.js", function(exports, require, module){
@@ -569,16 +551,42 @@ try {
569551
module.exports = Emitter
570552
});
571553
require.register("vue/src/config.js", function(exports, require, module){
572-
module.exports = {
554+
var prefix = 'v',
555+
specialAttributes = [
556+
'pre',
557+
'text',
558+
'repeat',
559+
'partial',
560+
'component',
561+
'component-id',
562+
'transition'
563+
],
564+
config = module.exports = {
565+
566+
async : true,
567+
debug : false,
568+
silent : false,
569+
enterClass : 'v-enter',
570+
leaveClass : 'v-leave',
571+
attrs : {},
572+
573+
get prefix () {
574+
return prefix
575+
},
576+
set prefix (val) {
577+
prefix = val
578+
updatePrefix()
579+
}
580+
581+
}
573582

574-
prefix : 'v',
575-
debug : false,
576-
silent : false,
577-
enterClass : 'v-enter',
578-
leaveClass : 'v-leave',
579-
attrs : {}
580-
583+
function updatePrefix () {
584+
specialAttributes.forEach(function (attr) {
585+
config.attrs[attr] = prefix + '-' + attr
586+
})
581587
}
588+
589+
updatePrefix()
582590
});
583591
require.register("vue/src/utils.js", function(exports, require, module){
584592
var config = require('./config'),
@@ -588,10 +596,13 @@ var config = require('./config'),
588596
console = window.console,
589597
ViewModel // late def
590598

591-
var defer =
592-
window.webkitRequestAnimationFrame ||
593-
window.requestAnimationFrame ||
594-
window.setTimeout
599+
// PhantomJS doesn't support rAF, yet it has the global
600+
// variable exposed. Use setTimeout so tests can work.
601+
var defer = navigator.userAgent.indexOf('PhantomJS') > -1
602+
? window.setTimeout
603+
: (window.webkitRequestAnimationFrame ||
604+
window.requestAnimationFrame ||
605+
window.setTimeout)
595606

596607
/**
597608
* Create a prototype-less object
@@ -771,7 +782,7 @@ var utils = module.exports = {
771782
},
772783

773784
/**
774-
* Defer DOM updates
785+
* used to defer batch updates
775786
*/
776787
nextTick: function (cb) {
777788
defer(cb, 0)
@@ -1586,6 +1597,9 @@ function getTargetVM (vm, path) {
15861597
module.exports = ViewModel
15871598
});
15881599
require.register("vue/src/binding.js", function(exports, require, module){
1600+
var batcher = require('./batcher'),
1601+
id = 0
1602+
15891603
/**
15901604
* Binding class.
15911605
*
@@ -1594,6 +1608,7 @@ require.register("vue/src/binding.js", function(exports, require, module){
15941608
* and multiple computed property dependents
15951609
*/
15961610
function Binding (compiler, key, isExp, isFn) {
1611+
this.id = id++
15971612
this.value = undefined
15981613
this.isExp = !!isExp
15991614
this.isFn = isFn
@@ -1603,6 +1618,7 @@ function Binding (compiler, key, isExp, isFn) {
16031618
this.instances = []
16041619
this.subs = []
16051620
this.deps = []
1621+
this.unbound = false
16061622
}
16071623

16081624
var BindingProto = Binding.prototype
@@ -1612,9 +1628,13 @@ var BindingProto = Binding.prototype
16121628
*/
16131629
BindingProto.update = function (value) {
16141630
this.value = value
1631+
batcher.queue(this, 'update')
1632+
}
1633+
1634+
BindingProto._update = function () {
16151635
var i = this.instances.length
16161636
while (i--) {
1617-
this.instances[i].update(value)
1637+
this.instances[i].update(this.value)
16181638
}
16191639
this.pub()
16201640
}
@@ -1624,6 +1644,10 @@ BindingProto.update = function (value) {
16241644
* Force all instances to re-evaluate themselves
16251645
*/
16261646
BindingProto.refresh = function () {
1647+
batcher.queue(this, 'refresh')
1648+
}
1649+
1650+
BindingProto._refresh = function () {
16271651
var i = this.instances.length
16281652
while (i--) {
16291653
this.instances[i].refresh()
@@ -1646,6 +1670,11 @@ BindingProto.pub = function () {
16461670
* Unbind the binding, remove itself from all of its dependencies
16471671
*/
16481672
BindingProto.unbind = function () {
1673+
// Indicate this has been unbound.
1674+
// It's possible this binding will be in
1675+
// the batcher's flush queue when its owner
1676+
// compiler has already been destroyed.
1677+
this.unbound = true
16491678
var i = this.instances.length
16501679
while (i--) {
16511680
this.instances[i].unbind()
@@ -2668,6 +2697,48 @@ function sniffTransitionEndEvent () {
26682697
}
26692698
}
26702699
});
2700+
require.register("vue/src/batcher.js", function(exports, require, module){
2701+
var config = require('./config'),
2702+
utils = require('./utils'),
2703+
queue, has, waiting
2704+
2705+
reset()
2706+
2707+
exports.queue = function (binding, method) {
2708+
if (!config.async) {
2709+
binding['_' + method]()
2710+
return
2711+
}
2712+
if (!has[binding.id]) {
2713+
queue.push({
2714+
binding: binding,
2715+
method: method
2716+
})
2717+
has[binding.id] = true
2718+
if (!waiting) {
2719+
waiting = true
2720+
utils.nextTick(flush)
2721+
}
2722+
}
2723+
}
2724+
2725+
function flush () {
2726+
for (var i = 0; i < queue.length; i++) {
2727+
var task = queue[i],
2728+
b = task.binding
2729+
if (b.unbound) continue
2730+
b['_' + task.method]()
2731+
has[b.id] = false
2732+
}
2733+
reset()
2734+
}
2735+
2736+
function reset () {
2737+
queue = []
2738+
has = utils.hash()
2739+
waiting = false
2740+
}
2741+
});
26712742
require.register("vue/src/directives/index.js", function(exports, require, module){
26722743
var utils = require('../utils'),
26732744
transition = require('../transition')
@@ -3143,15 +3214,14 @@ module.exports = {
31433214
try {
31443215
cursorPos = el.selectionStart
31453216
} catch (e) {}
3146-
// `input` event has weird updating issue with
3147-
// International (e.g. Chinese) input methods,
3148-
// have to use a Timeout to hack around it...
3149-
setTimeout(function () {
3150-
self.vm.$set(self.key, el[attr])
3217+
self.vm.$set(self.key, el[attr])
3218+
// since updates are async
3219+
// we need to reset cursor position async too
3220+
utils.nextTick(function () {
31513221
if (cursorPos !== undefined) {
31523222
el.setSelectionRange(cursorPos, cursorPos)
31533223
}
3154-
}, 0)
3224+
})
31553225
}
31563226
: function () {
31573227
// no filters, don't let it trigger update()
@@ -3166,9 +3236,9 @@ module.exports = {
31663236
if (isIE9) {
31673237
self.onCut = function () {
31683238
// cut event fires before the value actually changes
3169-
setTimeout(function () {
3239+
utils.nextTick(function () {
31703240
self.set()
3171-
}, 0)
3241+
})
31723242
}
31733243
self.onDel = function (e) {
31743244
if (e.keyCode === 46 || e.keyCode === 8) {

dist/vue.min.js

+2-2
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": "0.7.0",
3+
"version": "0.7.1",
44
"author": {
55
"name": "Evan You",
66
"email": "[email protected]",

tasks/release.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = function (grunt) {
2727
grunt.registerTask('release', function (version) {
2828

2929
var done = this.async(),
30-
current = grunt.config('pkg.version'),
30+
current = grunt.config('version'),
3131
next = semver.inc(current, version || 'patch') || version
3232

3333
if (!semver.valid(next)) {

0 commit comments

Comments
 (0)