Skip to content

Commit

Permalink
[build] 2.0.0-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 11, 2016
1 parent 8367d48 commit df85865
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 89 deletions.
43 changes: 23 additions & 20 deletions dist/vue.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2542,7 +2542,7 @@ function validateProp(key, propOptions, propsData, vm) {
var absent = !hasOwn(propsData, key);
var value = propsData[key];
// handle boolean props
if (prop.type === Boolean) {
if (getType(prop.type) === 'Boolean') {
if (absent && !hasOwn(prop, 'default')) {
value = false;
} else if (value === '' || value === hyphenate(key)) {
Expand Down Expand Up @@ -2623,27 +2623,20 @@ function assertProp(prop, name, value, vm, absent) {
*/
function assertType(value, type) {
var valid = void 0;
var expectedType = void 0;
if (type === String) {
expectedType = 'string';
valid = typeof value === expectedType;
} else if (type === Number) {
expectedType = 'number';
valid = typeof value === expectedType;
} else if (type === Boolean) {
expectedType = 'boolean';
valid = typeof value === expectedType;
} else if (type === Function) {
expectedType = 'function';
valid = typeof value === expectedType;
} else if (type === Object) {
expectedType = 'Object';
var expectedType = getType(type);
if (expectedType === 'String') {
valid = typeof value === (expectedType = 'string');
} else if (expectedType === 'Number') {
valid = typeof value === (expectedType = 'number');
} else if (expectedType === 'Boolean') {
valid = typeof value === (expectedType = 'boolean');
} else if (expectedType === 'Function') {
valid = typeof value === (expectedType = 'function');
} else if (expectedType === 'Object') {
valid = isPlainObject(value);
} else if (type === Array) {
expectedType = 'Array';
} else if (expectedType === 'Array') {
valid = Array.isArray(value);
} else {
expectedType = type.name || type.toString();
valid = value instanceof type;
}
return {
Expand All @@ -2652,6 +2645,16 @@ function assertType(value, type) {
};
}

/**
* Use function string name to check built-in types,
* because a simple equality check will fail when running
* across different vms / iframes.
*/
function getType(fn) {
var match = fn && fn.toString().match(/^\s*function (\w+)/);
return match && match[1];
}



var util = Object.freeze({
Expand Down Expand Up @@ -2879,7 +2882,7 @@ Object.defineProperty(Vue.prototype, '$isServer', {
}
});

Vue.version = '2.0.0-beta.8';
Vue.version = '2.0.0-rc.1';

// attributes that should be using props for binding
var mustUseProp = makeMap('value,selected,checked,muted');
Expand Down
45 changes: 24 additions & 21 deletions dist/vue.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.0.0-beta.8
* Vue.js v2.0.0-rc.1
* (c) 2014-2016 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2547,7 +2547,7 @@
var absent = !hasOwn(propsData, key);
var value = propsData[key];
// handle boolean props
if (prop.type === Boolean) {
if (getType(prop.type) === 'Boolean') {
if (absent && !hasOwn(prop, 'default')) {
value = false;
} else if (value === '' || value === hyphenate(key)) {
Expand Down Expand Up @@ -2628,27 +2628,20 @@
*/
function assertType(value, type) {
var valid = void 0;
var expectedType = void 0;
if (type === String) {
expectedType = 'string';
valid = typeof value === expectedType;
} else if (type === Number) {
expectedType = 'number';
valid = typeof value === expectedType;
} else if (type === Boolean) {
expectedType = 'boolean';
valid = typeof value === expectedType;
} else if (type === Function) {
expectedType = 'function';
valid = typeof value === expectedType;
} else if (type === Object) {
expectedType = 'Object';
var expectedType = getType(type);
if (expectedType === 'String') {
valid = typeof value === (expectedType = 'string');
} else if (expectedType === 'Number') {
valid = typeof value === (expectedType = 'number');
} else if (expectedType === 'Boolean') {
valid = typeof value === (expectedType = 'boolean');
} else if (expectedType === 'Function') {
valid = typeof value === (expectedType = 'function');
} else if (expectedType === 'Object') {
valid = isPlainObject(value);
} else if (type === Array) {
expectedType = 'Array';
} else if (expectedType === 'Array') {
valid = Array.isArray(value);
} else {
expectedType = type.name || type.toString();
valid = value instanceof type;
}
return {
Expand All @@ -2657,6 +2650,16 @@
};
}

/**
* Use function string name to check built-in types,
* because a simple equality check will fail when running
* across different vms / iframes.
*/
function getType(fn) {
var match = fn && fn.toString().match(/^\s*function (\w+)/);
return match && match[1];
}



var util = Object.freeze({
Expand Down Expand Up @@ -2884,7 +2887,7 @@
}
});

Vue.version = '2.0.0-beta.8';
Vue.version = '2.0.0-rc.1';

// attributes that should be using props for binding
var mustUseProp = makeMap('value,selected,checked,muted');
Expand Down
6 changes: 3 additions & 3 deletions dist/vue.min.js

Large diffs are not rendered by default.

62 changes: 39 additions & 23 deletions packages/vue-server-renderer/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2653,7 +2653,7 @@ function validateProp(key, propOptions, propsData, vm) {
var absent = !hasOwn(propsData, key);
var value = propsData[key];
// handle boolean props
if (prop.type === Boolean) {
if (getType(prop.type) === 'Boolean') {
if (absent && !hasOwn(prop, 'default')) {
value = false;
} else if (value === '' || value === hyphenate(key)) {
Expand Down Expand Up @@ -2734,27 +2734,20 @@ function assertProp(prop, name, value, vm, absent) {
*/
function assertType(value, type) {
var valid = void 0;
var expectedType = void 0;
if (type === String) {
expectedType = 'string';
valid = typeof value === expectedType;
} else if (type === Number) {
expectedType = 'number';
valid = typeof value === expectedType;
} else if (type === Boolean) {
expectedType = 'boolean';
valid = typeof value === expectedType;
} else if (type === Function) {
expectedType = 'function';
valid = typeof value === expectedType;
} else if (type === Object) {
expectedType = 'Object';
var expectedType = getType(type);
if (expectedType === 'String') {
valid = typeof value === (expectedType = 'string');
} else if (expectedType === 'Number') {
valid = typeof value === (expectedType = 'number');
} else if (expectedType === 'Boolean') {
valid = typeof value === (expectedType = 'boolean');
} else if (expectedType === 'Function') {
valid = typeof value === (expectedType = 'function');
} else if (expectedType === 'Object') {
valid = isPlainObject(value);
} else if (type === Array) {
expectedType = 'Array';
} else if (expectedType === 'Array') {
valid = Array.isArray(value);
} else {
expectedType = type.name || type.toString();
valid = value instanceof type;
}
return {
Expand All @@ -2763,6 +2756,16 @@ function assertType(value, type) {
};
}

/**
* Use function string name to check built-in types,
* because a simple equality check will fail when running
* across different vms / iframes.
*/
function getType(fn) {
var match = fn && fn.toString().match(/^\s*function (\w+)/);
return match && match[1];
}

// attributes that should be using props for binding
var mustUseProp = makeMap('value,selected,checked,muted');

Expand Down Expand Up @@ -4484,6 +4487,14 @@ function makeFunction(code) {
}
}

var warned = Object.create(null);
var warnOnce = function warnOnce(msg) {
if (!warned[msg]) {
warned[msg] = true;
console.warn('\n\u001b[31m' + msg + '\u001b[39m\n');
}
};

var normalizeAsync = function normalizeAsync(cache, method) {
var fn = cache[method];
if (!fn) {
Expand Down Expand Up @@ -4531,9 +4542,10 @@ function createRenderFunction(modules, directives, isUnaryTag, cache) {
// check cache hit
var Ctor = node.componentOptions.Ctor;
var getKey = Ctor.options.serverCacheKey;
if (getKey && cache) {
var name = Ctor.options.name;
if (getKey && cache && name) {
(function () {
var key = Ctor.cid + '::' + getKey(node.componentOptions.propsData);
var key = name + '::' + getKey(node.componentOptions.propsData);
if (has) {
has(key, function (hit) {
if (hit) {
Expand All @@ -4555,8 +4567,11 @@ function createRenderFunction(modules, directives, isUnaryTag, cache) {
}
})();
} else {
if (getKey) {
console.error('[vue-server-renderer] Component ' + (Ctor.options.name || '(anonymous)') + ' implemented serverCacheKey, ' + 'but no cache was provided to the renderer.');
if (getKey && !cache) {
warnOnce('[vue-server-renderer] Component ' + (Ctor.options.name || '(anonymous)') + ' implemented serverCacheKey, ' + 'but no cache was provided to the renderer.');
}
if (getKey && !name) {
warnOnce('[vue-server-renderer] Components that implement "serverCacheKey" ' + 'must also define a unique "name" option.');
}
renderComponent(node, write, next, isRoot);
}
Expand Down Expand Up @@ -4678,6 +4693,7 @@ function createRenderFunction(modules, directives, isUnaryTag, cache) {
}

return function render(component, write, done) {
warned = Object.create(null);
activeInstance = component;
normalizeRender(component);
renderNode(component._render(), write, done, true);
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-server-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-server-renderer",
"version": "2.0.0-beta.8",
"version": "2.0.0-rc.1",
"description": "server renderer for Vue 2.0",
"main": "index.js",
"repository": {
Expand Down
41 changes: 22 additions & 19 deletions packages/vue-template-compiler/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,7 @@ function validateProp(key, propOptions, propsData, vm) {
var absent = !hasOwn(propsData, key);
var value = propsData[key];
// handle boolean props
if (prop.type === Boolean) {
if (getType(prop.type) === 'Boolean') {
if (absent && !hasOwn(prop, 'default')) {
value = false;
} else if (value === '' || value === hyphenate(key)) {
Expand Down Expand Up @@ -2593,27 +2593,20 @@ function assertProp(prop, name, value, vm, absent) {
*/
function assertType(value, type) {
var valid = void 0;
var expectedType = void 0;
if (type === String) {
expectedType = 'string';
valid = typeof value === expectedType;
} else if (type === Number) {
expectedType = 'number';
valid = typeof value === expectedType;
} else if (type === Boolean) {
expectedType = 'boolean';
valid = typeof value === expectedType;
} else if (type === Function) {
expectedType = 'function';
valid = typeof value === expectedType;
} else if (type === Object) {
expectedType = 'Object';
var expectedType = getType(type);
if (expectedType === 'String') {
valid = typeof value === (expectedType = 'string');
} else if (expectedType === 'Number') {
valid = typeof value === (expectedType = 'number');
} else if (expectedType === 'Boolean') {
valid = typeof value === (expectedType = 'boolean');
} else if (expectedType === 'Function') {
valid = typeof value === (expectedType = 'function');
} else if (expectedType === 'Object') {
valid = isPlainObject(value);
} else if (type === Array) {
expectedType = 'Array';
} else if (expectedType === 'Array') {
valid = Array.isArray(value);
} else {
expectedType = type.name || type.toString();
valid = value instanceof type;
}
return {
Expand All @@ -2622,6 +2615,16 @@ function assertType(value, type) {
};
}

/**
* Use function string name to check built-in types,
* because a simple equality check will fail when running
* across different vms / iframes.
*/
function getType(fn) {
var match = fn && fn.toString().match(/^\s*function (\w+)/);
return match && match[1];
}

// attributes that should be using props for binding
var mustUseProp = makeMap('value,selected,checked,muted');

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-template-compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-template-compiler",
"version": "2.0.0-beta.8",
"version": "2.0.0-rc.1",
"description": "template compiler for Vue 2.0",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Object.defineProperty(Vue.prototype, '$isServer', {
get: () => config._isServer
})

Vue.version = '2.0.0-beta.8'
Vue.version = '2.0.0-rc.1'

export default Vue

0 comments on commit df85865

Please sign in to comment.