Skip to content

Commit

Permalink
build: bundle 3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Aug 30, 2019
1 parent 7d7e048 commit ec2e1fe
Show file tree
Hide file tree
Showing 6 changed files with 2,868 additions and 2,690 deletions.
158 changes: 101 additions & 57 deletions dist/vue-router.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-router v3.1.2
* vue-router v3.1.3
* (c) 2019 Evan You
* @license MIT
*/
Expand Down Expand Up @@ -142,7 +142,7 @@ var View = {

return h(component, data, children)
}
}
};

function resolveProps (route, config) {
switch (typeof config) {
Expand Down Expand Up @@ -271,7 +271,7 @@ function createRoute (
redirectedFrom,
router
) {
var stringifyQuery$$1 = router && router.options.stringifyQuery;
var stringifyQuery = router && router.options.stringifyQuery;

var query = location.query || {};
try {
Expand All @@ -285,11 +285,11 @@ function createRoute (
hash: location.hash || '',
query: query,
params: location.params || {},
fullPath: getFullPath(location, stringifyQuery$$1),
fullPath: getFullPath(location, stringifyQuery),
matched: record ? formatMatch(record) : []
};
if (redirectedFrom) {
route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery$$1);
route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);
}
return Object.freeze(route)
}
Expand Down Expand Up @@ -1116,7 +1116,24 @@ var Link = {
// in case the <a> is a static node
a.isStatic = false;
var aData = (a.data = extend({}, a.data));
aData.on = on;
aData.on = aData.on || {};
// transform existing events in both objects into arrays so we can push later
for (var event in aData.on) {
var handler$1 = aData.on[event];
if (event in on) {
aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];
}
}
// append new listeners for router-link
for (var event$1 in on) {
if (event$1 in aData.on) {
// on[event] is always a function
aData.on[event$1].push(on[event$1]);
} else {
aData.on[event$1] = handler;
}
}

var aAttrs = (a.data.attrs = extend({}, a.data.attrs));
aAttrs.href = href;
} else {
Expand All @@ -1127,7 +1144,7 @@ var Link = {

return h(this.tag, data, this.$slots.default)
}
}
};

function guardEvent (e) {
// don't redirect with control keys
Expand Down Expand Up @@ -1245,6 +1262,18 @@ function createRouteMap (
}
}

if (process.env.NODE_ENV === 'development') {
// warn if routes do not include leading slashes
var found = pathList
// check for missing leading slash
.filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });

if (found.length > 0) {
var pathNames = found.map(function (path) { return ("- " + path); }).join('\n');
warn(false, ("Non-nested routes must include a leading slash character. Fix the following routes: \n" + pathNames));
}
}

