-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust SSG Loading Behavior #10510
Merged
Merged
Adjust SSG Loading Behavior #10510
Conversation
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
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 11.4s | 11.1s | -249ms |
nodeModulesSize | 52.9 MB | 52.9 MB | -2.3 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..b50f.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -156 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | 12.4 kB | -149 B |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 62.1 kB | 62 kB | -149 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
index.html gzip | 1.03 kB | 1.04 kB | |
link.html gzip | 1.04 kB | 1.04 kB | |
withRouter.html gzip | 1.03 kB | 1.03 kB | |
Overall change | 3.11 kB | 3.12 kB |
Diffs
Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for main-HASH.module.js
@@ -285,9 +285,10 @@ class Container extends _react.default.Component {
componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -297,6 +298,10 @@ class Container extends _react.default.Component {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for main-HASH.js
@@ -380,9 +380,10 @@ function (_react$default$Compon) {
value: function componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -392,6 +393,10 @@ function (_react$default$Compon) {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for de003c3a9d30..c7.module.js
@@ -1480,14 +1480,16 @@ var fetchNextData = (pathname, query, cb) => {
query
})).then(res => {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(data => {
return cb ? cb(data) : data;
+ }).catch(err => {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ throw err;
});
};
@@ -1763,57 +1765,28 @@ class Router {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
this.getRouteInfo(route, pathname, query, as, shallow).then(routeInfo => {
- var emitHistory = false;
-
- var doRouteChange = (routeInfo, complete) => {
- var {
- error
- } = routeInfo;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
- this.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
-
- this.set(route, pathname, query, as, routeInfo);
+ var {
+ error
+ } = routeInfo;
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ Router.events.emit('beforeHistoryChange', as);
+ this.changeState(method, url, addBasePath(as), options);
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
+ if (false) { var appComp; }
- _Promise.race([new _Promise(resolve => setTimeout(() => resolve(false), 110)), dataRes]).then(data => {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ this.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(finalData => {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1857,40 +1830,16 @@ class Router {
if (false) { var isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = props => {
- routeInfo.props = props;
- this.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = () => isSSG ? this._getStaticData(as) : this._getServerData(as);
-
- var retry = error => {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: this._getData(() => dataMethod() // we retry for data twice unless we get a 404
- .catch(retry).catch(retry).then(props => handleData(props)))
- }));
- }
-
- return this._getData(() => this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return this._getData(() => Component.__N_SSG ? this._getStaticData(as) : Component.__N_SSP ? this._getServerData(as) : this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
asPath: as
- })).then(props => handleData(props));
+ })).then(props => {
+ routeInfo.props = props;
+ this.components[route] = routeInfo;
+ return routeInfo;
+ });
}).catch(err => {
return new _Promise(resolve => {
if (err.code === 'PAGE_LOAD_ERROR') {
Diff for de003c3a9d30..f46cabb19.js
@@ -1200,14 +1200,16 @@ var fetchNextData = function fetchNextData(pathname, query, cb) {
query: query
})).then(function (res) {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(function (data) {
return cb ? cb(data) : data;
+ })["catch"](function (err) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ throw err;
});
};
@@ -1496,60 +1498,27 @@ function () {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
_this2.getRouteInfo(route, pathname, query, as, shallow).then(function (routeInfo) {
- var emitHistory = false;
+ var error = routeInfo.error;
- var doRouteChange = function doRouteChange(routeInfo, complete) {
- var error = routeInfo.error;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
-
- _this2.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- _this2.set(route, pathname, query, as, routeInfo);
+ Router.events.emit('beforeHistoryChange', as);
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ _this2.changeState(method, url, addBasePath(as), options);
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ if (false) { var appComp; }
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
-
- _Promise.race([new _Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(false);
- }, 110);
- }), dataRes]).then(function (data) {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ _this2.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(function (finalData) {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1597,49 +1566,17 @@ function () {
if (false) { var _require, isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = function handleData(props) {
- routeInfo.props = props;
- _this3.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = function dataMethod() {
- return isSSG ? _this3._getStaticData(as) : _this3._getServerData(as);
- };
-
- var retry = function retry(error) {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: _this3._getData(function () {
- return dataMethod() // we retry for data twice unless we get a 404
- ["catch"](retry)["catch"](retry).then(function (props) {
- return handleData(props);
- });
- })
- }));
- }
-
return _this3._getData(function () {
- return _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return Component.__N_SSG ? _this3._getStaticData(as) : Component.__N_SSP ? _this3._getServerData(as) : _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname: pathname,
query: query,
asPath: as
});
}).then(function (props) {
- return handleData(props);
+ routeInfo.props = props;
+ _this3.components[route] = routeInfo;
+ return routeInfo;
});
})["catch"](function (err) {
return new _Promise(function (resolve) {
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 12.2s | 12.1s | -107ms |
nodeModulesSize | 52.9 MB | 52.9 MB | -2.3 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..b50f.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -156 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.4 kB | N/A |
Overall change | 62.1 kB | 62 kB | -149 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_error.js gzip | 289 kB | 289 kB | |
404.html gzip | 1.45 kB | 1.45 kB | ✓ |
hooks.html gzip | 1.08 kB | 1.08 kB | |
index.js gzip | 289 kB | 290 kB | |
link.js gzip | 320 kB | 318 kB | -1.97 kB |
routerDirect.js gzip | 317 kB | 316 kB | -116 B |
withRouter.js gzip | 317 kB | 316 kB | -353 B |
Overall change | 1.53 MB | 1.53 MB | -1.89 kB |
Commit: 40d64ea
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 12.1s | 12.6s | |
nodeModulesSize | 52.9 MB | 52.9 MB | -2.13 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..b50f.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -156 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | 12.4 kB | -149 B |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 62.1 kB | 62 kB | -149 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
index.html gzip | 1.03 kB | 1.04 kB | |
link.html gzip | 1.04 kB | 1.04 kB | |
withRouter.html gzip | 1.03 kB | 1.03 kB | |
Overall change | 3.11 kB | 3.12 kB |
Diffs
Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for main-HASH.module.js
@@ -285,9 +285,10 @@ class Container extends _react.default.Component {
componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -297,6 +298,10 @@ class Container extends _react.default.Component {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for main-HASH.js
@@ -380,9 +380,10 @@ function (_react$default$Compon) {
value: function componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -392,6 +393,10 @@ function (_react$default$Compon) {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for de003c3a9d30..c7.module.js
@@ -1480,14 +1480,16 @@ var fetchNextData = (pathname, query, cb) => {
query
})).then(res => {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(data => {
return cb ? cb(data) : data;
+ }).catch(err => {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ throw err;
});
};
@@ -1763,57 +1765,28 @@ class Router {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
this.getRouteInfo(route, pathname, query, as, shallow).then(routeInfo => {
- var emitHistory = false;
-
- var doRouteChange = (routeInfo, complete) => {
- var {
- error
- } = routeInfo;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
- this.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
-
- this.set(route, pathname, query, as, routeInfo);
+ var {
+ error
+ } = routeInfo;
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ Router.events.emit('beforeHistoryChange', as);
+ this.changeState(method, url, addBasePath(as), options);
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
+ if (false) { var appComp; }
- _Promise.race([new _Promise(resolve => setTimeout(() => resolve(false), 110)), dataRes]).then(data => {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ this.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(finalData => {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1857,40 +1830,16 @@ class Router {
if (false) { var isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = props => {
- routeInfo.props = props;
- this.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = () => isSSG ? this._getStaticData(as) : this._getServerData(as);
-
- var retry = error => {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: this._getData(() => dataMethod() // we retry for data twice unless we get a 404
- .catch(retry).catch(retry).then(props => handleData(props)))
- }));
- }
-
- return this._getData(() => this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return this._getData(() => Component.__N_SSG ? this._getStaticData(as) : Component.__N_SSP ? this._getServerData(as) : this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
asPath: as
- })).then(props => handleData(props));
+ })).then(props => {
+ routeInfo.props = props;
+ this.components[route] = routeInfo;
+ return routeInfo;
+ });
}).catch(err => {
return new _Promise(resolve => {
if (err.code === 'PAGE_LOAD_ERROR') {
Diff for de003c3a9d30..f46cabb19.js
@@ -1200,14 +1200,16 @@ var fetchNextData = function fetchNextData(pathname, query, cb) {
query: query
})).then(function (res) {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(function (data) {
return cb ? cb(data) : data;
+ })["catch"](function (err) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ throw err;
});
};
@@ -1496,60 +1498,27 @@ function () {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
_this2.getRouteInfo(route, pathname, query, as, shallow).then(function (routeInfo) {
- var emitHistory = false;
+ var error = routeInfo.error;
- var doRouteChange = function doRouteChange(routeInfo, complete) {
- var error = routeInfo.error;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
-
- _this2.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- _this2.set(route, pathname, query, as, routeInfo);
+ Router.events.emit('beforeHistoryChange', as);
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ _this2.changeState(method, url, addBasePath(as), options);
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ if (false) { var appComp; }
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
-
- _Promise.race([new _Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(false);
- }, 110);
- }), dataRes]).then(function (data) {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ _this2.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(function (finalData) {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1597,49 +1566,17 @@ function () {
if (false) { var _require, isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = function handleData(props) {
- routeInfo.props = props;
- _this3.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = function dataMethod() {
- return isSSG ? _this3._getStaticData(as) : _this3._getServerData(as);
- };
-
- var retry = function retry(error) {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: _this3._getData(function () {
- return dataMethod() // we retry for data twice unless we get a 404
- ["catch"](retry)["catch"](retry).then(function (props) {
- return handleData(props);
- });
- })
- }));
- }
-
return _this3._getData(function () {
- return _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return Component.__N_SSG ? _this3._getStaticData(as) : Component.__N_SSP ? _this3._getServerData(as) : _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname: pathname,
query: query,
asPath: as
});
}).then(function (props) {
- return handleData(props);
+ routeInfo.props = props;
+ _this3.components[route] = routeInfo;
+ return routeInfo;
});
})["catch"](function (err) {
return new _Promise(function (resolve) {
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 13s | 13.4s | |
nodeModulesSize | 52.9 MB | 52.9 MB | -2.3 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..b50f.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -156 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.4 kB | N/A |
Overall change | 62.1 kB | 62 kB | -149 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_error.js gzip | 289 kB | 289 kB | -57 B |
404.html gzip | 1.45 kB | 1.45 kB | ✓ |
hooks.html gzip | 1.08 kB | 1.08 kB | |
index.js gzip | 289 kB | 289 kB | |
link.js gzip | 319 kB | 318 kB | -1.09 kB |
routerDirect.js gzip | 317 kB | 315 kB | -1.91 kB |
withRouter.js gzip | 316 kB | 316 kB | -393 B |
Overall change | 1.53 MB | 1.53 MB | -3.39 kB |
Commit: 8a87edf
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 12.9s | 13.2s | |
nodeModulesSize | 52.9 MB | 52.9 MB | -1.91 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..b50f.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -156 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | 12.4 kB | -149 B |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 62.1 kB | 62 kB | -149 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
index.html gzip | 1.03 kB | 1.04 kB | |
link.html gzip | 1.04 kB | 1.04 kB | |
withRouter.html gzip | 1.03 kB | 1.03 kB | |
Overall change | 3.11 kB | 3.12 kB |
Diffs
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for main-HASH.module.js
@@ -285,9 +285,10 @@ class Container extends _react.default.Component {
componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -297,6 +298,10 @@ class Container extends _react.default.Component {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for main-HASH.js
@@ -380,9 +380,10 @@ function (_react$default$Compon) {
value: function componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -392,6 +393,10 @@ function (_react$default$Compon) {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for de003c3a9d30..c7.module.js
@@ -1480,14 +1480,16 @@ var fetchNextData = (pathname, query, cb) => {
query
})).then(res => {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(data => {
return cb ? cb(data) : data;
+ }).catch(err => {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ throw err;
});
};
@@ -1763,57 +1765,28 @@ class Router {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
this.getRouteInfo(route, pathname, query, as, shallow).then(routeInfo => {
- var emitHistory = false;
-
- var doRouteChange = (routeInfo, complete) => {
- var {
- error
- } = routeInfo;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
- this.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
-
- this.set(route, pathname, query, as, routeInfo);
+ var {
+ error
+ } = routeInfo;
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ Router.events.emit('beforeHistoryChange', as);
+ this.changeState(method, url, addBasePath(as), options);
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
+ if (false) { var appComp; }
- _Promise.race([new _Promise(resolve => setTimeout(() => resolve(false), 110)), dataRes]).then(data => {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ this.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(finalData => {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1857,40 +1830,16 @@ class Router {
if (false) { var isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = props => {
- routeInfo.props = props;
- this.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = () => isSSG ? this._getStaticData(as) : this._getServerData(as);
-
- var retry = error => {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: this._getData(() => dataMethod() // we retry for data twice unless we get a 404
- .catch(retry).catch(retry).then(props => handleData(props)))
- }));
- }
-
- return this._getData(() => this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return this._getData(() => Component.__N_SSG ? this._getStaticData(as) : Component.__N_SSP ? this._getServerData(as) : this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
asPath: as
- })).then(props => handleData(props));
+ })).then(props => {
+ routeInfo.props = props;
+ this.components[route] = routeInfo;
+ return routeInfo;
+ });
}).catch(err => {
return new _Promise(resolve => {
if (err.code === 'PAGE_LOAD_ERROR') {
Diff for de003c3a9d30..f46cabb19.js
@@ -1200,14 +1200,16 @@ var fetchNextData = function fetchNextData(pathname, query, cb) {
query: query
})).then(function (res) {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(function (data) {
return cb ? cb(data) : data;
+ })["catch"](function (err) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ throw err;
});
};
@@ -1496,60 +1498,27 @@ function () {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
_this2.getRouteInfo(route, pathname, query, as, shallow).then(function (routeInfo) {
- var emitHistory = false;
+ var error = routeInfo.error;
- var doRouteChange = function doRouteChange(routeInfo, complete) {
- var error = routeInfo.error;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
-
- _this2.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- _this2.set(route, pathname, query, as, routeInfo);
+ Router.events.emit('beforeHistoryChange', as);
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ _this2.changeState(method, url, addBasePath(as), options);
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ if (false) { var appComp; }
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
-
- _Promise.race([new _Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(false);
- }, 110);
- }), dataRes]).then(function (data) {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ _this2.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(function (finalData) {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1597,49 +1566,17 @@ function () {
if (false) { var _require, isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = function handleData(props) {
- routeInfo.props = props;
- _this3.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = function dataMethod() {
- return isSSG ? _this3._getStaticData(as) : _this3._getServerData(as);
- };
-
- var retry = function retry(error) {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: _this3._getData(function () {
- return dataMethod() // we retry for data twice unless we get a 404
- ["catch"](retry)["catch"](retry).then(function (props) {
- return handleData(props);
- });
- })
- }));
- }
-
return _this3._getData(function () {
- return _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return Component.__N_SSG ? _this3._getStaticData(as) : Component.__N_SSP ? _this3._getServerData(as) : _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname: pathname,
query: query,
asPath: as
});
}).then(function (props) {
- return handleData(props);
+ routeInfo.props = props;
+ _this3.components[route] = routeInfo;
+ return routeInfo;
});
})["catch"](function (err) {
return new _Promise(function (resolve) {
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 14.5s | 14s | -428ms |
nodeModulesSize | 52.9 MB | 52.9 MB | -1.91 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..b50f.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -156 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.4 kB | N/A |
Overall change | 62.1 kB | 62 kB | -149 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_error.js gzip | 290 kB | 289 kB | -655 B |
404.html gzip | 1.45 kB | 1.45 kB | ✓ |
hooks.html gzip | 1.08 kB | 1.08 kB | |
index.js gzip | 289 kB | 290 kB | |
link.js gzip | 320 kB | 319 kB | -1.61 kB |
routerDirect.js gzip | 317 kB | 316 kB | -373 B |
withRouter.js gzip | 316 kB | 315 kB | -372 B |
Overall change | 1.53 MB | 1.53 MB | -2.74 kB |
Commit: 2e1042b
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 10.8s | 10.6s | -125ms |
nodeModulesSize | 52.9 MB | 52.9 MB | -1.91 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..b50f.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -156 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | 12.4 kB | -149 B |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
Overall change | 62.1 kB | 62 kB | -149 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Rendered Page Sizes Overall increase ⚠️
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
index.html gzip | 1.03 kB | 1.04 kB | |
link.html gzip | 1.04 kB | 1.04 kB | |
withRouter.html gzip | 1.03 kB | 1.03 kB | |
Overall change | 3.11 kB | 3.12 kB |
Diffs
Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for main-HASH.module.js
@@ -285,9 +285,10 @@ class Container extends _react.default.Component {
componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -297,6 +298,10 @@ class Container extends _react.default.Component {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for main-HASH.js
@@ -380,9 +380,10 @@ function (_react$default$Compon) {
value: function componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -392,6 +393,10 @@ function (_react$default$Compon) {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for de003c3a9d30..c7.module.js
@@ -1480,14 +1480,16 @@ var fetchNextData = (pathname, query, cb) => {
query
})).then(res => {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(data => {
return cb ? cb(data) : data;
+ }).catch(err => {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ throw err;
});
};
@@ -1763,57 +1765,28 @@ class Router {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
this.getRouteInfo(route, pathname, query, as, shallow).then(routeInfo => {
- var emitHistory = false;
-
- var doRouteChange = (routeInfo, complete) => {
- var {
- error
- } = routeInfo;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
- this.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
-
- this.set(route, pathname, query, as, routeInfo);
+ var {
+ error
+ } = routeInfo;
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ Router.events.emit('beforeHistoryChange', as);
+ this.changeState(method, url, addBasePath(as), options);
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
+ if (false) { var appComp; }
- _Promise.race([new _Promise(resolve => setTimeout(() => resolve(false), 110)), dataRes]).then(data => {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ this.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(finalData => {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1857,40 +1830,16 @@ class Router {
if (false) { var isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = props => {
- routeInfo.props = props;
- this.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = () => isSSG ? this._getStaticData(as) : this._getServerData(as);
-
- var retry = error => {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: this._getData(() => dataMethod() // we retry for data twice unless we get a 404
- .catch(retry).catch(retry).then(props => handleData(props)))
- }));
- }
-
- return this._getData(() => this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return this._getData(() => Component.__N_SSG ? this._getStaticData(as) : Component.__N_SSP ? this._getServerData(as) : this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
asPath: as
- })).then(props => handleData(props));
+ })).then(props => {
+ routeInfo.props = props;
+ this.components[route] = routeInfo;
+ return routeInfo;
+ });
}).catch(err => {
return new _Promise(resolve => {
if (err.code === 'PAGE_LOAD_ERROR') {
Diff for de003c3a9d30..f46cabb19.js
@@ -1200,14 +1200,16 @@ var fetchNextData = function fetchNextData(pathname, query, cb) {
query: query
})).then(function (res) {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(function (data) {
return cb ? cb(data) : data;
+ })["catch"](function (err) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ throw err;
});
};
@@ -1496,60 +1498,27 @@ function () {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
_this2.getRouteInfo(route, pathname, query, as, shallow).then(function (routeInfo) {
- var emitHistory = false;
+ var error = routeInfo.error;
- var doRouteChange = function doRouteChange(routeInfo, complete) {
- var error = routeInfo.error;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
-
- _this2.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- _this2.set(route, pathname, query, as, routeInfo);
+ Router.events.emit('beforeHistoryChange', as);
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ _this2.changeState(method, url, addBasePath(as), options);
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ if (false) { var appComp; }
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
-
- _Promise.race([new _Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(false);
- }, 110);
- }), dataRes]).then(function (data) {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ _this2.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(function (finalData) {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1597,49 +1566,17 @@ function () {
if (false) { var _require, isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = function handleData(props) {
- routeInfo.props = props;
- _this3.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = function dataMethod() {
- return isSSG ? _this3._getStaticData(as) : _this3._getServerData(as);
- };
-
- var retry = function retry(error) {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: _this3._getData(function () {
- return dataMethod() // we retry for data twice unless we get a 404
- ["catch"](retry)["catch"](retry).then(function (props) {
- return handleData(props);
- });
- })
- }));
- }
-
return _this3._getData(function () {
- return _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return Component.__N_SSG ? _this3._getStaticData(as) : Component.__N_SSP ? _this3._getServerData(as) : _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname: pathname,
query: query,
asPath: as
});
}).then(function (props) {
- return handleData(props);
+ routeInfo.props = props;
+ _this3.components[route] = routeInfo;
+ return routeInfo;
});
})["catch"](function (err) {
return new _Promise(function (resolve) {
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.10085c0ac2a686f3d49e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.9a4d336620e9148d6529.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 11.5s | 11.4s | -61ms |
nodeModulesSize | 52.9 MB | 52.9 MB | -1.91 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..b50f.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -156 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.4 kB | N/A |
Overall change | 62.1 kB | 62 kB | -149 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_error.js gzip | 290 kB | 289 kB | -905 B |
404.html gzip | 1.45 kB | 1.45 kB | ✓ |
hooks.html gzip | 1.08 kB | 1.08 kB | |
index.js gzip | 289 kB | 290 kB | |
link.js gzip | 320 kB | 319 kB | -791 B |
routerDirect.js gzip | 316 kB | 316 kB | -980 B |
withRouter.js gzip | 316 kB | 316 kB | -47 B |
Overall change | 1.53 MB | 1.53 MB | -1.91 kB |
Commit: 6cb8fb0
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Legacy Client Bundles (polyfills)
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes Overall increase
|
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
index.html gzip | 1.03 kB | 1.04 kB | |
link.html gzip | 1.04 kB | 1.04 kB | |
withRouter.html gzip | 1.03 kB | 1.03 kB | |
Overall change | 3.11 kB | 3.11 kB |
Diffs
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for main-HASH.module.js
@@ -285,9 +285,10 @@ class Container extends _react.default.Component {
componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -297,6 +298,10 @@ class Container extends _react.default.Component {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for main-HASH.js
@@ -380,9 +380,10 @@ function (_react$default$Compon) {
value: function componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -392,6 +393,10 @@ function (_react$default$Compon) {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for de003c3a9d30..c7.module.js
@@ -1473,23 +1473,31 @@ function toRoute(path) {
var prepareRoute = path => toRoute(!path || path === '/' ? '/index' : path);
-var fetchNextData = (pathname, query, cb) => {
+function fetchNextData(pathname, query, isServerRender, cb) {
return fetch(utils_1.formatWithValidation({
// @ts-ignore __NEXT_DATA__
pathname: "/_next/data/".concat(__NEXT_DATA__.buildId).concat(pathname, ".json"),
query
})).then(res => {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(data => {
return cb ? cb(data) : data;
+ }).catch(err => {
+ // 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) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ }
+
+ throw err;
});
-};
+}
class Router {
constructor(pathname, query, as, _ref) {
@@ -1552,7 +1560,7 @@ class Router {
this._getStaticData = asPath => {
var pathname = prepareRoute(url_1.parse(asPath).pathname);
- return true && this.sdc[pathname] ? _Promise.resolve(this.sdc[pathname]) : fetchNextData(pathname, null, data => this.sdc[pathname] = data);
+ return true && this.sdc[pathname] ? _Promise.resolve(this.sdc[pathname]) : fetchNextData(pathname, null, this.isSsr, data => this.sdc[pathname] = data);
};
this._getServerData = asPath => {
@@ -1561,7 +1569,7 @@ class Router {
query
} = url_1.parse(asPath, true);
pathname = prepareRoute(pathname);
- return fetchNextData(pathname, query);
+ return fetchNextData(pathname, query, this.isSsr);
}; // represents the current component key
@@ -1763,57 +1771,28 @@ class Router {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
this.getRouteInfo(route, pathname, query, as, shallow).then(routeInfo => {
- var emitHistory = false;
-
- var doRouteChange = (routeInfo, complete) => {
- var {
- error
- } = routeInfo;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
- this.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
-
- this.set(route, pathname, query, as, routeInfo);
+ var {
+ error
+ } = routeInfo;
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ Router.events.emit('beforeHistoryChange', as);
+ this.changeState(method, url, addBasePath(as), options);
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
+ if (false) { var appComp; }
- _Promise.race([new _Promise(resolve => setTimeout(() => resolve(false), 110)), dataRes]).then(data => {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ this.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(finalData => {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1857,40 +1836,16 @@ class Router {
if (false) { var isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = props => {
- routeInfo.props = props;
- this.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = () => isSSG ? this._getStaticData(as) : this._getServerData(as);
-
- var retry = error => {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: this._getData(() => dataMethod() // we retry for data twice unless we get a 404
- .catch(retry).catch(retry).then(props => handleData(props)))
- }));
- }
-
- return this._getData(() => this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return this._getData(() => Component.__N_SSG ? this._getStaticData(as) : Component.__N_SSP ? this._getServerData(as) : this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
asPath: as
- })).then(props => handleData(props));
+ })).then(props => {
+ routeInfo.props = props;
+ this.components[route] = routeInfo;
+ return routeInfo;
+ });
}).catch(err => {
return new _Promise(resolve => {
if (err.code === 'PAGE_LOAD_ERROR') {
Diff for de003c3a9d30..f46cabb19.js
@@ -1193,23 +1193,31 @@ var prepareRoute = function prepareRoute(path) {
return toRoute(!path || path === '/' ? '/index' : path);
};
-var fetchNextData = function fetchNextData(pathname, query, cb) {
+function fetchNextData(pathname, query, isServerRender, cb) {
return fetch(utils_1.formatWithValidation({
// @ts-ignore __NEXT_DATA__
pathname: "/_next/data/".concat(__NEXT_DATA__.buildId).concat(pathname, ".json"),
query: query
})).then(function (res) {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(function (data) {
return cb ? cb(data) : data;
+ })["catch"](function (err) {
+ // 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) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ }
+
+ throw err;
});
-};
+}
var Router =
/*#__PURE__*/
@@ -1276,7 +1284,7 @@ function () {
this._getStaticData = function (asPath) {
var pathname = prepareRoute(url_1.parse(asPath).pathname);
- return true && _this.sdc[pathname] ? _Promise.resolve(_this.sdc[pathname]) : fetchNextData(pathname, null, function (data) {
+ return true && _this.sdc[pathname] ? _Promise.resolve(_this.sdc[pathname]) : fetchNextData(pathname, null, _this.isSsr, function (data) {
return _this.sdc[pathname] = data;
});
};
@@ -1287,7 +1295,7 @@ function () {
query = _url_1$parse.query;
pathname = prepareRoute(pathname);
- return fetchNextData(pathname, query);
+ return fetchNextData(pathname, query, _this.isSsr);
}; // represents the current component key
@@ -1496,60 +1504,27 @@ function () {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
_this2.getRouteInfo(route, pathname, query, as, shallow).then(function (routeInfo) {
- var emitHistory = false;
-
- var doRouteChange = function doRouteChange(routeInfo, complete) {
- var error = routeInfo.error;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
-
- _this2.changeState(method, url, addBasePath(as), options);
- }
+ var error = routeInfo.error;
- if (false) { var appComp; }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- _this2.set(route, pathname, query, as, routeInfo);
+ Router.events.emit('beforeHistoryChange', as);
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ _this2.changeState(method, url, addBasePath(as), options);
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ if (false) { var appComp; }
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
-
- _Promise.race([new _Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(false);
- }, 110);
- }), dataRes]).then(function (data) {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ _this2.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(function (finalData) {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1597,49 +1572,17 @@ function () {
if (false) { var _require, isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = function handleData(props) {
- routeInfo.props = props;
- _this3.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = function dataMethod() {
- return isSSG ? _this3._getStaticData(as) : _this3._getServerData(as);
- };
-
- var retry = function retry(error) {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: _this3._getData(function () {
- return dataMethod() // we retry for data twice unless we get a 404
- ["catch"](retry)["catch"](retry).then(function (props) {
- return handleData(props);
- });
- })
- }));
- }
-
return _this3._getData(function () {
- return _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return Component.__N_SSG ? _this3._getStaticData(as) : Component.__N_SSP ? _this3._getServerData(as) : _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname: pathname,
query: query,
asPath: as
});
}).then(function (props) {
- return handleData(props);
+ routeInfo.props = props;
+ _this3.components[route] = routeInfo;
+ return routeInfo;
});
})["catch"](function (err) {
return new _Promise(function (resolve) {
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 13.5s | 13.4s | -76ms |
nodeModulesSize | 52.9 MB | 52.9 MB | -1.35 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..7cc8.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -147 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.4 kB | N/A |
Overall change | 62.1 kB | 62 kB | -144 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_error.js gzip | 289 kB | 289 kB | |
404.html gzip | 1.45 kB | 1.44 kB | -3 B |
hooks.html gzip | 1.08 kB | 1.08 kB | -1 B |
index.js gzip | 289 kB | 289 kB | |
link.js gzip | 320 kB | 319 kB | -709 B |
routerDirect.js gzip | 317 kB | 316 kB | -477 B |
withRouter.js gzip | 317 kB | 316 kB | -216 B |
Overall change | 1.53 MB | 1.53 MB | -1.02 kB |
Commit: b142ea9
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Legacy Client Bundles (polyfills)
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes Overall increase
|
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
index.html gzip | 1.03 kB | 1.04 kB | |
link.html gzip | 1.04 kB | 1.04 kB | |
withRouter.html gzip | 1.03 kB | 1.03 kB | |
Overall change | 3.11 kB | 3.11 kB |
Diffs
Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for main-HASH.module.js
@@ -285,9 +285,10 @@ class Container extends _react.default.Component {
componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -297,6 +298,10 @@ class Container extends _react.default.Component {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for main-HASH.js
@@ -380,9 +380,10 @@ function (_react$default$Compon) {
value: function componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -392,6 +393,10 @@ function (_react$default$Compon) {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for de003c3a9d30..c7.module.js
@@ -1473,23 +1473,31 @@ function toRoute(path) {
var prepareRoute = path => toRoute(!path || path === '/' ? '/index' : path);
-var fetchNextData = (pathname, query, cb) => {
+function fetchNextData(pathname, query, isServerRender, cb) {
return fetch(utils_1.formatWithValidation({
// @ts-ignore __NEXT_DATA__
pathname: "/_next/data/".concat(__NEXT_DATA__.buildId).concat(pathname, ".json"),
query
})).then(res => {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(data => {
return cb ? cb(data) : data;
+ }).catch(err => {
+ // 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) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ }
+
+ throw err;
});
-};
+}
class Router {
constructor(pathname, query, as, _ref) {
@@ -1552,7 +1560,7 @@ class Router {
this._getStaticData = asPath => {
var pathname = prepareRoute(url_1.parse(asPath).pathname);
- return true && this.sdc[pathname] ? _Promise.resolve(this.sdc[pathname]) : fetchNextData(pathname, null, data => this.sdc[pathname] = data);
+ return true && this.sdc[pathname] ? _Promise.resolve(this.sdc[pathname]) : fetchNextData(pathname, null, this.isSsr, data => this.sdc[pathname] = data);
};
this._getServerData = asPath => {
@@ -1561,7 +1569,7 @@ class Router {
query
} = url_1.parse(asPath, true);
pathname = prepareRoute(pathname);
- return fetchNextData(pathname, query);
+ return fetchNextData(pathname, query, this.isSsr);
}; // represents the current component key
@@ -1763,57 +1771,28 @@ class Router {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
this.getRouteInfo(route, pathname, query, as, shallow).then(routeInfo => {
- var emitHistory = false;
-
- var doRouteChange = (routeInfo, complete) => {
- var {
- error
- } = routeInfo;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
- this.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
-
- this.set(route, pathname, query, as, routeInfo);
+ var {
+ error
+ } = routeInfo;
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ Router.events.emit('beforeHistoryChange', as);
+ this.changeState(method, url, addBasePath(as), options);
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
+ if (false) { var appComp; }
- _Promise.race([new _Promise(resolve => setTimeout(() => resolve(false), 110)), dataRes]).then(data => {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ this.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(finalData => {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1857,40 +1836,16 @@ class Router {
if (false) { var isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = props => {
- routeInfo.props = props;
- this.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = () => isSSG ? this._getStaticData(as) : this._getServerData(as);
-
- var retry = error => {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: this._getData(() => dataMethod() // we retry for data twice unless we get a 404
- .catch(retry).catch(retry).then(props => handleData(props)))
- }));
- }
-
- return this._getData(() => this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return this._getData(() => Component.__N_SSG ? this._getStaticData(as) : Component.__N_SSP ? this._getServerData(as) : this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
asPath: as
- })).then(props => handleData(props));
+ })).then(props => {
+ routeInfo.props = props;
+ this.components[route] = routeInfo;
+ return routeInfo;
+ });
}).catch(err => {
return new _Promise(resolve => {
if (err.code === 'PAGE_LOAD_ERROR') {
Diff for de003c3a9d30..f46cabb19.js
@@ -1193,23 +1193,31 @@ var prepareRoute = function prepareRoute(path) {
return toRoute(!path || path === '/' ? '/index' : path);
};
-var fetchNextData = function fetchNextData(pathname, query, cb) {
+function fetchNextData(pathname, query, isServerRender, cb) {
return fetch(utils_1.formatWithValidation({
// @ts-ignore __NEXT_DATA__
pathname: "/_next/data/".concat(__NEXT_DATA__.buildId).concat(pathname, ".json"),
query: query
})).then(function (res) {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(function (data) {
return cb ? cb(data) : data;
+ })["catch"](function (err) {
+ // 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) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ }
+
+ throw err;
});
-};
+}
var Router =
/*#__PURE__*/
@@ -1276,7 +1284,7 @@ function () {
this._getStaticData = function (asPath) {
var pathname = prepareRoute(url_1.parse(asPath).pathname);
- return true && _this.sdc[pathname] ? _Promise.resolve(_this.sdc[pathname]) : fetchNextData(pathname, null, function (data) {
+ return true && _this.sdc[pathname] ? _Promise.resolve(_this.sdc[pathname]) : fetchNextData(pathname, null, _this.isSsr, function (data) {
return _this.sdc[pathname] = data;
});
};
@@ -1287,7 +1295,7 @@ function () {
query = _url_1$parse.query;
pathname = prepareRoute(pathname);
- return fetchNextData(pathname, query);
+ return fetchNextData(pathname, query, _this.isSsr);
}; // represents the current component key
@@ -1496,60 +1504,27 @@ function () {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
_this2.getRouteInfo(route, pathname, query, as, shallow).then(function (routeInfo) {
- var emitHistory = false;
-
- var doRouteChange = function doRouteChange(routeInfo, complete) {
- var error = routeInfo.error;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
-
- _this2.changeState(method, url, addBasePath(as), options);
- }
+ var error = routeInfo.error;
- if (false) { var appComp; }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- _this2.set(route, pathname, query, as, routeInfo);
+ Router.events.emit('beforeHistoryChange', as);
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ _this2.changeState(method, url, addBasePath(as), options);
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ if (false) { var appComp; }
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
-
- _Promise.race([new _Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(false);
- }, 110);
- }), dataRes]).then(function (data) {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ _this2.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(function (finalData) {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1597,49 +1572,17 @@ function () {
if (false) { var _require, isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = function handleData(props) {
- routeInfo.props = props;
- _this3.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = function dataMethod() {
- return isSSG ? _this3._getStaticData(as) : _this3._getServerData(as);
- };
-
- var retry = function retry(error) {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: _this3._getData(function () {
- return dataMethod() // we retry for data twice unless we get a 404
- ["catch"](retry)["catch"](retry).then(function (props) {
- return handleData(props);
- });
- })
- }));
- }
-
return _this3._getData(function () {
- return _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return Component.__N_SSG ? _this3._getStaticData(as) : Component.__N_SSP ? _this3._getServerData(as) : _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname: pathname,
query: query,
asPath: as
});
}).then(function (props) {
- return handleData(props);
+ routeInfo.props = props;
+ _this3.components[route] = routeInfo;
+ return routeInfo;
});
})["catch"](function (err) {
return new _Promise(function (resolve) {
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 11.7s | 11.7s | -52ms |
nodeModulesSize | 52.9 MB | 52.9 MB | -1.35 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..7cc8.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -147 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.4 kB | N/A |
Overall change | 62.1 kB | 62 kB | -144 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_error.js gzip | 289 kB | 289 kB | |
404.html gzip | 1.45 kB | 1.44 kB | -3 B |
hooks.html gzip | 1.08 kB | 1.08 kB | -1 B |
index.js gzip | 289 kB | 289 kB | -37 B |
link.js gzip | 320 kB | 319 kB | -701 B |
routerDirect.js gzip | 317 kB | 316 kB | -713 B |
withRouter.js gzip | 316 kB | 316 kB | |
Overall change | 1.53 MB | 1.53 MB | -988 B |
Commit: 65f17fb
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Legacy Client Bundles (polyfills)
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes Overall increase
|
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
index.html gzip | 1.03 kB | 1.04 kB | |
link.html gzip | 1.04 kB | 1.04 kB | |
withRouter.html gzip | 1.03 kB | 1.03 kB | |
Overall change | 3.11 kB | 3.11 kB |
Diffs
Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for main-HASH.module.js
@@ -285,9 +285,10 @@ class Container extends _react.default.Component {
componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -297,6 +298,10 @@ class Container extends _react.default.Component {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for main-HASH.js
@@ -380,9 +380,10 @@ function (_react$default$Compon) {
value: function componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -392,6 +393,10 @@ function (_react$default$Compon) {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for de003c3a9d30..c7.module.js
@@ -1473,23 +1473,31 @@ function toRoute(path) {
var prepareRoute = path => toRoute(!path || path === '/' ? '/index' : path);
-var fetchNextData = (pathname, query, cb) => {
+function fetchNextData(pathname, query, isServerRender, cb) {
return fetch(utils_1.formatWithValidation({
// @ts-ignore __NEXT_DATA__
pathname: "/_next/data/".concat(__NEXT_DATA__.buildId).concat(pathname, ".json"),
query
})).then(res => {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(data => {
return cb ? cb(data) : data;
+ }).catch(err => {
+ // 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) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ }
+
+ throw err;
});
-};
+}
class Router {
constructor(pathname, query, as, _ref) {
@@ -1552,7 +1560,7 @@ class Router {
this._getStaticData = asPath => {
var pathname = prepareRoute(url_1.parse(asPath).pathname);
- return true && this.sdc[pathname] ? _Promise.resolve(this.sdc[pathname]) : fetchNextData(pathname, null, data => this.sdc[pathname] = data);
+ return true && this.sdc[pathname] ? _Promise.resolve(this.sdc[pathname]) : fetchNextData(pathname, null, this.isSsr, data => this.sdc[pathname] = data);
};
this._getServerData = asPath => {
@@ -1561,7 +1569,7 @@ class Router {
query
} = url_1.parse(asPath, true);
pathname = prepareRoute(pathname);
- return fetchNextData(pathname, query);
+ return fetchNextData(pathname, query, this.isSsr);
}; // represents the current component key
@@ -1763,57 +1771,28 @@ class Router {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
this.getRouteInfo(route, pathname, query, as, shallow).then(routeInfo => {
- var emitHistory = false;
-
- var doRouteChange = (routeInfo, complete) => {
- var {
- error
- } = routeInfo;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
- this.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
-
- this.set(route, pathname, query, as, routeInfo);
+ var {
+ error
+ } = routeInfo;
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ Router.events.emit('beforeHistoryChange', as);
+ this.changeState(method, url, addBasePath(as), options);
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
+ if (false) { var appComp; }
- _Promise.race([new _Promise(resolve => setTimeout(() => resolve(false), 110)), dataRes]).then(data => {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ this.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(finalData => {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1857,40 +1836,16 @@ class Router {
if (false) { var isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = props => {
- routeInfo.props = props;
- this.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = () => isSSG ? this._getStaticData(as) : this._getServerData(as);
-
- var retry = error => {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: this._getData(() => dataMethod() // we retry for data twice unless we get a 404
- .catch(retry).catch(retry).then(props => handleData(props)))
- }));
- }
-
- return this._getData(() => this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return this._getData(() => Component.__N_SSG ? this._getStaticData(as) : Component.__N_SSP ? this._getServerData(as) : this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
asPath: as
- })).then(props => handleData(props));
+ })).then(props => {
+ routeInfo.props = props;
+ this.components[route] = routeInfo;
+ return routeInfo;
+ });
}).catch(err => {
return new _Promise(resolve => {
if (err.code === 'PAGE_LOAD_ERROR') {
Diff for de003c3a9d30..f46cabb19.js
@@ -1193,23 +1193,31 @@ var prepareRoute = function prepareRoute(path) {
return toRoute(!path || path === '/' ? '/index' : path);
};
-var fetchNextData = function fetchNextData(pathname, query, cb) {
+function fetchNextData(pathname, query, isServerRender, cb) {
return fetch(utils_1.formatWithValidation({
// @ts-ignore __NEXT_DATA__
pathname: "/_next/data/".concat(__NEXT_DATA__.buildId).concat(pathname, ".json"),
query: query
})).then(function (res) {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(function (data) {
return cb ? cb(data) : data;
+ })["catch"](function (err) {
+ // 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) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ }
+
+ throw err;
});
-};
+}
var Router =
/*#__PURE__*/
@@ -1276,7 +1284,7 @@ function () {
this._getStaticData = function (asPath) {
var pathname = prepareRoute(url_1.parse(asPath).pathname);
- return true && _this.sdc[pathname] ? _Promise.resolve(_this.sdc[pathname]) : fetchNextData(pathname, null, function (data) {
+ return true && _this.sdc[pathname] ? _Promise.resolve(_this.sdc[pathname]) : fetchNextData(pathname, null, _this.isSsr, function (data) {
return _this.sdc[pathname] = data;
});
};
@@ -1287,7 +1295,7 @@ function () {
query = _url_1$parse.query;
pathname = prepareRoute(pathname);
- return fetchNextData(pathname, query);
+ return fetchNextData(pathname, query, _this.isSsr);
}; // represents the current component key
@@ -1496,60 +1504,27 @@ function () {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
_this2.getRouteInfo(route, pathname, query, as, shallow).then(function (routeInfo) {
- var emitHistory = false;
-
- var doRouteChange = function doRouteChange(routeInfo, complete) {
- var error = routeInfo.error;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
-
- _this2.changeState(method, url, addBasePath(as), options);
- }
+ var error = routeInfo.error;
- if (false) { var appComp; }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- _this2.set(route, pathname, query, as, routeInfo);
+ Router.events.emit('beforeHistoryChange', as);
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ _this2.changeState(method, url, addBasePath(as), options);
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ if (false) { var appComp; }
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
-
- _Promise.race([new _Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(false);
- }, 110);
- }), dataRes]).then(function (data) {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ _this2.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(function (finalData) {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1597,49 +1572,17 @@ function () {
if (false) { var _require, isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = function handleData(props) {
- routeInfo.props = props;
- _this3.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = function dataMethod() {
- return isSSG ? _this3._getStaticData(as) : _this3._getServerData(as);
- };
-
- var retry = function retry(error) {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: _this3._getData(function () {
- return dataMethod() // we retry for data twice unless we get a 404
- ["catch"](retry)["catch"](retry).then(function (props) {
- return handleData(props);
- });
- })
- }));
- }
-
return _this3._getData(function () {
- return _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return Component.__N_SSG ? _this3._getStaticData(as) : Component.__N_SSP ? _this3._getServerData(as) : _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname: pathname,
query: query,
asPath: as
});
}).then(function (props) {
- return handleData(props);
+ routeInfo.props = props;
+ _this3.components[route] = routeInfo;
+ return routeInfo;
});
})["catch"](function (err) {
return new _Promise(function (resolve) {
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 14.3s | 13.7s | -637ms |
nodeModulesSize | 52.9 MB | 52.9 MB | -1.35 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..7cc8.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -147 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.4 kB | N/A |
Overall change | 62.1 kB | 62 kB | -144 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_error.js gzip | 290 kB | 289 kB | -762 B |
404.html gzip | 1.45 kB | 1.44 kB | -3 B |
hooks.html gzip | 1.08 kB | 1.08 kB | -1 B |
index.js gzip | 290 kB | 289 kB | -583 B |
link.js gzip | 319 kB | 319 kB | |
routerDirect.js gzip | 317 kB | 316 kB | -1.53 kB |
withRouter.js gzip | 316 kB | 316 kB | |
Overall change | 1.53 MB | 1.53 MB | -2.31 kB |
Commit: 7a3b3e7
ijjk
reviewed
Feb 13, 2020
ijjk
reviewed
Feb 13, 2020
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Legacy Client Bundles (polyfills)
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes Overall increase
|
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
index.html gzip | 1.03 kB | 1.04 kB | |
link.html gzip | 1.04 kB | 1.04 kB | |
withRouter.html gzip | 1.03 kB | 1.03 kB | |
Overall change | 3.11 kB | 3.11 kB |
Diffs
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/link.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div><h3>A Link page!</h3><a href="/">Go to /</a></div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/link","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/link" src="/_next/static/BUILD_ID/pages/link.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/index.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next">Hello world 👋</div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/" src="/_next/static/BUILD_ID/pages/index.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for main-HASH.module.js
@@ -285,9 +285,10 @@ class Container extends _react.default.Component {
componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -297,6 +298,10 @@ class Container extends _react.default.Component {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for main-HASH.js
@@ -380,9 +380,10 @@ function (_react$default$Compon) {
value: function componentDidMount() {
this.scrollToHash();
- if (false) {} // If page was exported and has a querystring
- // If it's a dynamic route or has a querystring
- // if it's a fallback page
+ if (false) {} // We need to replace the router state if:
+ // - the page was (auto) exported and has a query string or search (hash)
+ // - it was auto exported and is a dynamic route (to provide params)
+ // - if it is a client-side skeleton (fallback render)
if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || Component && Component.__N_SSG && location.search)) {
@@ -392,6 +393,10 @@ function (_react$default$Compon) {
// client-side hydration. Your app should _never_ use this property.
// It may change at any time without notice.
_h: 1,
+ // Fallback pages must trigger the data fetch, so the transition is
+ // not shallow.
+ // Other pages (strictly updating query) happens shallowly, as data
+ // requirements would already be present.
shallow: !isFallback
});
}
Diff for de003c3a9d30..c7.module.js
@@ -1473,23 +1473,31 @@ function toRoute(path) {
var prepareRoute = path => toRoute(!path || path === '/' ? '/index' : path);
-var fetchNextData = (pathname, query, cb) => {
+function fetchNextData(pathname, query, isServerRender, cb) {
return fetch(utils_1.formatWithValidation({
// @ts-ignore __NEXT_DATA__
pathname: "/_next/data/".concat(__NEXT_DATA__.buildId).concat(pathname, ".json"),
query
})).then(res => {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(data => {
return cb ? cb(data) : data;
+ }).catch(err => {
+ // 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) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ }
+
+ throw err;
});
-};
+}
class Router {
constructor(pathname, query, as, _ref) {
@@ -1552,7 +1560,7 @@ class Router {
this._getStaticData = asPath => {
var pathname = prepareRoute(url_1.parse(asPath).pathname);
- return true && this.sdc[pathname] ? _Promise.resolve(this.sdc[pathname]) : fetchNextData(pathname, null, data => this.sdc[pathname] = data);
+ return true && this.sdc[pathname] ? _Promise.resolve(this.sdc[pathname]) : fetchNextData(pathname, null, this.isSsr, data => this.sdc[pathname] = data);
};
this._getServerData = asPath => {
@@ -1561,7 +1569,7 @@ class Router {
query
} = url_1.parse(asPath, true);
pathname = prepareRoute(pathname);
- return fetchNextData(pathname, query);
+ return fetchNextData(pathname, query, this.isSsr);
}; // represents the current component key
@@ -1763,57 +1771,28 @@ class Router {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
this.getRouteInfo(route, pathname, query, as, shallow).then(routeInfo => {
- var emitHistory = false;
-
- var doRouteChange = (routeInfo, complete) => {
- var {
- error
- } = routeInfo;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
- this.changeState(method, url, addBasePath(as), options);
- }
-
- if (false) { var appComp; }
-
- this.set(route, pathname, query, as, routeInfo);
+ var {
+ error
+ } = routeInfo;
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ Router.events.emit('beforeHistoryChange', as);
+ this.changeState(method, url, addBasePath(as), options);
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
+ if (false) { var appComp; }
- _Promise.race([new _Promise(resolve => setTimeout(() => resolve(false), 110)), dataRes]).then(data => {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ this.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(finalData => {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1857,40 +1836,16 @@ class Router {
if (false) { var isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = props => {
- routeInfo.props = props;
- this.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = () => isSSG ? this._getStaticData(as) : this._getServerData(as);
-
- var retry = error => {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: this._getData(() => dataMethod() // we retry for data twice unless we get a 404
- .catch(retry).catch(retry).then(props => handleData(props)))
- }));
- }
-
- return this._getData(() => this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return this._getData(() => Component.__N_SSG ? this._getStaticData(as) : Component.__N_SSP ? this._getServerData(as) : this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
asPath: as
- })).then(props => handleData(props));
+ })).then(props => {
+ routeInfo.props = props;
+ this.components[route] = routeInfo;
+ return routeInfo;
+ });
}).catch(err => {
return new _Promise(resolve => {
if (err.code === 'PAGE_LOAD_ERROR') {
Diff for de003c3a9d30..f46cabb19.js
@@ -1193,23 +1193,31 @@ var prepareRoute = function prepareRoute(path) {
return toRoute(!path || path === '/' ? '/index' : path);
};
-var fetchNextData = function fetchNextData(pathname, query, cb) {
+function fetchNextData(pathname, query, isServerRender, cb) {
return fetch(utils_1.formatWithValidation({
// @ts-ignore __NEXT_DATA__
pathname: "/_next/data/".concat(__NEXT_DATA__.buildId).concat(pathname, ".json"),
query: query
})).then(function (res) {
if (!res.ok) {
- var error = new Error("Failed to load static props");
- error.statusCode = res.status;
- throw error;
+ throw new Error("Failed to load static props");
}
return res.json();
}).then(function (data) {
return cb ? cb(data) : data;
+ })["catch"](function (err) {
+ // 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) {
+ ;
+ err.code = 'PAGE_LOAD_ERROR';
+ }
+
+ throw err;
});
-};
+}
var Router =
/*#__PURE__*/
@@ -1276,7 +1284,7 @@ function () {
this._getStaticData = function (asPath) {
var pathname = prepareRoute(url_1.parse(asPath).pathname);
- return true && _this.sdc[pathname] ? _Promise.resolve(_this.sdc[pathname]) : fetchNextData(pathname, null, function (data) {
+ return true && _this.sdc[pathname] ? _Promise.resolve(_this.sdc[pathname]) : fetchNextData(pathname, null, _this.isSsr, function (data) {
return _this.sdc[pathname] = data;
});
};
@@ -1287,7 +1295,7 @@ function () {
query = _url_1$parse.query;
pathname = prepareRoute(pathname);
- return fetchNextData(pathname, query);
+ return fetchNextData(pathname, query, _this.isSsr);
}; // represents the current component key
@@ -1496,60 +1504,27 @@ function () {
Router.events.emit('routeChangeStart', as); // If shallow is true and the route exists in the router cache we reuse the previous result
_this2.getRouteInfo(route, pathname, query, as, shallow).then(function (routeInfo) {
- var emitHistory = false;
-
- var doRouteChange = function doRouteChange(routeInfo, complete) {
- var error = routeInfo.error;
-
- if (error && error.cancelled) {
- return resolve(false);
- }
-
- if (!emitHistory) {
- emitHistory = true;
- Router.events.emit('beforeHistoryChange', as);
-
- _this2.changeState(method, url, addBasePath(as), options);
- }
+ var error = routeInfo.error;
- if (false) { var appComp; }
+ if (error && error.cancelled) {
+ return resolve(false);
+ }
- _this2.set(route, pathname, query, as, routeInfo);
+ Router.events.emit('beforeHistoryChange', as);
- if (complete) {
- if (error) {
- Router.events.emit('routeChangeError', error, as);
- throw error;
- }
+ _this2.changeState(method, url, addBasePath(as), options);
- Router.events.emit('routeChangeComplete', as);
- resolve(true);
- }
- };
+ if (false) { var appComp; }
- if (routeInfo.dataRes) {
- var dataRes = routeInfo.dataRes; // to prevent a flash of the fallback page we delay showing it for
- // 110ms and race the timeout with the data response. If the data
- // beats the timeout we skip showing the fallback
-
- _Promise.race([new _Promise(function (resolve) {
- return setTimeout(function () {
- return resolve(false);
- }, 110);
- }), dataRes]).then(function (data) {
- if (!data) {
- // data didn't win the race, show fallback
- doRouteChange(routeInfo, false);
- }
+ _this2.set(route, pathname, query, as, routeInfo);
- return dataRes;
- }).then(function (finalData) {
- // render with the data and complete route change
- doRouteChange(finalData, true);
- }, reject);
- } else {
- doRouteChange(routeInfo, true);
+ if (error) {
+ Router.events.emit('routeChangeError', error, as);
+ throw error;
}
+
+ Router.events.emit('routeChangeComplete', as);
+ return resolve(true);
}, reject);
});
}
@@ -1597,49 +1572,17 @@ function () {
if (false) { var _require, isValidElementType; }
- var isSSG = Component.__N_SSG;
- var isSSP = Component.__N_SSP;
-
- var handleData = function handleData(props) {
- routeInfo.props = props;
- _this3.components[route] = routeInfo;
- return routeInfo;
- }; // resolve with fallback routeInfo and promise for data
-
-
- if (isSSG || isSSP) {
- var dataMethod = function dataMethod() {
- return isSSG ? _this3._getStaticData(as) : _this3._getServerData(as);
- };
-
- var retry = function retry(error) {
- if (error.statusCode === 404) {
- throw error;
- }
-
- return dataMethod();
- };
-
- return _Promise.resolve(_Object$assign(_Object$assign({}, routeInfo), {
- props: {},
- dataRes: _this3._getData(function () {
- return dataMethod() // we retry for data twice unless we get a 404
- ["catch"](retry)["catch"](retry).then(function (props) {
- return handleData(props);
- });
- })
- }));
- }
-
return _this3._getData(function () {
- return _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
+ return Component.__N_SSG ? _this3._getStaticData(as) : Component.__N_SSP ? _this3._getServerData(as) : _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname: pathname,
query: query,
asPath: as
});
}).then(function (props) {
- return handleData(props);
+ routeInfo.props = props;
+ _this3.components[route] = routeInfo;
+ return routeInfo;
});
})["catch"](function (err) {
return new _Promise(function (resolve) {
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.94ffdad0a29f46cabb19.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.978383ccfbd093c75ec7.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-71617365d17c7ecb6735.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-1eb042c3b4a90e3acca8.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/BUILD_ID/pages/withRouter.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/BUILD_ID/pages/_app.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" as="script" crossorigin="anonymous"/></head><body><div id="__next"><div>I use withRouter</div></div><script id="__NEXT_DATA__" type="application/json" crossorigin="anonymous">{"props":{"pageProps":{}},"page":"/withRouter","query":{},"buildId":"BUILD_ID","isFallback":false}</script><script crossorigin="anonymous" nomodule="">!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script crossorigin="anonymous" nomodule="" src="/_next/static/runtime/polyfills-355bc4b3077ea9d3fc7a.js"></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/withRouter" src="/_next/static/BUILD_ID/pages/withRouter.module.js" crossorigin="anonymous" type="module"></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.js" crossorigin="anonymous" nomodule=""></script><script async="" data-next-page="/_app" src="/_next/static/BUILD_ID/pages/_app.module.js" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/webpack-4d739ac7b0d8f888ab18.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/webpack-d629b83a65f3e33fa99e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/framework.c07ba8a3b0945b0f6315.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/framework.5bb7f30f859f5f31359f.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/commons.5d483f979b96e9afed5a.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.9a0caf742c992a927903.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/4952ddcd88e7185e66c9cf40e2d848b7e27f1574.6406830adfd759a39616.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.bde9bd48d8b0ca5ee165.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.07de0eda2f9121607eb9.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-9bce3fd6b88058d57ef8.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-df59e677d93e5d5684e0.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/BUILD_ID/_buildManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_buildManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Serverless Mode (Increase detected ⚠️ )
General Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
buildDuration | 13s | 12.6s | -440ms |
nodeModulesSize | 52.9 MB | 52.9 MB | -1.35 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.js gzip | 5.13 kB | 5.13 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..54d3.js gzip | 4.68 kB | 4.68 kB | ✓ |
commons.HASH.js gzip | 4.06 kB | 4.06 kB | ✓ |
de003c3a9d30..e781.js gzip | 13.8 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..7cc8.js gzip | N/A | 13.6 kB | N/A |
Overall change | 67.5 kB | 67.4 kB | -147 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.13 kB | 4.13 kB | ✓ |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
4952ddcd88e7..dule.js gzip | 5.56 kB | 5.56 kB | ✓ |
de003c3a9d30..dule.js gzip | 12.5 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 12.4 kB | N/A |
Overall change | 62.1 kB | 62 kB | -144 B |
Legacy Client Bundles (polyfills)
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 4.76 kB | 4.76 kB | ✓ |
Overall change | 4.76 kB | 4.76 kB | ✓ |
Client Pages
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.js gzip | 1.15 kB | 1.15 kB | ✓ |
_error.js gzip | 4.07 kB | 4.07 kB | ✓ |
hooks.js gzip | 779 B | 779 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 2.89 kB | 2.89 kB | ✓ |
routerDirect.js gzip | 283 B | 283 B | ✓ |
withRouter.js gzip | 282 B | 282 B | ✓ |
Overall change | 9.68 kB | 9.68 kB | ✓ |
Client Pages Modern
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_app.module.js gzip | 576 B | 576 B | ✓ |
_error.module.js gzip | 3.06 kB | 3.06 kB | ✓ |
hooks.module.js gzip | 371 B | 371 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 2.46 kB | 2.46 kB | ✓ |
routerDirect..dule.js gzip | 273 B | 273 B | ✓ |
withRouter.m..dule.js gzip | 272 B | 272 B | ✓ |
Overall change | 7.22 kB | 7.22 kB | ✓ |
Client Build Manifests
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManife..dule.js gzip | 61 B | 61 B | ✓ |
Overall change | 122 B | 122 B | ✓ |
Serverless bundles Overall increase ⚠️
zeit/next.js canary | Timer/next.js revised-fallback-behavior | Change | |
---|---|---|---|
_error.js gzip | 289 kB | 290 kB | |
404.html gzip | 1.45 kB | 1.44 kB | -3 B |
hooks.html gzip | 1.08 kB | 1.08 kB | -1 B |
index.js gzip | 289 kB | 290 kB | |
link.js gzip | 320 kB | 318 kB | -1.31 kB |
routerDirect.js gzip | 317 kB | 317 kB | -157 B |
withRouter.js gzip | 316 kB | 316 kB | |
Overall change | 1.53 MB | 1.53 MB |
Commit: c271c8c
ijjk
approved these changes
Feb 13, 2020
This was referenced Mar 13, 2020
This was referenced Mar 22, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request makes the following adjustments to the SSG loading/fallback behavior:
This pull request is a stepping stone for more future changes:
The loading state should render a different export on the pagegetStaticPaths
getStaticPaths
in prod and dev