You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -161,7 +161,16 @@
);
}
- function linkClicked(e, router, href, as, replace, shallow, scroll) {+ function linkClicked(+ e,+ router,+ href,+ as,+ replace,+ shallow,+ scroll,+ locale+ ) {
var { nodeName } = e.currentTarget;
if (
@@ -179,7 +188,8 @@
} // replace state instead of push if prop is present
router[replace ? "replace" : "push"](href, as, {
- shallow+ shallow,+ locale
}).then(success => {
if (!success) return;
@@ -239,7 +249,7 @@
}
}, [p, childElm, href, as, router]);
- var { children, replace, shallow, scroll } = props; // Deprecated. Warning shown by propType check. If the children provided is a string (<Link>example</Link>) we wrap it in an <a> tag+ var { children, replace, shallow, scroll, locale } = props; // Deprecated. Warning shown by propType check. If the children provided is a string (<Link>example</Link>) we wrap it in an <a> tag
if (typeof children === "string") {
children = /*#__PURE__*/ _react.default.createElement(
@@ -268,7 +278,16 @@
}
if (!e.defaultPrevented) {
- linkClicked(e, router, href, as, replace, shallow, scroll);+ linkClicked(+ e,+ router,+ href,+ as,+ replace,+ shallow,+ scroll,+ locale+ );
}
}
};
@@ -295,7 +314,7 @@
childProps.href = (0, _router.addBasePath)(
(0, _router.addLocale)(
as,
- router && router.locale,+ locale || (router && router.locale),
router && router.defaultLocale
)
);
Diff for link-67e8576..0c009f99f.js
@@ -165,7 +165,16 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
);
}
- function linkClicked(e, router, href, as, replace, shallow, scroll) {+ function linkClicked(+ e,+ router,+ href,+ as,+ replace,+ shallow,+ scroll,+ locale+ ) {
var nodeName = e.currentTarget.nodeName;
if (
@@ -183,7 +192,8 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
} // replace state instead of push if prop is present
router[replace ? "replace" : "push"](href, as, {
- shallow: shallow+ shallow: shallow,+ locale: locale
}).then(function(success) {
if (!success) return;
@@ -258,7 +268,8 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
var children = props.children,
replace = props.replace,
shallow = props.shallow,
- scroll = props.scroll; // Deprecated. Warning shown by propType check. If the children provided is a string (<Link>example</Link>) we wrap it in an <a> tag+ scroll = props.scroll,+ locale = props.locale; // Deprecated. Warning shown by propType check. If the children provided is a string (<Link>example</Link>) we wrap it in an <a> tag
if (typeof children === "string") {
children = /*#__PURE__*/ _react["default"].createElement(
@@ -287,7 +298,16 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
}
if (!e.defaultPrevented) {
- linkClicked(e, router, href, as, replace, shallow, scroll);+ linkClicked(+ e,+ router,+ href,+ as,+ replace,+ shallow,+ scroll,+ locale+ );
}
}
};
@@ -314,7 +334,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
childProps.href = (0, _router.addBasePath)(
(0, _router.addLocale)(
as,
- router && router.locale,+ locale || (router && router.locale),
router && router.defaultLocale
)
);
Diff for 677f882d2ed8..4eeebf399.js
@@ -936,6 +936,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
var manualScrollRestoration = false && false;
+ var SSG_DATA_NOT_FOUND_ERROR = "SSG Data NOT_FOUND";
function fetchRetry(url, attempts) {
return fetch(url, {
@@ -957,6 +958,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return fetchRetry(url, attempts - 1);
}
+ if (res.status === 404) {+ // TODO: handle reloading in development from fallback returning 200+ // to on-demand-entry-handler causing it to reload periodically+ throw new Error(SSG_DATA_NOT_FOUND_ERROR);+ }+
throw new Error("Failed to load static props");
}
@@ -971,7 +978,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// We should only trigger a server-side transition if this was caused
// on a client-side transition. Otherwise, we'd get into an infinite
// loop.
- if (!isServerRender) {+ if (!isServerRender || err.message === "SSG Data NOT_FOUND") {
markLoadingError(err);
}
@@ -1280,6 +1287,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return _context.abrupt("return", false);
case 3:
+ this.locale = options.locale || this.locale;+
if (!options._h) {
this.isSsr = false;
} // marking route changes as a navigation start entry
@@ -1306,7 +1315,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (
!(!options._h && this.onlyAHashChange(cleanedAs))
) {
- _context.next = 17;+ _context.next = 18;
break;
}
@@ -1319,16 +1328,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Router.events.emit("hashChangeComplete", as);
return _context.abrupt("return", true);
- case 17:- _context.next = 19;+ case 18:+ _context.next = 20;
return this.pageLoader.getPageList();
- case 19:+ case 20:
pages = _context.sent;
- _context.next = 22;+ _context.next = 23;
return this.pageLoader.promisedBuildManifest;
- case 22:+ case 23:
_yield$this$pageLoade = _context.sent;
rewrites = _yield$this$pageLoade.__rewrites;
parsed = (0, _parseRelativeUrl.parseRelativeUrl)(
@@ -1383,7 +1392,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
if (!(0, _isDynamic.isDynamicRoute)(route)) {
- _context.next = 50;+ _context.next = 51;
break;
}
@@ -1406,7 +1415,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
(shouldInterpolate && !interpolatedAs.result)
)
) {
- _context.next = 49;+ _context.next = 50;
break;
}
@@ -1417,7 +1426,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
if (!(missingParams.length > 0)) {
- _context.next = 47;+ _context.next = 48;
break;
}
@@ -1448,11 +1457,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 47:- _context.next = 50;+ case 48:+ _context.next = 51;
break;
- case 49:+ case 50:
if (shouldInterpolate) {
as = (0, _utils.formatWithValidation)(
Object.assign({}, parsedAs, {
@@ -1468,10 +1477,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Object.assign(query, routeMatch);
}
- case 50:+ case 51:
Router.events.emit("routeChangeStart", as);
- _context.prev = 51;- _context.next = 54;+ _context.prev = 52;+ _context.next = 55;
return this.getRouteInfo(
route,
pathname,
@@ -1480,7 +1489,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
shallow
);
- case 54:+ case 55:
routeInfo = _context.sent;
(error = routeInfo.error),
(props = routeInfo.props),
@@ -1495,7 +1504,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
props.pageProps.__N_REDIRECT
)
) {
- _context.next = 65;+ _context.next = 66;
break;
}
@@ -1504,7 +1513,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// it's not
if (!destination.startsWith("/")) {
- _context.next = 63;+ _context.next = 64;
break;
}
@@ -1514,7 +1523,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
this._resolveHref(parsedHref, pages);
if (!pages.includes(parsedHref.pathname)) {
- _context.next = 63;+ _context.next = 64;
break;
}
@@ -1528,14 +1537,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 63:+ case 64:
window.location.href = destination;
return _context.abrupt(
"return",
new Promise(function() {})
);
- case 65:+ case 66:
Router.events.emit("beforeHistoryChange", as);
this.changeState(
method,
@@ -1547,7 +1556,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if (false) {
}
- _context.next = 70;+ _context.next = 71;
return this.set(
route,
pathname,
@@ -1559,9 +1568,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
else throw e;
});
- case 70:+ case 71:
if (!error) {
- _context.next = 73;+ _context.next = 74;
break;
}
@@ -1572,28 +1581,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
);
throw error;
- case 73:+ case 74:
if (false) {
}
Router.events.emit("routeChangeComplete", as);
return _context.abrupt("return", true);
- case 78:- _context.prev = 78;- _context.t0 = _context["catch"](51);+ case 79:+ _context.prev = 79;+ _context.t0 = _context["catch"](52);
if (!_context.t0.cancelled) {
- _context.next = 82;+ _context.next = 83;
break;
}
return _context.abrupt("return", false);
- case 82:+ case 83:
throw _context.t0;
- case 83:+ case 84:
case "end":
return _context.stop();
}
@@ -1601,7 +1610,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
},
_callee,
this,
- [[51, 78]]+ [[52, 79]]
);
})
);
@@ -1668,7 +1677,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
case 2:
if (!(PAGE_LOAD_ERROR in err || loadErrorFail)) {
- _context2.next = 6;+ _context2.next = 7;
break;
}
@@ -1678,17 +1687,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// 3. Internal error while loading the page
// So, doing a hard reload is the proper way to deal with this.
+ if (false) {+ }+
window.location.href = as; // Changing the URL doesn't block executing the current code path.
// So let's throw a cancellation error stop the routing logic.
throw buildCancellationError();
- case 6:- _context2.prev = 6;- _context2.next = 9;+ case 7:+ _context2.prev = 7;+ _context2.next = 10;
return this.fetchComponent("/_error");
- case 9:+ case 10:
_yield$this$fetchComp = _context2.sent;
Component = _yield$this$fetchComp.page;
styleSheets = _yield$this$fetchComp.styleSheets;
@@ -1698,34 +1710,34 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
err: err,
error: err
};
- _context2.prev = 13;- _context2.next = 16;+ _context2.prev = 14;+ _context2.next = 17;
return this.getInitialProps(Component, {
err: err,
pathname: pathname,
query: query
});
- case 16:+ case 17:
routeInfo.props = _context2.sent;
- _context2.next = 23;+ _context2.next = 24;
break;
- case 19:- _context2.prev = 19;- _context2.t0 = _context2["catch"](13);+ case 20:+ _context2.prev = 20;+ _context2.t0 = _context2["catch"](14);
console.error(
"Error in error page `getInitialProps`: ",
_context2.t0
);
routeInfo.props = {};
- case 23:+ case 24:
return _context2.abrupt("return", routeInfo);
- case 26:- _context2.prev = 26;- _context2.t1 = _context2["catch"](6);+ case 27:+ _context2.prev = 27;+ _context2.t1 = _context2["catch"](7);
return _context2.abrupt(
"return",
this.handleRouteInfoError(
@@ -1737,7 +1749,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
)
);
- case 29:+ case 30:
case "end":
return _context2.stop();
}
@@ -1746,8 +1758,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_callee2,
this,
[
- [6, 26],- [13, 19]+ [7, 27],+ [14, 20]
]
);
})
@@ -1879,8 +1891,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}),
delBasePath(as),
__N_SSG,
- this.locale,- this.defaultLocale+ this.locale
);
}
Diff for 677f882d2ed8..20.module.js
@@ -792,6 +792,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
var manualScrollRestoration = false && false;
+ var SSG_DATA_NOT_FOUND_ERROR = "SSG Data NOT_FOUND";
function fetchRetry(url, attempts) {
return fetch(url, {
@@ -813,6 +814,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return fetchRetry(url, attempts - 1);
}
+ if (res.status === 404) {+ // TODO: handle reloading in development from fallback returning 200+ // to on-demand-entry-handler causing it to reload periodically+ throw new Error(SSG_DATA_NOT_FOUND_ERROR);+ }+
throw new Error("Failed to load static props");
}
@@ -825,7 +832,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// We should only trigger a server-side transition if this was caused
// on a client-side transition. Otherwise, we'd get into an infinite
// loop.
- if (!isServerRender) {+ if (!isServerRender || err.message === "SSG Data NOT_FOUND") {
markLoadingError(err);
}
@@ -1060,6 +1067,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return false;
}
+ this.locale = options.locale || this.locale;+
if (!options._h) {
this.isSsr = false;
} // marking route changes as a navigation start entry
@@ -1313,6 +1322,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// 3. Internal error while loading the page
// So, doing a hard reload is the proper way to deal with this.
+ if (false) {+ }+
window.location.href = as; // Changing the URL doesn't block executing the current code path.
// So let's throw a cancellation error stop the routing logic.
@@ -1390,8 +1402,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}),
delBasePath(as),
__N_SSG,
- this.locale,- this.defaultLocale+ this.locale
);
}
Diff for main-8e73dd2..68413e28f.js
@@ -341,7 +341,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
document.getElementById("__NEXT_DATA__").textContent
);
window.__NEXT_DATA__ = data;
- var version = "9.5.5";+ var version = "9.5.6-canary.10";
exports.version = version;
var hydrateProps = data.props,
hydrateErr = data.err,
@@ -353,9 +353,9 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
dynamicIds = data.dynamicIds,
isFallback = data.isFallback,
initialHeadData = data.head,
- locales = data.locales,+ locales = data.locales;+ var locale = data.locale,
defaultLocale = data.defaultLocale;
- var locale = data.locale;
var prefix = assetPrefix || ""; // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time
// So, this is how we do it in the client side at runtime
@@ -372,10 +372,13 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
asPath = (0, _router.delBasePath)(asPath);
}
- asPath = (0, _router.delLocale)(asPath, locale);-
if (false) {
- var localePathResult, _require, normalizeLocalePath;+ var detectedDomain,+ localePathResult,+ _require2,+ detectDomainLocale,+ _require,+ normalizeLocalePath;
}
var pageLoader = new _pageLoader["default"](buildId, prefix, page);
@@ -502,7 +505,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
if (true) {
return this.props.children;
} else {
- var _require2, ReactDevOverlay;+ var _require3, ReactDevOverlay;
}
}
}
@@ -523,9 +526,9 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
mod,
initialErr,
_yield$pageLoader$loa2,
- _require3,- isValidElementType,
_require4,
+ isValidElementType,+ _require5,
getNodeError,
renderCtx,
_args = arguments;
@@ -602,14 +605,14 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
break;
}
- (_require3 = __webpack_require__(+ (_require4 = __webpack_require__(
!(function webpackMissingModule() {
var e = new Error("Cannot find module 'react-is'");
e.code = "MODULE_NOT_FOUND";
throw e;
})()
)),
- (isValidElementType = _require3.isValidElementType);+ (isValidElementType = _require4.isValidElementType);
if (isValidElementType(CachedComponent)) {
_context.next = 21;
@@ -859,10 +862,6 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
_reactDom["default"].hydrate(reactEl, domEl, markHydrateComplete);
isInitialRender = false;
-- if (onPerfEntry && _utils.ST) {- (0, _performanceRelayer["default"])(onPerfEntry);- }
} else {
_reactDom["default"].render(reactEl, domEl, markRenderComplete);
}
@@ -1159,7 +1158,12 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
window.__NEXT_HYDRATED_CB();
}
}, []);
- }+ } // We should ask to measure the Web Vitals after rendering completes so we+ // don't cause any hydration delay:++ _react["default"].useEffect(function() {+ (0, _performanceRelayer["default"])(onPerfEntry);+ }, []);
return children;
}
@@ -1251,12 +1255,38 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
var _webVitals = __webpack_require__("w6Sm");
+ var initialHref = location.href;+ var isRegistered = false;+ var userReportHandler;++ function onReport(metric) {+ if (userReportHandler) {+ userReportHandler(metric);+ } // This code is not shipped, executed, or present in the client-side+ // JavaScript bundle unless explicitly enabled in your application.+ //+ // When this feature is enabled, we'll make it very clear by printing a+ // message during the build (`next build`).++ if (false) {+ var vitalsUrl, blob, body;+ }+ }+
var _default = function _default(onPerfEntry) {
- (0, _webVitals.getCLS)(onPerfEntry);- (0, _webVitals.getFID)(onPerfEntry);- (0, _webVitals.getFCP)(onPerfEntry);- (0, _webVitals.getLCP)(onPerfEntry);- (0, _webVitals.getTTFB)(onPerfEntry);+ // Update function if it changes:+ userReportHandler = onPerfEntry; // Only register listeners once:++ if (isRegistered) {+ return;+ }++ isRegistered = true;+ (0, _webVitals.getCLS)(onReport);+ (0, _webVitals.getFID)(onReport);+ (0, _webVitals.getFCP)(onReport);+ (0, _webVitals.getLCP)(onReport);+ (0, _webVitals.getTTFB)(onReport);
};
exports["default"] = _default;
@@ -1565,6 +1595,10 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
/***/ zmvN: /***/ function(module, exports, __webpack_require__) {
"use strict";
+ var _regeneratorRuntime = __webpack_require__("o0o1");++ var _asyncToGenerator = __webpack_require__("yXPU");+
var _classCallCheck = __webpack_require__("lwsE");
var _createClass = __webpack_require__("W8MJ");
@@ -1746,13 +1780,13 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
{
key: "getDependencies",
value: function getDependencies(route) {
- var _this = this;+ var _this2 = this;
return this.promisedBuildManifest.then(function(m) {
return m[route]
? m[route].map(function(url) {
return ""
- .concat(_this.assetPrefix, "/_next/")+ .concat(_this2.assetPrefix, "/_next/")
.concat(encodeURI(url));
})
: Promise.reject(pageLoadError(route));
@@ -1765,14 +1799,8 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
},
{
key: "getDataHref",
- value: function getDataHref(- href,- asPath,- ssg,- locale,- defaultLocale- ) {- var _this2 = this;+ value: function getDataHref(href, asPath, ssg, locale) {+ var _this3 = this;
var _ref = (0, _parseRelativeUrl.parseRelativeUrl)(href),
hrefPathname = _ref.pathname,
@@ -1787,12 +1815,11 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
var getHrefForSlug = function getHrefForSlug(path) {
var dataRoute = (0, _router.addLocale)(
(0, _getAssetPathFromRoute["default"])(path, ".json"),
- locale,- defaultLocale+ locale
);
return (0, _router.addBasePath)(
"/_next/data/"
- .concat(_this2.buildId)+ .concat(_this3.buildId)
.concat(dataRoute)
.concat(ssg ? "" : search)
);
@@ -1814,8 +1841,8 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
},
{
key: "prefetchData",
- value: function prefetchData(href, asPath, locale, defaultLocale) {- var _this3 = this;+ value: function prefetchData(href, asPath, locale) {+ var _this4 = this;
var _ref3 = (0, _parseRelativeUrl.parseRelativeUrl)(href),
hrefPathname = _ref3.pathname;
@@ -1825,12 +1852,11 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
return (
// Check if the route requires a data file
s.has(route) && // Try to generate data href, noop when falsy
- (_dataHref = _this3.getDataHref(+ (_dataHref = _this4.getDataHref(
href,
asPath,
true,
- locale,- defaultLocale+ locale
)) && // noop when data has already been prefetched (dedupe)
!document.querySelector(
'link[rel="'
@@ -1849,12 +1875,12 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
{
key: "loadPage",
value: function loadPage(route) {
- var _this4 = this;+ var _this5 = this;
route = normalizeRoute(route);
return new Promise(function(resolve, reject) {
// If there's a cached version of the page, let's use it.
- var cachedPage = _this4.pageCache[route];+ var cachedPage = _this5.pageCache[route];
if (cachedPage) {
if ("error" in cachedPage) {
@@ -1867,9 +1893,9 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
}
var fire = function fire(pageToCache) {
- _this4.pageRegisterEvents.off(route, fire);+ _this5.pageRegisterEvents.off(route, fire);- delete _this4.loadingRoutes[route];+ delete _this5.loadingRoutes[route];
if ("error" in pageToCache) {
reject(pageToCache.error);
@@ -1878,13 +1904,13 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
}
}; // Register a listener to get the page
- _this4.pageRegisterEvents.on(route, fire);+ _this5.pageRegisterEvents.on(route, fire);- if (!_this4.loadingRoutes[route]) {- _this4.loadingRoutes[route] = true;+ if (!_this5.loadingRoutes[route]) {+ _this5.loadingRoutes[route] = true;
if (true) {
- _this4+ _this5
.getDependencies(route)
.then(function(deps) {
var pending = [];
@@ -1926,7 +1952,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
["catch"](function(err) {
// Mark the page as failed to load if any of its required scripts
// fail to load:
- _this4.pageCache[route] = {+ _this5.pageCache[route] = {
error: err
};
fire({
@@ -1943,29 +1969,69 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
{
key: "registerPage",
value: function registerPage(route, regFn) {
- var _this5 = this;+ var _this6 = this;- var register = function register(styleSheets) {- try {- var mod = regFn();- var pageData = {- page: mod["default"] || mod,- mod: mod,- styleSheets: styleSheets- };- _this5.pageCache[route] = pageData;+ var _this = this;- _this5.pageRegisterEvents.emit(route, pageData);- } catch (error) {- _this5.pageCache[route] = {- error: error- };+ var register = /*#__PURE__*/ (function() {+ var _register = _asyncToGenerator(+ /*#__PURE__*/ _regeneratorRuntime.mark(function _callee(+ styleSheets+ ) {+ var mod, pageData;+ return _regeneratorRuntime.wrap(+ function _callee$(_context) {+ while (1) {+ switch ((_context.prev = _context.next)) {+ case 0:+ _context.prev = 0;+ _context.next = 3;+ return regFn();++ case 3:+ mod = _context.sent;+ pageData = {+ page: mod["default"] || mod,+ mod: mod,+ styleSheets: styleSheets+ };+ _this.pageCache[route] = pageData;++ _this.pageRegisterEvents.emit(route, pageData);++ _context.next = 13;+ break;++ case 9:+ _context.prev = 9;+ _context.t0 = _context["catch"](0);+ _this.pageCache[route] = {+ error: _context.t0+ };++ _this.pageRegisterEvents.emit(route, {+ error: _context.t0+ });++ case 13:+ case "end":+ return _context.stop();+ }+ }+ },+ _callee,+ null,+ [[0, 9]]+ );+ })+ );- _this5.pageRegisterEvents.emit(route, {- error: error- });+ function register(_x) {+ return _register.apply(this, arguments);
}
- };++ return register;+ })();
if (false) {
var check;
@@ -2020,11 +2086,11 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
return register(deps);
},
function(error) {
- _this5.pageCache[route] = {+ _this6.pageCache[route] = {
error: error
};
- _this5.pageRegisterEvents.emit(route, {+ _this6.pageRegisterEvents.emit(route, {
error: error
});
}
@@ -2038,7 +2104,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
{
key: "prefetch",
value: function prefetch(route, isDependency) {
- var _this6 = this;+ var _this7 = this;
// https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118
// License: Apache 2.0
@@ -2080,7 +2146,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
this.getDependencies(route).then(function(urls) {
return Promise.all(
urls.map(function(dependencyUrl) {
- return _this6.prefetch(dependencyUrl, true);+ return _this7.prefetch(dependencyUrl, true);
})
);
})
Diff for main-f21a93d..8d.module.js
@@ -258,7 +258,7 @@
document.getElementById("__NEXT_DATA__").textContent
);
window.__NEXT_DATA__ = data;
- var version = "9.5.5";+ var version = "9.5.6-canary.10";
exports.version = version;
var {
props: hydrateProps,
@@ -271,10 +271,9 @@
dynamicIds,
isFallback,
head: initialHeadData,
- locales,- defaultLocale+ locales
} = data;
- var { locale } = data;+ var { locale, defaultLocale } = data;
var prefix = assetPrefix || ""; // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time
// So, this is how we do it in the client side at runtime
@@ -291,10 +290,11 @@
asPath = (0, _router.delBasePath)(asPath);
}
- asPath = (0, _router.delLocale)(asPath, locale);-
if (false) {
- var localePathResult, normalizeLocalePath;+ var detectedDomain,+ localePathResult,+ detectDomainLocale,+ normalizeLocalePath;
}
var pageLoader = new _pageLoader.default(buildId, prefix, page);
@@ -605,10 +605,6 @@
_reactDom.default.hydrate(reactEl, domEl, markHydrateComplete);
isInitialRender = false;
-- if (onPerfEntry && _utils.ST) {- (0, _performanceRelayer.default)(onPerfEntry);- }
} else {
_reactDom.default.render(reactEl, domEl, markRenderComplete);
}
@@ -882,7 +878,12 @@
window.__NEXT_HYDRATED_CB();
}
}, []);
- }+ } // We should ask to measure the Web Vitals after rendering completes so we+ // don't cause any hydration delay:++ _react.default.useEffect(() => {+ (0, _performanceRelayer.default)(onPerfEntry);+ }, []);
return children;
}
@@ -922,12 +923,38 @@
var _webVitals = __webpack_require__("w6Sm");
+ var initialHref = location.href;+ var isRegistered = false;+ var userReportHandler;++ function onReport(metric) {+ if (userReportHandler) {+ userReportHandler(metric);+ } // This code is not shipped, executed, or present in the client-side+ // JavaScript bundle unless explicitly enabled in your application.+ //+ // When this feature is enabled, we'll make it very clear by printing a+ // message during the build (`next build`).++ if (false) {+ var vitalsUrl, blob, body;+ }+ }+
var _default = onPerfEntry => {
- (0, _webVitals.getCLS)(onPerfEntry);- (0, _webVitals.getFID)(onPerfEntry);- (0, _webVitals.getFCP)(onPerfEntry);- (0, _webVitals.getLCP)(onPerfEntry);- (0, _webVitals.getTTFB)(onPerfEntry);+ // Update function if it changes:+ userReportHandler = onPerfEntry; // Only register listeners once:++ if (isRegistered) {+ return;+ }++ isRegistered = true;+ (0, _webVitals.getCLS)(onReport);+ (0, _webVitals.getFID)(onReport);+ (0, _webVitals.getFCP)(onReport);+ (0, _webVitals.getLCP)(onReport);+ (0, _webVitals.getTTFB)(onReport);
};
exports.default = _default;
@@ -1410,7 +1437,7 @@
* @param {string} asPath the URL as shown in browser (virtual path); used for dynamic routes
*/
- getDataHref(href, asPath, ssg, locale, defaultLocale) {+ getDataHref(href, asPath, ssg, locale) {
var { pathname: hrefPathname, query, search } = (0,
_parseRelativeUrl.parseRelativeUrl)(href);
var { pathname: asPathname } = (0,
@@ -1420,8 +1447,7 @@
var getHrefForSlug = path => {
var dataRoute = (0, _router.addLocale)(
(0, _getAssetPathFromRoute.default)(path, ".json"),
- locale,- defaultLocale+ locale
);
return (0, _router.addBasePath)(
"/_next/data/"
@@ -1444,7 +1470,7 @@
* @param {string} asPath the URL as shown in browser (virtual path); used for dynamic routes
*/
- prefetchData(href, asPath, locale, defaultLocale) {+ prefetchData(href, asPath, locale) {
var { pathname: hrefPathname } = (0,
_parseRelativeUrl.parseRelativeUrl)(href);
var route = normalizeRoute(hrefPathname);
@@ -1454,13 +1480,7 @@
_dataHref // Check if the route requires a data file
) =>
s.has(route) && // Try to generate data href, noop when falsy
- (_dataHref = this.getDataHref(- href,- asPath,- true,- locale,- defaultLocale- )) && // noop when data has already been prefetched (dedupe)+ (_dataHref = this.getDataHref(href, asPath, true, locale)) && // noop when data has already been prefetched (dedupe)
!document.querySelector(
'link[rel="'
.concat(relPrefetch, '"][href^="')
@@ -1557,21 +1577,25 @@
} // This method if called by the route code.
registerPage(route, regFn) {
- var register = styleSheets => {+ var _this = this;++ var register = async function register(styleSheets) {
try {
- var mod = regFn();+ var mod = await regFn();
var pageData = {
page: mod.default || mod,
mod,
styleSheets
};
- this.pageCache[route] = pageData;- this.pageRegisterEvents.emit(route, pageData);+ _this.pageCache[route] = pageData;++ _this.pageRegisterEvents.emit(route, pageData);
} catch (error) {
- this.pageCache[route] = {+ _this.pageCache[route] = {
error
};
- this.pageRegisterEvents.emit(route, {++ _this.pageRegisterEvents.emit(route, {
error
});
}
755934d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stats from current release
Default Server Mode (Increase detected⚠️ )
General Overall increase⚠️
Page Load Tests Overall increase ✓
Client Bundles (main, webpack, commons) Overall increase⚠️
Client Bundles (main, webpack, commons) Modern Overall increase⚠️
Legacy Client Bundles (polyfills)
Client Pages Overall increase⚠️
Client Pages Modern Overall increase⚠️
Client Build Manifests Overall decrease ✓
Rendered Page Sizes Overall decrease ✓
Diffs
Diff for _buildManifest.js
Diff for _buildManifest.module.js
Diff for link-1de2ef9..f2.module.js
Diff for link-67e8576..0c009f99f.js
Diff for 677f882d2ed8..4eeebf399.js
Diff for 677f882d2ed8..20.module.js
Diff for main-8e73dd2..68413e28f.js
Diff for main-f21a93d..8d.module.js
Diff for index.html
Diff for link.html
Diff for withRouter.html
Serverless Mode (Increase detected⚠️ )
General Overall increase⚠️
Client Bundles (main, webpack, commons) Overall increase⚠️
Client Bundles (main, webpack, commons) Modern Overall increase⚠️
Legacy Client Bundles (polyfills)
Client Pages Overall increase⚠️
Client Pages Modern Overall increase⚠️
Client Build Manifests Overall decrease ✓
Serverless bundles Overall increase⚠️