-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Update method for attaching GS(S)P identifier to page #10859
Merged
Merged
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
ijjk
changed the title
Update to use separate export instead of attaching to component to identify GS(S)P pages
Update method for attaching GS(S)P identifier for client page bundles
Mar 6, 2020
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
buildDuration | 9.3s | 9.6s | |
nodeModulesSize | 56.5 MB | 56.5 MB | -1.1 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
main-HASH.js gzip | 5.77 kB | 5.77 kB | |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..23c3.js gzip | 9.72 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..fd0e.js gzip | N/A | 9.77 kB | N/A |
Overall change | 55.4 kB | 55.4 kB |
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.79 kB | 4.78 kB | -1 B |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..dule.js gzip | 6.66 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 6.71 kB | N/A |
Overall change | 51.3 kB | 51.4 kB |
Legacy Client Bundles (polyfills)
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 18.9 kB | 18.9 kB | ✓ |
Overall change | 18.9 kB | 18.9 kB | ✓ |
Client Pages Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
_app.js gzip | 1.08 kB | 1.09 kB | |
_error.js gzip | 2.96 kB | 2.96 kB | ✓ |
hooks.js gzip | 664 B | 664 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 1.89 kB | 1.89 kB | ✓ |
routerDirect.js gzip | 279 B | 279 B | ✓ |
withRouter.js gzip | 278 B | 278 B | ✓ |
Overall change | 7.37 kB | 7.38 kB |
Client Pages Modern Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
_app.module.js gzip | 589 B | 594 B | |
_error.module.js gzip | 2.06 kB | 2.06 kB | ✓ |
hooks.module.js gzip | 370 B | 370 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 1.48 kB | 1.48 kB | ✓ |
routerDirect..dule.js gzip | 271 B | 271 B | ✓ |
withRouter.m..dule.js gzip | 270 B | 270 B | ✓ |
Overall change | 5.26 kB | 5.26 kB |
Client Build Manifests
zeit/next.js canary | ijjk/next.js add/NEXT-101 | 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 decrease ✓
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
index.html gzip | 918 B | 915 B | -3 B |
link.html gzip | 926 B | 924 B | -2 B |
withRouter.html gzip | 915 B | 911 B | -4 B |
Overall change | 2.76 kB | 2.75 kB | -9 B |
Diffs
Diff for index.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-b44891094f478e273b8e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.33a2a2b5bda58a40c30e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-70f1431426f277f2a5de.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-b44891094f478e273b8e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.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"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.7641d466f1d5097d0a63.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-d460a781a02bc60b5b2e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.b46494a7477a85ac1589.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.7641d466f1d5097d0a63.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-4cae1b0fbad1d8015a31.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-d460a781a02bc60b5b2e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for main-HASH.module.js
@@ -267,7 +267,7 @@ class Container extends _react.default.Component {
// - 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)) {
+ if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || props.__N_SSG && location.search)) {
// update query on mount for exported pages
router.replace(router.pathname + '?' + (0, _querystring.stringify)((0, _extends2.default)({}, router.query, {}, (0, _querystring.parse)(location.search.substr(1)))), asPath, {
// WARNING: `_h` is an internal option for handing Next.js
@@ -352,7 +352,10 @@ var _default = async function _default(_temp) {
var initialErr = err;
try {
- Component = await pageLoader.loadPage(page);
+ ;
+ ({
+ page: Component
+ } = await pageLoader.loadPage(page));
if (false) { var isValidElementType; }
} catch (error) {
@@ -437,7 +440,9 @@ async function renderError(props) {
console.error(err);
- ErrorComponent = await pageLoader.loadPage('/_error'); // In production we do a normal render with the `ErrorComponent` as component.
+ ({
+ page: ErrorComponent
+ } = await pageLoader.loadPage('/_error')); // In production we do a normal render with the `ErrorComponent` as component.
// If we've gotten here upon initial render, we can use the props from the server.
// Otherwise, we need to call `getInitialProps` on `App` before mounting.
@@ -920,7 +925,7 @@ class PageLoader {
}
loadPage(route) {
- return this.loadPageScript(route).then(v => v.page);
+ return this.loadPageScript(route);
}
loadPageScript(route) {
Diff for main-HASH.js
@@ -315,7 +315,7 @@ var Container = /*#__PURE__*/function (_react$default$Compon) {
// - 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)) {
+ if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || props.__N_SSG && location.search)) {
// update query on mount for exported pages
router.replace(router.pathname + '?' + (0, _querystring.stringify)((0, _extends2["default"])({}, router.query, {}, (0, _querystring.parse)(location.search.substr(1)))), asPath, {
// WARNING: `_h` is an internal option for handing Next.js
@@ -372,7 +372,7 @@ var emitter = (0, _mitt["default"])();
exports.emitter = emitter;
var _default = function _default(_temp) {
- var _ref, passedWebpackHMR, _ref3, app, mod, initialErr, _require, isValidElementType, renderCtx;
+ var _ref, passedWebpackHMR, _ref3, app, mod, initialErr, _ref4, _require, isValidElementType, renderCtx;
return _regeneratorRuntime.async(function _default$(_context) {
while (1) {
@@ -410,46 +410,48 @@ var _default = function _default(_temp) {
initialErr = err;
_context.prev = 10;
- _context.next = 13;
+ ;
+ _context.next = 14;
return _regeneratorRuntime.awrap(pageLoader.loadPage(page));
- case 13:
- Component = _context.sent;
+ case 14:
+ _ref4 = _context.sent;
+ Component = _ref4.page;
if (true) {
- _context.next = 18;
+ _context.next = 20;
break;
}
_require = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'react-is'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())), isValidElementType = _require.isValidElementType;
if (isValidElementType(Component)) {
- _context.next = 18;
+ _context.next = 20;
break;
}
throw new Error("The default export is not a React Component in page: \"" + page + "\"");
- case 18:
- _context.next = 23;
+ case 20:
+ _context.next = 25;
break;
- case 20:
- _context.prev = 20;
+ case 22:
+ _context.prev = 22;
_context.t0 = _context["catch"](10);
// This catches errors like throwing in the top level of a module
initialErr = _context.t0;
- case 23:
+ case 25:
if (!window.__NEXT_PRELOADREADY) {
- _context.next = 26;
+ _context.next = 28;
break;
}
- _context.next = 26;
+ _context.next = 28;
return _regeneratorRuntime.awrap(window.__NEXT_PRELOADREADY(dynamicIds));
- case 26:
+ case 28:
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader: pageLoader,
@@ -485,9 +487,9 @@ var _default = function _default(_temp) {
render(renderCtx);
return _context.abrupt("return", emitter);
- case 32:
+ case 34:
if (true) {
- _context.next = 34;
+ _context.next = 36;
break;
}
@@ -497,12 +499,12 @@ var _default = function _default(_temp) {
renderCtx: renderCtx
});
- case 34:
+ case 36:
case "end":
return _context.stop();
}
}
- }, null, null, [[10, 20]], Promise);
+ }, null, null, [[10, 22]], Promise);
};
exports["default"] = _default;
@@ -552,7 +554,8 @@ function render(props) {
function renderError(props) {
- var App, err, AppTree, appCtx, initProps;
+ var App, err, _ref5, AppTree, appCtx, initProps;
+
return _regeneratorRuntime.async(function renderError$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
@@ -576,7 +579,8 @@ function renderError(props) {
return _regeneratorRuntime.awrap(pageLoader.loadPage('/_error'));
case 7:
- ErrorComponent = _context3.sent;
+ _ref5 = _context3.sent;
+ ErrorComponent = _ref5.page;
// In production we do a normal render with the `ErrorComponent` as component.
// If we've gotten here upon initial render, we can use the props from the server.
// Otherwise, we need to call `getInitialProps` on `App` before mounting.
@@ -595,31 +599,31 @@ function renderError(props) {
};
if (!props.props) {
- _context3.next = 14;
+ _context3.next = 15;
break;
}
_context3.t0 = props.props;
- _context3.next = 17;
+ _context3.next = 18;
break;
- case 14:
- _context3.next = 16;
+ case 15:
+ _context3.next = 17;
return _regeneratorRuntime.awrap((0, _utils.loadGetInitialProps)(App, appCtx));
- case 16:
+ case 17:
_context3.t0 = _context3.sent;
- case 17:
+ case 18:
initProps = _context3.t0;
- _context3.next = 20;
+ _context3.next = 21;
return _regeneratorRuntime.awrap(doRender((0, _extends2["default"])({}, props, {
err: err,
Component: ErrorComponent,
props: initProps
})));
- case 20:
+ case 21:
case "end":
return _context3.stop();
}
@@ -1198,9 +1202,7 @@ var PageLoader = /*#__PURE__*/function () {
}, {
key: "loadPage",
value: function loadPage(route) {
- return this.loadPageScript(route).then(function (v) {
- return v.page;
- });
+ return this.loadPageScript(route);
}
}, {
key: "loadPageScript",
Diff for de003c3a9d30..58a40c30e.js
@@ -591,7 +591,9 @@ var Router = /*#__PURE__*/function () {
this.components[this.route] = {
Component: Component,
props: initialProps,
- err: err
+ err: err,
+ __N_SSG: initialProps.__N_SSG,
+ __N_SSP: initialProps.__N_SSP
};
}
@@ -639,7 +641,9 @@ var Router = /*#__PURE__*/function () {
}
var newData = Object.assign(Object.assign({}, data), {
- Component: Component
+ Component: Component,
+ __N_SSG: mod.__N_SSG,
+ __N_SSP: mod.__N_SSP
});
this.components[route] = newData; // pages/_app.js updated
@@ -866,7 +870,8 @@ var Router = /*#__PURE__*/function () {
});
}
- resolve(_this3.fetchComponent('/_error').then(function (Component) {
+ resolve(_this3.fetchComponent('/_error').then(function (res) {
+ var Component = res.page;
var routeInfo = {
Component: Component,
err: err
@@ -898,18 +903,22 @@ var Router = /*#__PURE__*/function () {
return resolve(cachedRouteInfo);
}
- _this3.fetchComponent(route).then(function (Component) {
+ _this3.fetchComponent(route).then(function (res) {
return resolve({
- Component: Component
+ Component: res.page,
+ __N_SSG: res.mod.__N_SSG,
+ __N_SSP: res.mod.__N_SSP
});
}, reject);
}).then(function (routeInfo) {
- var Component = routeInfo.Component;
+ var Component = routeInfo.Component,
+ __N_SSG = routeInfo.__N_SSG,
+ __N_SSP = routeInfo.__N_SSP;
if (false) { var _require, isValidElementType; }
return _this3._getData(function () {
- 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`
+ return __N_SSG ? _this3._getStaticData(as) : __N_SSP ? _this3._getServerData(as) : _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname: pathname,
query: query,
@@ -1043,7 +1052,7 @@ var Router = /*#__PURE__*/function () {
}, {
key: "fetchComponent",
value: function fetchComponent(route) {
- var cancelled, cancel, Component, error;
+ var cancelled, cancel, componentResult, error;
return _regeneratorRuntime.async(function fetchComponent$(_context) {
while (1) {
switch (_context.prev = _context.next) {
@@ -1058,7 +1067,7 @@ var Router = /*#__PURE__*/function () {
return _regeneratorRuntime.awrap(this.pageLoader.loadPage(route));
case 4:
- Component = _context.sent;
+ componentResult = _context.sent;
if (!cancelled) {
_context.next = 9;
@@ -1074,7 +1083,7 @@ var Router = /*#__PURE__*/function () {
this.clc = null;
}
- return _context.abrupt("return", Component);
+ return _context.abrupt("return", componentResult);
case 11:
case "end":
Diff for de003c3a9d30..4e.module.js
@@ -524,7 +524,9 @@ class Router {
this.components[this.route] = {
Component,
props: initialProps,
- err
+ err,
+ __N_SSG: initialProps.__N_SSG,
+ __N_SSP: initialProps.__N_SSP
};
}
@@ -576,7 +578,9 @@ class Router {
}
var newData = Object.assign(Object.assign({}, data), {
- Component
+ Component,
+ __N_SSG: mod.__N_SSG,
+ __N_SSP: mod.__N_SSP
});
this.components[route] = newData; // pages/_app.js updated
@@ -789,7 +793,10 @@ class Router {
});
}
- resolve(this.fetchComponent('/_error').then(Component => {
+ resolve(this.fetchComponent('/_error').then(res => {
+ var {
+ page: Component
+ } = res;
var routeInfo = {
Component,
err
@@ -819,17 +826,21 @@ class Router {
return resolve(cachedRouteInfo);
}
- this.fetchComponent(route).then(Component => resolve({
- Component
+ this.fetchComponent(route).then(res => resolve({
+ Component: res.page,
+ __N_SSG: res.mod.__N_SSG,
+ __N_SSP: res.mod.__N_SSP
}), reject);
}).then(routeInfo => {
var {
- Component
+ Component,
+ __N_SSG,
+ __N_SSP
} = routeInfo;
if (false) { var isValidElementType; }
- 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`
+ return this._getData(() => __N_SSG ? this._getStaticData(as) : __N_SSP ? this._getServerData(as) : this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
@@ -946,7 +957,7 @@ class Router {
cancelled = true;
};
- var Component = await this.pageLoader.loadPage(route);
+ var componentResult = await this.pageLoader.loadPage(route);
if (cancelled) {
var error = new Error("Abort fetching component for route: \"".concat(route, "\""));
@@ -958,7 +969,7 @@ class Router {
this.clc = null;
}
- return Component;
+ return componentResult;
}
_getData(fn) {
Diff for _app.module.js
@@ -55,11 +55,13 @@ class App extends _react.default.Component {
var {
router,
Component,
- pageProps
+ pageProps,
+ __N_SSG,
+ __N_SSP
} = this.props;
return _react.default.createElement(Component, Object.assign({}, pageProps, // we don't add the legacy URL prop if it's using non-legacy
// methods like getStaticProps and getServerSideProps
- !(Component.__N_SSG || Component.__N_SSP) ? {
+ !(__N_SSG || __N_SSP) ? {
url: createUrl(router)
} : {}));
}
Diff for _app.js
@@ -115,10 +115,12 @@ var App = /*#__PURE__*/function (_react$default$Compon) {
var _this$props = this.props,
router = _this$props.router,
Component = _this$props.Component,
- pageProps = _this$props.pageProps;
+ pageProps = _this$props.pageProps,
+ __N_SSG = _this$props.__N_SSG,
+ __N_SSP = _this$props.__N_SSP;
return _react["default"].createElement(Component, Object.assign({}, pageProps, // we don't add the legacy URL prop if it's using non-legacy
// methods like getStaticProps and getServerSideProps
- !(Component.__N_SSG || Component.__N_SSP) ? {
+ !(__N_SSG || __N_SSP) ? {
url: createUrl(router)
} : {}));
}
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-b44891094f478e273b8e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.33a2a2b5bda58a40c30e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-70f1431426f277f2a5de.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-b44891094f478e273b8e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.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"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.7641d466f1d5097d0a63.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-d460a781a02bc60b5b2e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.b46494a7477a85ac1589.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.7641d466f1d5097d0a63.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-4cae1b0fbad1d8015a31.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-d460a781a02bc60b5b2e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.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"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-b44891094f478e273b8e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.33a2a2b5bda58a40c30e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-70f1431426f277f2a5de.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-b44891094f478e273b8e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.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"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.7641d466f1d5097d0a63.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-d460a781a02bc60b5b2e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.b46494a7477a85ac1589.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.7641d466f1d5097d0a63.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-4cae1b0fbad1d8015a31.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-d460a781a02bc60b5b2e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.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 | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
buildDuration | 9.9s | 9.7s | -209ms |
nodeModulesSize | 56.5 MB | 56.5 MB | -1.1 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
main-HASH.js gzip | 5.77 kB | 5.77 kB | |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..23c3.js gzip | 9.72 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..fd0e.js gzip | N/A | 9.77 kB | N/A |
Overall change | 55.4 kB | 55.4 kB |
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.79 kB | 4.78 kB | -1 B |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..dule.js gzip | 6.66 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 6.71 kB | N/A |
Overall change | 51.3 kB | 51.4 kB |
Legacy Client Bundles (polyfills)
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 18.9 kB | 18.9 kB | ✓ |
Overall change | 18.9 kB | 18.9 kB | ✓ |
Client Pages Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
_app.js gzip | 1.08 kB | 1.09 kB | |
_error.js gzip | 2.96 kB | 2.96 kB | ✓ |
hooks.js gzip | 664 B | 664 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 1.89 kB | 1.89 kB | ✓ |
routerDirect.js gzip | 279 B | 279 B | ✓ |
withRouter.js gzip | 278 B | 278 B | ✓ |
Overall change | 7.37 kB | 7.38 kB |
Client Pages Modern Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
_app.module.js gzip | 589 B | 594 B | |
_error.module.js gzip | 2.06 kB | 2.06 kB | ✓ |
hooks.module.js gzip | 370 B | 370 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 1.48 kB | 1.48 kB | ✓ |
routerDirect..dule.js gzip | 271 B | 271 B | ✓ |
withRouter.m..dule.js gzip | 270 B | 270 B | ✓ |
Overall change | 5.26 kB | 5.26 kB |
Client Build Manifests
zeit/next.js canary | ijjk/next.js add/NEXT-101 | 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 | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
_error.js gzip | 292 kB | 292 kB | -115 B |
404.html gzip | 1.32 kB | 1.32 kB | -5 B |
hooks.html gzip | 957 B | 955 B | -2 B |
index.js gzip | 292 kB | 292 kB | -187 B |
link.js gzip | 300 kB | 300 kB | |
routerDirect.js gzip | 298 kB | 298 kB | -125 B |
withRouter.js gzip | 298 kB | 298 kB | -323 B |
Overall change | 1.48 MB | 1.48 MB | -416 B |
This comment has been minimized.
This comment has been minimized.
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
buildDuration | 9.6s | 10s | |
nodeModulesSize | 56.5 MB | 56.5 MB | -1.03 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
main-HASH.js gzip | 5.77 kB | 5.77 kB | |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..23c3.js gzip | 9.72 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..cfaa.js gzip | N/A | 9.77 kB | N/A |
Overall change | 55.4 kB | 55.4 kB |
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.79 kB | 4.78 kB | -1 B |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..dule.js gzip | 6.66 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 6.71 kB | N/A |
Overall change | 51.3 kB | 51.4 kB |
Legacy Client Bundles (polyfills)
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 18.9 kB | 18.9 kB | ✓ |
Overall change | 18.9 kB | 18.9 kB | ✓ |
Client Pages Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
_app.js gzip | 1.08 kB | 1.09 kB | |
_error.js gzip | 2.96 kB | 2.96 kB | ✓ |
hooks.js gzip | 664 B | 664 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 1.89 kB | 1.89 kB | ✓ |
routerDirect.js gzip | 279 B | 279 B | ✓ |
withRouter.js gzip | 278 B | 278 B | ✓ |
Overall change | 7.37 kB | 7.38 kB |
Client Pages Modern Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
_app.module.js gzip | 589 B | 594 B | |
_error.module.js gzip | 2.06 kB | 2.06 kB | ✓ |
hooks.module.js gzip | 370 B | 370 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 1.48 kB | 1.48 kB | ✓ |
routerDirect..dule.js gzip | 271 B | 271 B | ✓ |
withRouter.m..dule.js gzip | 270 B | 270 B | ✓ |
Overall change | 5.26 kB | 5.26 kB |
Client Build Manifests
zeit/next.js canary | ijjk/next.js add/NEXT-101 | 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 decrease ✓
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
index.html gzip | 918 B | 914 B | -4 B |
link.html gzip | 926 B | 922 B | -4 B |
withRouter.html gzip | 915 B | 910 B | -5 B |
Overall change | 2.76 kB | 2.75 kB | -13 B |
Diffs
Diff for link.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-b44891094f478e273b8e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.33a2a2b5bda58a40c30e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-70f1431426f277f2a5de.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-b44891094f478e273b8e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.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"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-d460a781a02bc60b5b2e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.8542cdca4a4ec877d3df.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-4cae1b0fbad1d8015a31.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-d460a781a02bc60b5b2e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.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"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-b44891094f478e273b8e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.33a2a2b5bda58a40c30e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-70f1431426f277f2a5de.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-b44891094f478e273b8e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.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"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-d460a781a02bc60b5b2e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.8542cdca4a4ec877d3df.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-4cae1b0fbad1d8015a31.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-d460a781a02bc60b5b2e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.module.js" async="" crossorigin="anonymous" type="module"></script></body></html>
\ No newline at end of file
Diff for main-HASH.module.js
@@ -267,7 +267,7 @@ class Container extends _react.default.Component {
// - 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)) {
+ if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || props.__N_SSG && location.search)) {
// update query on mount for exported pages
router.replace(router.pathname + '?' + (0, _querystring.stringify)((0, _extends2.default)({}, router.query, {}, (0, _querystring.parse)(location.search.substr(1)))), asPath, {
// WARNING: `_h` is an internal option for handing Next.js
@@ -352,7 +352,10 @@ var _default = async function _default(_temp) {
var initialErr = err;
try {
- Component = await pageLoader.loadPage(page);
+ ;
+ ({
+ page: Component
+ } = await pageLoader.loadPage(page));
if (false) { var isValidElementType; }
} catch (error) {
@@ -437,7 +440,9 @@ async function renderError(props) {
console.error(err);
- ErrorComponent = await pageLoader.loadPage('/_error'); // In production we do a normal render with the `ErrorComponent` as component.
+ ({
+ page: ErrorComponent
+ } = await pageLoader.loadPage('/_error')); // In production we do a normal render with the `ErrorComponent` as component.
// If we've gotten here upon initial render, we can use the props from the server.
// Otherwise, we need to call `getInitialProps` on `App` before mounting.
@@ -920,7 +925,7 @@ class PageLoader {
}
loadPage(route) {
- return this.loadPageScript(route).then(v => v.page);
+ return this.loadPageScript(route);
}
loadPageScript(route) {
Diff for main-HASH.js
@@ -315,7 +315,7 @@ var Container = /*#__PURE__*/function (_react$default$Compon) {
// - 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)) {
+ if (router.isSsr && (isFallback || data.nextExport && ((0, _isDynamic.isDynamicRoute)(router.pathname) || location.search) || props.__N_SSG && location.search)) {
// update query on mount for exported pages
router.replace(router.pathname + '?' + (0, _querystring.stringify)((0, _extends2["default"])({}, router.query, {}, (0, _querystring.parse)(location.search.substr(1)))), asPath, {
// WARNING: `_h` is an internal option for handing Next.js
@@ -372,7 +372,7 @@ var emitter = (0, _mitt["default"])();
exports.emitter = emitter;
var _default = function _default(_temp) {
- var _ref, passedWebpackHMR, _ref3, app, mod, initialErr, _require, isValidElementType, renderCtx;
+ var _ref, passedWebpackHMR, _ref3, app, mod, initialErr, _ref4, _require, isValidElementType, renderCtx;
return _regeneratorRuntime.async(function _default$(_context) {
while (1) {
@@ -410,46 +410,48 @@ var _default = function _default(_temp) {
initialErr = err;
_context.prev = 10;
- _context.next = 13;
+ ;
+ _context.next = 14;
return _regeneratorRuntime.awrap(pageLoader.loadPage(page));
- case 13:
- Component = _context.sent;
+ case 14:
+ _ref4 = _context.sent;
+ Component = _ref4.page;
if (true) {
- _context.next = 18;
+ _context.next = 20;
break;
}
_require = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module 'react-is'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())), isValidElementType = _require.isValidElementType;
if (isValidElementType(Component)) {
- _context.next = 18;
+ _context.next = 20;
break;
}
throw new Error("The default export is not a React Component in page: \"" + page + "\"");
- case 18:
- _context.next = 23;
+ case 20:
+ _context.next = 25;
break;
- case 20:
- _context.prev = 20;
+ case 22:
+ _context.prev = 22;
_context.t0 = _context["catch"](10);
// This catches errors like throwing in the top level of a module
initialErr = _context.t0;
- case 23:
+ case 25:
if (!window.__NEXT_PRELOADREADY) {
- _context.next = 26;
+ _context.next = 28;
break;
}
- _context.next = 26;
+ _context.next = 28;
return _regeneratorRuntime.awrap(window.__NEXT_PRELOADREADY(dynamicIds));
- case 26:
+ case 28:
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader: pageLoader,
@@ -485,9 +487,9 @@ var _default = function _default(_temp) {
render(renderCtx);
return _context.abrupt("return", emitter);
- case 32:
+ case 34:
if (true) {
- _context.next = 34;
+ _context.next = 36;
break;
}
@@ -497,12 +499,12 @@ var _default = function _default(_temp) {
renderCtx: renderCtx
});
- case 34:
+ case 36:
case "end":
return _context.stop();
}
}
- }, null, null, [[10, 20]], Promise);
+ }, null, null, [[10, 22]], Promise);
};
exports["default"] = _default;
@@ -552,7 +554,8 @@ function render(props) {
function renderError(props) {
- var App, err, AppTree, appCtx, initProps;
+ var App, err, _ref5, AppTree, appCtx, initProps;
+
return _regeneratorRuntime.async(function renderError$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
@@ -576,7 +579,8 @@ function renderError(props) {
return _regeneratorRuntime.awrap(pageLoader.loadPage('/_error'));
case 7:
- ErrorComponent = _context3.sent;
+ _ref5 = _context3.sent;
+ ErrorComponent = _ref5.page;
// In production we do a normal render with the `ErrorComponent` as component.
// If we've gotten here upon initial render, we can use the props from the server.
// Otherwise, we need to call `getInitialProps` on `App` before mounting.
@@ -595,31 +599,31 @@ function renderError(props) {
};
if (!props.props) {
- _context3.next = 14;
+ _context3.next = 15;
break;
}
_context3.t0 = props.props;
- _context3.next = 17;
+ _context3.next = 18;
break;
- case 14:
- _context3.next = 16;
+ case 15:
+ _context3.next = 17;
return _regeneratorRuntime.awrap((0, _utils.loadGetInitialProps)(App, appCtx));
- case 16:
+ case 17:
_context3.t0 = _context3.sent;
- case 17:
+ case 18:
initProps = _context3.t0;
- _context3.next = 20;
+ _context3.next = 21;
return _regeneratorRuntime.awrap(doRender((0, _extends2["default"])({}, props, {
err: err,
Component: ErrorComponent,
props: initProps
})));
- case 20:
+ case 21:
case "end":
return _context3.stop();
}
@@ -1198,9 +1202,7 @@ var PageLoader = /*#__PURE__*/function () {
}, {
key: "loadPage",
value: function loadPage(route) {
- return this.loadPageScript(route).then(function (v) {
- return v.page;
- });
+ return this.loadPageScript(route);
}
}, {
key: "loadPageScript",
Diff for de003c3a9d30..58a40c30e.js
@@ -591,7 +591,9 @@ var Router = /*#__PURE__*/function () {
this.components[this.route] = {
Component: Component,
props: initialProps,
- err: err
+ err: err,
+ __N_SSG: initialProps && initialProps.__N_SSG,
+ __N_SSP: initialProps && initialProps.__N_SSP
};
}
@@ -639,7 +641,9 @@ var Router = /*#__PURE__*/function () {
}
var newData = Object.assign(Object.assign({}, data), {
- Component: Component
+ Component: Component,
+ __N_SSG: mod.__N_SSG,
+ __N_SSP: mod.__N_SSP
});
this.components[route] = newData; // pages/_app.js updated
@@ -866,7 +870,8 @@ var Router = /*#__PURE__*/function () {
});
}
- resolve(_this3.fetchComponent('/_error').then(function (Component) {
+ resolve(_this3.fetchComponent('/_error').then(function (res) {
+ var Component = res.page;
var routeInfo = {
Component: Component,
err: err
@@ -898,18 +903,22 @@ var Router = /*#__PURE__*/function () {
return resolve(cachedRouteInfo);
}
- _this3.fetchComponent(route).then(function (Component) {
+ _this3.fetchComponent(route).then(function (res) {
return resolve({
- Component: Component
+ Component: res.page,
+ __N_SSG: res.mod.__N_SSG,
+ __N_SSP: res.mod.__N_SSP
});
}, reject);
}).then(function (routeInfo) {
- var Component = routeInfo.Component;
+ var Component = routeInfo.Component,
+ __N_SSG = routeInfo.__N_SSG,
+ __N_SSP = routeInfo.__N_SSP;
if (false) { var _require, isValidElementType; }
return _this3._getData(function () {
- 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`
+ return __N_SSG ? _this3._getStaticData(as) : __N_SSP ? _this3._getServerData(as) : _this3.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname: pathname,
query: query,
@@ -1043,7 +1052,7 @@ var Router = /*#__PURE__*/function () {
}, {
key: "fetchComponent",
value: function fetchComponent(route) {
- var cancelled, cancel, Component, error;
+ var cancelled, cancel, componentResult, error;
return _regeneratorRuntime.async(function fetchComponent$(_context) {
while (1) {
switch (_context.prev = _context.next) {
@@ -1058,7 +1067,7 @@ var Router = /*#__PURE__*/function () {
return _regeneratorRuntime.awrap(this.pageLoader.loadPage(route));
case 4:
- Component = _context.sent;
+ componentResult = _context.sent;
if (!cancelled) {
_context.next = 9;
@@ -1074,7 +1083,7 @@ var Router = /*#__PURE__*/function () {
this.clc = null;
}
- return _context.abrupt("return", Component);
+ return _context.abrupt("return", componentResult);
case 11:
case "end":
Diff for de003c3a9d30..4e.module.js
@@ -524,7 +524,9 @@ class Router {
this.components[this.route] = {
Component,
props: initialProps,
- err
+ err,
+ __N_SSG: initialProps && initialProps.__N_SSG,
+ __N_SSP: initialProps && initialProps.__N_SSP
};
}
@@ -576,7 +578,9 @@ class Router {
}
var newData = Object.assign(Object.assign({}, data), {
- Component
+ Component,
+ __N_SSG: mod.__N_SSG,
+ __N_SSP: mod.__N_SSP
});
this.components[route] = newData; // pages/_app.js updated
@@ -789,7 +793,10 @@ class Router {
});
}
- resolve(this.fetchComponent('/_error').then(Component => {
+ resolve(this.fetchComponent('/_error').then(res => {
+ var {
+ page: Component
+ } = res;
var routeInfo = {
Component,
err
@@ -819,17 +826,21 @@ class Router {
return resolve(cachedRouteInfo);
}
- this.fetchComponent(route).then(Component => resolve({
- Component
+ this.fetchComponent(route).then(res => resolve({
+ Component: res.page,
+ __N_SSG: res.mod.__N_SSG,
+ __N_SSP: res.mod.__N_SSP
}), reject);
}).then(routeInfo => {
var {
- Component
+ Component,
+ __N_SSG,
+ __N_SSP
} = routeInfo;
if (false) { var isValidElementType; }
- 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`
+ return this._getData(() => __N_SSG ? this._getStaticData(as) : __N_SSP ? this._getServerData(as) : this.getInitialProps(Component, // we provide AppTree later so this needs to be `any`
{
pathname,
query,
@@ -946,7 +957,7 @@ class Router {
cancelled = true;
};
- var Component = await this.pageLoader.loadPage(route);
+ var componentResult = await this.pageLoader.loadPage(route);
if (cancelled) {
var error = new Error("Abort fetching component for route: \"".concat(route, "\""));
@@ -958,7 +969,7 @@ class Router {
this.clc = null;
}
- return Component;
+ return componentResult;
}
_getData(fn) {
Diff for _app.module.js
@@ -55,11 +55,13 @@ class App extends _react.default.Component {
var {
router,
Component,
- pageProps
+ pageProps,
+ __N_SSG,
+ __N_SSP
} = this.props;
return _react.default.createElement(Component, Object.assign({}, pageProps, // we don't add the legacy URL prop if it's using non-legacy
// methods like getStaticProps and getServerSideProps
- !(Component.__N_SSG || Component.__N_SSP) ? {
+ !(__N_SSG || __N_SSP) ? {
url: createUrl(router)
} : {}));
}
Diff for _app.js
@@ -115,10 +115,12 @@ var App = /*#__PURE__*/function (_react$default$Compon) {
var _this$props = this.props,
router = _this$props.router,
Component = _this$props.Component,
- pageProps = _this$props.pageProps;
+ pageProps = _this$props.pageProps,
+ __N_SSG = _this$props.__N_SSG,
+ __N_SSP = _this$props.__N_SSP;
return _react["default"].createElement(Component, Object.assign({}, pageProps, // we don't add the legacy URL prop if it's using non-legacy
// methods like getStaticProps and getServerSideProps
- !(Component.__N_SSG || Component.__N_SSP) ? {
+ !(__N_SSG || __N_SSP) ? {
url: createUrl(router)
} : {}));
}
Diff for withRouter.html
@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-b44891094f478e273b8e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.33a2a2b5bda58a40c30e.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.0219d1117d670d96ac4e.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-70f1431426f277f2a5de.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-b44891094f478e273b8e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.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"/><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/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" as="script" crossorigin="anonymous"/><link rel="preload" href="/_next/static/runtime/main-d460a781a02bc60b5b2e.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-1ac1d7fc1d59311e5a47.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.5bb7f30f859f5f31359f.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/de003c3a9d308750aa009870a5926f9b18ab31f4.8542cdca4a4ec877d3df.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/chunks/de003c3a9d308750aa009870a5926f9b18ab31f4.d8f88b74aefd825bf023.module.js" async="" crossorigin="anonymous" type="module"></script><script src="/_next/static/runtime/main-4cae1b0fbad1d8015a31.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/runtime/main-d460a781a02bc60b5b2e.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><script src="/_next/static/BUILD_ID/_ssgManifest.js" async="" crossorigin="anonymous" nomodule=""></script><script src="/_next/static/BUILD_ID/_ssgManifest.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 | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
buildDuration | 10.3s | 10.2s | -187ms |
nodeModulesSize | 56.5 MB | 56.5 MB | -1.03 kB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
main-HASH.js gzip | 5.77 kB | 5.77 kB | |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..23c3.js gzip | 9.72 kB | N/A | N/A |
framework.HASH.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..cfaa.js gzip | N/A | 9.77 kB | N/A |
Overall change | 55.4 kB | 55.4 kB |
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
main-HASH.module.js gzip | 4.79 kB | 4.78 kB | -1 B |
webpack-HASH..dule.js gzip | 746 B | 746 B | ✓ |
de003c3a9d30..dule.js gzip | 6.66 kB | N/A | N/A |
framework.HA..dule.js gzip | 39.1 kB | 39.1 kB | ✓ |
de003c3a9d30..dule.js gzip | N/A | 6.71 kB | N/A |
Overall change | 51.3 kB | 51.4 kB |
Legacy Client Bundles (polyfills)
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 18.9 kB | 18.9 kB | ✓ |
Overall change | 18.9 kB | 18.9 kB | ✓ |
Client Pages Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
_app.js gzip | 1.08 kB | 1.09 kB | |
_error.js gzip | 2.96 kB | 2.96 kB | ✓ |
hooks.js gzip | 664 B | 664 B | ✓ |
index.js gzip | 222 B | 222 B | ✓ |
link.js gzip | 1.89 kB | 1.89 kB | ✓ |
routerDirect.js gzip | 279 B | 279 B | ✓ |
withRouter.js gzip | 278 B | 278 B | ✓ |
Overall change | 7.37 kB | 7.38 kB |
Client Pages Modern Overall increase ⚠️
zeit/next.js canary | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
_app.module.js gzip | 589 B | 594 B | |
_error.module.js gzip | 2.06 kB | 2.06 kB | ✓ |
hooks.module.js gzip | 370 B | 370 B | ✓ |
index.module.js gzip | 212 B | 212 B | ✓ |
link.module.js gzip | 1.48 kB | 1.48 kB | ✓ |
routerDirect..dule.js gzip | 271 B | 271 B | ✓ |
withRouter.m..dule.js gzip | 270 B | 270 B | ✓ |
Overall change | 5.26 kB | 5.26 kB |
Client Build Manifests
zeit/next.js canary | ijjk/next.js add/NEXT-101 | 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 | ijjk/next.js add/NEXT-101 | Change | |
---|---|---|---|
_error.js gzip | 292 kB | 292 kB | -318 B |
404.html gzip | 1.32 kB | 1.32 kB | -4 B |
hooks.html gzip | 957 B | 955 B | -2 B |
index.js gzip | 292 kB | 292 kB | |
link.js gzip | 299 kB | 300 kB | |
routerDirect.js gzip | 299 kB | 298 kB | -369 B |
withRouter.js gzip | 298 kB | 298 kB | |
Overall change | 1.48 MB | 1.48 MB | -141 B |
Timer
approved these changes
Mar 6, 2020
Timer
changed the title
Update method for attaching GS(S)P identifier for client page bundles
Update method for attaching GS(S)P identifier to page
Mar 6, 2020
chibicode
pushed a commit
to chibicode/next.js
that referenced
this pull request
Mar 6, 2020
* Update to use separate export instead of attaching to Component to identify GS(S)P pages * Handle initialProps being undefined
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 updates to instead of attaching a property to the page's default export it adds a separate export which is used to identify whether a page has
getStaticProps
orgetServerSideProps
on the client