return {
pathList: pathList,
pathMap: pathMap,
Expand Down Expand Up @@ -1600,6 +1629,28 @@ function resolveRecordPath (path, record) {

/* */

// use User Timing api (if present) for more accurate key precision
var Time =
inBrowser && window.performance && window.performance.now
? window.performance
: Date;

function genStateKey () {
return Time.now().toFixed(3)
}

var _key = genStateKey();

function getStateKey () {
return _key
}

function setStateKey (key) {
return (_key = key)
}

/* */

var positionStore = Object.create(null);

function setupScroll () {
Expand Down Expand Up @@ -1749,39 +1800,22 @@ function scrollToPosition (shouldScroll, position) {

/* */

var supportsPushState = inBrowser && (function () {
var ua = window.navigator.userAgent;

if (
(ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
ua.indexOf('Mobile Safari') !== -1 &&
ua.indexOf('Chrome') === -1 &&
ua.indexOf('Windows Phone') === -1
) {
return false
}

return window.history && 'pushState' in window.history
})();

// use User Timing api (if present) for more accurate key precision
var Time = inBrowser && window.performance && window.performance.now
? window.performance
: Date;

var _key = genKey();

function genKey () {
return Time.now().toFixed(3)
}

function getStateKey () {
return _key
}
var supportsPushState =
inBrowser &&
(function () {
var ua = window.navigator.userAgent;

if (
(ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
ua.indexOf('Mobile Safari') !== -1 &&
ua.indexOf('Chrome') === -1 &&
ua.indexOf('Windows Phone') === -1
) {
return false
}

function setStateKey (key) {
_key = key;
}
return window.history && 'pushState' in window.history
})();

function pushState (url, replace) {
saveScrollPosition();
Expand All @@ -1790,10 +1824,9 @@ function pushState (url, replace) {
var history = window.history;
try {
if (replace) {
history.replaceState({ key: _key }, '', url);
history.replaceState({ key: getStateKey() }, '', url);
} else {
_key = genKey();
history.pushState({ key: _key }, '', url);
history.pushState({ key: setStateKey(genStateKey()) }, '', url);
}
} catch (e) {
window.location[replace ? 'replace' : 'assign'](url);
Expand Down Expand Up @@ -1933,9 +1966,20 @@ function once (fn) {
}

var NavigationDuplicated = /*@__PURE__*/(function (Error) {
function NavigationDuplicated () {
Error.call(this, 'Navigating to current location is not allowed');
function NavigationDuplicated (normalizedLocation) {
Error.call(this);
this.name = this._name = 'NavigationDuplicated';
// passing the message to super() doesn't seem to work in the transpiled version
this.message = "Navigating to current location (\"" + (normalizedLocation.fullPath) + "\") is not allowed";
// add a stack property so services like Sentry can correctly display it
Object.defineProperty(this, 'stack', {
value: new Error().stack,
writable: true,
configurable: true
});
// we could also have used
// Error.captureStackTrace(this, this.constructor)
// but it only exists on node and chrome
}

if ( Error ) NavigationDuplicated.__proto__ = Error;
Expand Down Expand Up @@ -2275,11 +2319,11 @@ function poll (

/* */

var HTML5History = /*@__PURE__*/(function (History$$1) {
var HTML5History = /*@__PURE__*/(function (History) {
function HTML5History (router, base) {
var this$1 = this;

History$$1.call(this, router, base);
History.call(this, router, base);

var expectScroll = router.options.scrollBehavior;
var supportsScroll = supportsPushState && expectScroll;
Expand Down Expand Up @@ -2307,8 +2351,8 @@ var HTML5History = /*@__PURE__*/(function (History$$1) {
});
}

if ( History$$1 ) HTML5History.__proto__ = History$$1;
HTML5History.prototype = Object.create( History$$1 && History$$1.prototype );
if ( History ) HTML5History.__proto__ = History;
HTML5History.prototype = Object.create( History && History.prototype );
HTML5History.prototype.constructor = HTML5History;

HTML5History.prototype.go = function go (n) {
Expand Down Expand Up @@ -2363,18 +2407,18 @@ function getLocation (base) {

/* */

var HashHistory = /*@__PURE__*/(function (History$$1) {
var HashHistory = /*@__PURE__*/(function (History) {
function HashHistory (router, base, fallback) {
History$$1.call(this, router, base);
History.call(this, router, base);
// check history fallback deeplinking
if (fallback && checkFallback(this.base)) {
return
}
ensureSlash();
}

if ( History$$1 ) HashHistory.__proto__ = History$$1;
HashHistory.prototype = Object.create( History$$1 && History$$1.prototype );
if ( History ) HashHistory.__proto__ = History;
HashHistory.prototype = Object.create( History && History.prototype );
HashHistory.prototype.constructor = HashHistory;

// this is delayed until the app mounts
Expand Down Expand Up @@ -2528,15 +2572,15 @@ function replaceHash (path) {

/* */

var AbstractHistory = /*@__PURE__*/(function (History$$1) {
var AbstractHistory = /*@__PURE__*/(function (History) {
function AbstractHistory (router, base) {
History$$1.call(this, router, base);
History.call(this, router, base);
this.stack = [];
this.index = -1;
}

if ( History$$1 ) AbstractHistory.__proto__ = History$$1;
AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype );
if ( History ) AbstractHistory.__proto__ = History;
AbstractHistory.prototype = Object.create( History && History.prototype );
AbstractHistory.prototype.constructor = AbstractHistory;

AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {
Expand Down Expand Up @@ -2831,7 +2875,7 @@ function createHref (base, fullPath, mode) {
}

VueRouter.install = install;
VueRouter.version = '3.1.2';
VueRouter.version = '3.1.3';

if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
Expand Down
Loading

0 comments on commit ec2e1fe

Please sign in to comment.