-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
Fix a broken link in webpack config #8456
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
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
buildDuration | 25.4s | 25.7s | |
nodeModulesSize | 41.2 MB | 41.3 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.js | 17.8 kB | 17.9 kB | |
main-HASH.js gzip | 6.54 kB | 6.56 kB | |
webpack-HASH.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
commons.HASH.js | 190 kB | 190 kB | ✓ |
commons.HASH.js gzip | 61.6 kB | 61.6 kB | ✓ |
Overall change |
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.module.js | 16.1 kB | 16.2 kB | |
main-HASH.module.js gzip | 6.27 kB | 6.28 kB | |
webpack-HASH.module.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.module.js gzip | 746 B | 746 B | ✓ |
commons.HASH.module.js | 171 kB | 171 kB | ✓ |
commons.HASH.module.js gzip | 55.4 kB | 55.4 kB | ✓ |
Overall change |
Client Pages
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.js | 1.9 kB | 1.9 kB | ✓ |
_app.js gzip | 905 B | 905 B | ✓ |
_error.js | 12.1 kB | 12.1 kB | ✓ |
_error.js gzip | 4.76 kB | 4.76 kB | ✓ |
hooks.js | 1.06 kB | 1.06 kB | ✓ |
hooks.js gzip | 600 B | 600 B | ✓ |
index.js | 343 B | 343 B | ✓ |
index.js gzip | 237 B | 237 B | ✓ |
link.js | 8.13 kB | 8.13 kB | ✓ |
link.js gzip | 3.49 kB | 3.49 kB | ✓ |
routerDirect.js | 429 B | 429 B | ✓ |
routerDirect.js gzip | 292 B | 292 B | ✓ |
withRouter.js | 439 B | 439 B | ✓ |
withRouter.js gzip | 290 B | 290 B | ✓ |
Overall change | ✓ |
Client Pages Modern
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.module.js | 1.79 kB | 1.79 kB | ✓ |
_app.module.js gzip | 865 B | 865 B | ✓ |
_error.module.js | 10.6 kB | 10.6 kB | ✓ |
_error.module.js gzip | 4.31 kB | 4.31 kB | ✓ |
hooks.module.js | 596 B | 596 B | ✓ |
hooks.module.js gzip | 354 B | 354 B | ✓ |
index.module.js | 319 B | 319 B | ✓ |
index.module.js gzip | 238 B | 238 B | ✓ |
link.module.js | 8.52 kB | 8.52 kB | ✓ |
link.module.js gzip | 3.67 kB | 3.67 kB | ✓ |
routerDirect.module.js | 417 B | 417 B | ✓ |
routerDirect.module.js gzip | 292 B | 292 B | ✓ |
withRouter.module.js | 427 B | 427 B | ✓ |
withRouter.module.js gzip | 291 B | 291 B | ✓ |
Overall change | ✓ |
Fetched pages Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
link | 2.78 kB | 2.8 kB | |
link gzip | 835 B | 849 B | |
index | 2.73 kB | 2.75 kB | |
index gzip | 829 B | 841 B | |
withRouter | 2.79 kB | 2.81 kB | |
withRouter gzip | 824 B | 837 B | |
Overall change |
Diffs
Diff for main-HASH.js
@@ -343,6 +343,7 @@ var props = data.props,
page = data.page,
query = data.query,
buildId = data.buildId,
+ dynamicBuildId = data.dynamicBuildId,
assetPrefix = data.assetPrefix,
runtimeConfig = data.runtimeConfig,
dynamicIds = data.dynamicIds;
@@ -515,6 +516,8 @@ function () {
return window.__NEXT_PRELOADREADY(dynamicIds);
case 22:
+ if (false) {}
+
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader: pageLoader,
@@ -545,7 +548,7 @@ function () {
render(renderCtx);
return _context.abrupt("return", emitter);
- case 26:
+ case 27:
case "end":
return _context.stop();
}
@@ -1432,6 +1435,8 @@ var PageLoader =
/*#__PURE__*/
function () {
function PageLoader(buildId, assetPrefix) {
+ var _this3 = this;
+
_classCallCheck(this, PageLoader);
this.buildId = buildId;
@@ -1439,6 +1444,9 @@ function () {
this.pageCache = {};
this.pageRegisterEvents = (0, _mitt["default"])();
this.loadingRoutes = {};
+ this.promisedBuildId = _promise["default"].resolve();
+
+ if (false) {}
if (false) {}
} // Returns a promise for the dependencies for a particular route
@@ -1467,7 +1475,7 @@ function () {
}, {
key: "loadPage",
value: function loadPage(route) {
- var _this3 = this;
+ var _this4 = this;
route = this.normalizeRoute(route);
return new _promise["default"](function (resolve, reject) {
@@ -1475,9 +1483,9 @@ function () {
var error = _ref.error,
page = _ref.page;
- _this3.pageRegisterEvents.off(route, fire);
+ _this4.pageRegisterEvents.off(route, fire);
- delete _this3.loadingRoutes[route];
+ delete _this4.loadingRoutes[route];
if (error) {
reject(error);
@@ -1487,7 +1495,7 @@ function () {
}; // If there's a cached version of the page, let's use it.
- var cachedPage = _this3.pageCache[route];
+ var cachedPage = _this4.pageCache[route];
if (cachedPage) {
var error = cachedPage.error,
@@ -1497,7 +1505,7 @@ function () {
} // Register a listener to get the page
- _this3.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
+ _this4.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
// rather downloading it again.
@@ -1505,11 +1513,11 @@ function () {
return;
}
- if (!_this3.loadingRoutes[route]) {
+ if (!_this4.loadingRoutes[route]) {
if (false) {} else {
- _this3.loadRoute(route);
+ _this4.loadRoute(route);
- _this3.loadingRoutes[route] = true;
+ _this4.loadingRoutes[route] = true;
}
}
});
@@ -1527,13 +1535,22 @@ function () {
while (1) {
switch (_context.prev = _context.next) {
case 0:
+ if (true) {
+ _context.next = 3;
+ break;
+ }
+
+ _context.next = 3;
+ return _this.promisedBuildId;
+
+ case 3:
route = _this.normalizeRoute(route);
scriptRoute = route === '/' ? '/index.js' : route + ".js";
url = _this.assetPrefix + "/_next/static/" + encodeURIComponent(_this.buildId) + "/pages" + scriptRoute;
_this.loadScript(url, route, true);
- case 4:
+ case 7:
case "end":
return _context.stop();
}
@@ -1544,7 +1561,7 @@ function () {
}, {
key: "loadScript",
value: function loadScript(url, route, isPage) {
- var _this4 = this;
+ var _this5 = this;
var script = document.createElement('script');
@@ -1562,7 +1579,7 @@ function () {
var error = new Error("Error loading script " + url);
error.code = 'PAGE_LOAD_ERROR';
- _this4.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error
});
};
@@ -1573,7 +1590,7 @@ function () {
}, {
key: "registerPage",
value: function registerPage(route, regFn) {
- var _this5 = this;
+ var _this6 = this;
var register = function register() {
try {
@@ -1581,21 +1598,21 @@ function () {
error = _regFn.error,
page = _regFn.page;
- _this5.pageCache[route] = {
+ _this6.pageCache[route] = {
error: error,
page: page
};
- _this5.pageRegisterEvents.emit(route, {
+ _this6.pageRegisterEvents.emit(route, {
error: error,
page: page
});
} catch (error) {
- _this5.pageCache[route] = {
+ _this6.pageCache[route] = {
error: error
};
- _this5.pageRegisterEvents.emit(route, {
+ _this6.pageRegisterEvents.emit(route, {
error: error
});
}
@@ -1618,6 +1635,15 @@ function () {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
+ if (true) {
+ _context2.next = 3;
+ break;
+ }
+
+ _context2.next = 3;
+ return _this2.promisedBuildId;
+
+ case 3:
route = _this2.normalizeRoute(route);
scriptRoute = (route === '/' ? '/index' : route) + ".js";
@@ -1629,68 +1655,68 @@ function () {
// its own deduping mechanism.
if (!document.querySelector("link[rel=\"preload\"][href^=\"" + url + "\"], script[data-next-page=\"" + route + "\"]")) {
- _context2.next = 6;
+ _context2.next = 9;
break;
}
return _context2.abrupt("return");
- case 6:
+ case 9:
if (!(cn = navigator.connection)) {
- _context2.next = 9;
+ _context2.next = 12;
break;
}
if (!((cn.effectiveType || '').indexOf('2g') !== -1 || cn.saveData)) {
- _context2.next = 9;
+ _context2.next = 12;
break;
}
return _context2.abrupt("return");
- case 9:
+ case 12:
if (true) {
- _context2.next = 15;
+ _context2.next = 18;
break;
}
;
- _context2.next = 13;
+ _context2.next = 16;
return _this2.getDependencies(route);
- case 13:
+ case 16:
_context2.t0 = function (url) {
_this2.prefetch(url, true);
};
_context2.sent.forEach(_context2.t0);
- case 15:
+ case 18:
if (!hasPreload) {
- _context2.next = 18;
+ _context2.next = 21;
break;
}
preloadScript(url);
return _context2.abrupt("return");
- case 18:
+ case 21:
if (!isDependency) {
- _context2.next = 20;
+ _context2.next = 23;
break;
}
return _context2.abrupt("return");
- case 20:
+ case 23:
if (!(document.readyState === 'complete')) {
- _context2.next = 24;
+ _context2.next = 27;
break;
}
return _context2.abrupt("return", _this2.loadPage(route)["catch"](function () {}));
- case 24:
+ case 27:
return _context2.abrupt("return", new _promise["default"](function (resolve) {
window.addEventListener('load', function () {
_this2.loadPage(route).then(function () {
@@ -1701,7 +1727,7 @@ function () {
});
}));
- case 25:
+ case 28:
case "end":
return _context2.stop();
}
Diff for main-HASH.module.js
@@ -416,6 +416,7 @@ const {
page,
query,
buildId,
+ dynamicBuildId,
assetPrefix,
runtimeConfig,
dynamicIds
@@ -530,6 +531,8 @@ function () {
yield window.__NEXT_PRELOADREADY(dynamicIds);
}
+ if (false) {}
+
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader,
@@ -1348,6 +1351,9 @@ class PageLoader {
this.pageCache = {};
this.pageRegisterEvents = (0, _mitt.default)();
this.loadingRoutes = {};
+ this.promisedBuildId = _promise.default.resolve();
+
+ if (false) {}
if (false) {}
} // Returns a promise for the dependencies for a particular route
@@ -1418,6 +1424,8 @@ class PageLoader {
var _this = this;
return (0, _asyncToGenerator2.default)(function* () {
+ if (false) {}
+
route = _this.normalizeRoute(route);
let scriptRoute = route === '/' ? '/index.js' : route + ".js";
const url = _this.assetPrefix + "/_next/static/" + encodeURIComponent(_this.buildId) + "/pages" + scriptRoute;
@@ -1485,6 +1493,8 @@ class PageLoader {
var _this2 = this;
return (0, _asyncToGenerator2.default)(function* () {
+ if (false) {}
+
route = _this2.normalizeRoute(route);
let scriptRoute = (route === '/' ? '/index' : route) + ".js";
Serverless Mode (Increase detected ⚠️ )
General Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
buildDuration | 26.6s | 26.4s | -229ms |
nodeModulesSize | 41.2 MB | 41.3 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.js | 17.8 kB | 17.9 kB | |
main-HASH.js gzip | 6.54 kB | 6.56 kB | |
webpack-HASH.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
commons.HASH.js | 190 kB | 190 kB | ✓ |
commons.HASH.js gzip | 61.6 kB | 61.6 kB | ✓ |
Overall change |
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.module.js | 16.1 kB | 16.2 kB | |
main-HASH.module.js gzip | 6.27 kB | 6.28 kB | |
webpack-HASH.module.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.module.js gzip | 746 B | 746 B | ✓ |
commons.HASH.module.js | 171 kB | 171 kB | ✓ |
commons.HASH.module.js gzip | 55.4 kB | 55.4 kB | ✓ |
Overall change |
Client Pages
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.js | 1.9 kB | 1.9 kB | ✓ |
_app.js gzip | 905 B | 905 B | ✓ |
_error.js | 12.1 kB | 12.1 kB | ✓ |
_error.js gzip | 4.76 kB | 4.76 kB | ✓ |
hooks.js | 1.06 kB | 1.06 kB | ✓ |
hooks.js gzip | 600 B | 600 B | ✓ |
index.js | 343 B | 343 B | ✓ |
index.js gzip | 237 B | 237 B | ✓ |
link.js | 8.13 kB | 8.13 kB | ✓ |
link.js gzip | 3.49 kB | 3.49 kB | ✓ |
routerDirect.js | 429 B | 429 B | ✓ |
routerDirect.js gzip | 292 B | 292 B | ✓ |
withRouter.js | 439 B | 439 B | ✓ |
withRouter.js gzip | 290 B | 290 B | ✓ |
Overall change | ✓ |
Client Pages Modern
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.module.js | 1.79 kB | 1.79 kB | ✓ |
_app.module.js gzip | 865 B | 865 B | ✓ |
_error.module.js | 10.6 kB | 10.6 kB | ✓ |
_error.module.js gzip | 4.31 kB | 4.31 kB | ✓ |
hooks.module.js | 596 B | 596 B | ✓ |
hooks.module.js gzip | 354 B | 354 B | ✓ |
index.module.js | 319 B | 319 B | ✓ |
index.module.js gzip | 238 B | 238 B | ✓ |
link.module.js | 8.52 kB | 8.52 kB | ✓ |
link.module.js gzip | 3.67 kB | 3.67 kB | ✓ |
routerDirect.module.js | 417 B | 417 B | ✓ |
routerDirect.module.js gzip | 292 B | 292 B | ✓ |
withRouter.module.js | 427 B | 427 B | ✓ |
withRouter.module.js gzip | 291 B | 291 B | ✓ |
Overall change | ✓ |
Serverless bundles Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_error.js | 247 kB | 247 kB | |
_error.js gzip | 66.1 kB | 66.3 kB | |
hooks.html | 2.85 kB | 2.87 kB | |
hooks.html gzip | 852 B | 866 B | |
index.js | 247 kB | 248 kB | |
index.js gzip | 66.3 kB | 66.6 kB | |
link.js | 255 kB | 255 kB | |
link.js gzip | 68.6 kB | 68.8 kB | |
routerDirect.js | 248 kB | 248 kB | |
routerDirect.js gzip | 66.5 kB | 66.5 kB | |
withRouter.js | 248 kB | 248 kB | |
withRouter.js gzip | 66.7 kB | 66.6 kB | -23 B |
Overall change |
huv1k
previously approved these changes
Aug 21, 2019
timneutkens
previously approved these changes
Aug 21, 2019
I've updated the test to pass 👍 |
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
buildDuration | 24.9s | 25s | |
nodeModulesSize | 41.2 MB | 41.3 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.js | 17.8 kB | 17.9 kB | |
main-HASH.js gzip | 6.54 kB | 6.56 kB | |
webpack-HASH.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
commons.HASH.js | 190 kB | 190 kB | ✓ |
commons.HASH.js gzip | 61.6 kB | 61.6 kB | ✓ |
Overall change |
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.module.js | 16.1 kB | 16.2 kB | |
main-HASH.module.js gzip | 6.27 kB | 6.28 kB | |
webpack-HASH.module.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.module.js gzip | 746 B | 746 B | ✓ |
commons.HASH.module.js | 171 kB | 171 kB | ✓ |
commons.HASH.module.js gzip | 55.4 kB | 55.4 kB | ✓ |
Overall change |
Client Pages
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.js | 1.9 kB | 1.9 kB | ✓ |
_app.js gzip | 905 B | 905 B | ✓ |
_error.js | 12.1 kB | 12.1 kB | ✓ |
_error.js gzip | 4.76 kB | 4.76 kB | ✓ |
hooks.js | 1.06 kB | 1.06 kB | ✓ |
hooks.js gzip | 600 B | 600 B | ✓ |
index.js | 343 B | 343 B | ✓ |
index.js gzip | 237 B | 237 B | ✓ |
link.js | 8.13 kB | 8.13 kB | ✓ |
link.js gzip | 3.49 kB | 3.49 kB | ✓ |
routerDirect.js | 429 B | 429 B | ✓ |
routerDirect.js gzip | 292 B | 292 B | ✓ |
withRouter.js | 439 B | 439 B | ✓ |
withRouter.js gzip | 290 B | 290 B | ✓ |
Overall change | ✓ |
Client Pages Modern
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.module.js | 1.79 kB | 1.79 kB | ✓ |
_app.module.js gzip | 865 B | 865 B | ✓ |
_error.module.js | 10.6 kB | 10.6 kB | ✓ |
_error.module.js gzip | 4.31 kB | 4.31 kB | ✓ |
hooks.module.js | 596 B | 596 B | ✓ |
hooks.module.js gzip | 354 B | 354 B | ✓ |
index.module.js | 319 B | 319 B | ✓ |
index.module.js gzip | 238 B | 238 B | ✓ |
link.module.js | 8.52 kB | 8.52 kB | ✓ |
link.module.js gzip | 3.67 kB | 3.67 kB | ✓ |
routerDirect.module.js | 417 B | 417 B | ✓ |
routerDirect.module.js gzip | 292 B | 292 B | ✓ |
withRouter.module.js | 427 B | 427 B | ✓ |
withRouter.module.js gzip | 291 B | 291 B | ✓ |
Overall change | ✓ |
Fetched pages Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
link | 2.78 kB | 2.8 kB | |
link gzip | 835 B | 850 B | |
index | 2.73 kB | 2.75 kB | |
index gzip | 827 B | 842 B | |
withRouter | 2.79 kB | 2.81 kB | |
withRouter gzip | 823 B | 838 B | |
Overall change |
Diffs
Diff for main-HASH.js
@@ -343,6 +343,7 @@ var props = data.props,
page = data.page,
query = data.query,
buildId = data.buildId,
+ dynamicBuildId = data.dynamicBuildId,
assetPrefix = data.assetPrefix,
runtimeConfig = data.runtimeConfig,
dynamicIds = data.dynamicIds;
@@ -515,6 +516,8 @@ function () {
return window.__NEXT_PRELOADREADY(dynamicIds);
case 22:
+ if (false) {}
+
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader: pageLoader,
@@ -545,7 +548,7 @@ function () {
render(renderCtx);
return _context.abrupt("return", emitter);
- case 26:
+ case 27:
case "end":
return _context.stop();
}
@@ -1432,6 +1435,8 @@ var PageLoader =
/*#__PURE__*/
function () {
function PageLoader(buildId, assetPrefix) {
+ var _this3 = this;
+
_classCallCheck(this, PageLoader);
this.buildId = buildId;
@@ -1439,6 +1444,9 @@ function () {
this.pageCache = {};
this.pageRegisterEvents = (0, _mitt["default"])();
this.loadingRoutes = {};
+ this.promisedBuildId = _promise["default"].resolve();
+
+ if (false) {}
if (false) {}
} // Returns a promise for the dependencies for a particular route
@@ -1467,7 +1475,7 @@ function () {
}, {
key: "loadPage",
value: function loadPage(route) {
- var _this3 = this;
+ var _this4 = this;
route = this.normalizeRoute(route);
return new _promise["default"](function (resolve, reject) {
@@ -1475,9 +1483,9 @@ function () {
var error = _ref.error,
page = _ref.page;
- _this3.pageRegisterEvents.off(route, fire);
+ _this4.pageRegisterEvents.off(route, fire);
- delete _this3.loadingRoutes[route];
+ delete _this4.loadingRoutes[route];
if (error) {
reject(error);
@@ -1487,7 +1495,7 @@ function () {
}; // If there's a cached version of the page, let's use it.
- var cachedPage = _this3.pageCache[route];
+ var cachedPage = _this4.pageCache[route];
if (cachedPage) {
var error = cachedPage.error,
@@ -1497,7 +1505,7 @@ function () {
} // Register a listener to get the page
- _this3.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
+ _this4.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
// rather downloading it again.
@@ -1505,11 +1513,11 @@ function () {
return;
}
- if (!_this3.loadingRoutes[route]) {
+ if (!_this4.loadingRoutes[route]) {
if (false) {} else {
- _this3.loadRoute(route);
+ _this4.loadRoute(route);
- _this3.loadingRoutes[route] = true;
+ _this4.loadingRoutes[route] = true;
}
}
});
@@ -1527,13 +1535,22 @@ function () {
while (1) {
switch (_context.prev = _context.next) {
case 0:
+ if (true) {
+ _context.next = 3;
+ break;
+ }
+
+ _context.next = 3;
+ return _this.promisedBuildId;
+
+ case 3:
route = _this.normalizeRoute(route);
scriptRoute = route === '/' ? '/index.js' : route + ".js";
url = _this.assetPrefix + "/_next/static/" + encodeURIComponent(_this.buildId) + "/pages" + scriptRoute;
_this.loadScript(url, route, true);
- case 4:
+ case 7:
case "end":
return _context.stop();
}
@@ -1544,7 +1561,7 @@ function () {
}, {
key: "loadScript",
value: function loadScript(url, route, isPage) {
- var _this4 = this;
+ var _this5 = this;
var script = document.createElement('script');
@@ -1562,7 +1579,7 @@ function () {
var error = new Error("Error loading script " + url);
error.code = 'PAGE_LOAD_ERROR';
- _this4.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error
});
};
@@ -1573,7 +1590,7 @@ function () {
}, {
key: "registerPage",
value: function registerPage(route, regFn) {
- var _this5 = this;
+ var _this6 = this;
var register = function register() {
try {
@@ -1581,21 +1598,21 @@ function () {
error = _regFn.error,
page = _regFn.page;
- _this5.pageCache[route] = {
+ _this6.pageCache[route] = {
error: error,
page: page
};
- _this5.pageRegisterEvents.emit(route, {
+ _this6.pageRegisterEvents.emit(route, {
error: error,
page: page
});
} catch (error) {
- _this5.pageCache[route] = {
+ _this6.pageCache[route] = {
error: error
};
- _this5.pageRegisterEvents.emit(route, {
+ _this6.pageRegisterEvents.emit(route, {
error: error
});
}
@@ -1618,6 +1635,15 @@ function () {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
+ if (true) {
+ _context2.next = 3;
+ break;
+ }
+
+ _context2.next = 3;
+ return _this2.promisedBuildId;
+
+ case 3:
route = _this2.normalizeRoute(route);
scriptRoute = (route === '/' ? '/index' : route) + ".js";
@@ -1629,68 +1655,68 @@ function () {
// its own deduping mechanism.
if (!document.querySelector("link[rel=\"preload\"][href^=\"" + url + "\"], script[data-next-page=\"" + route + "\"]")) {
- _context2.next = 6;
+ _context2.next = 9;
break;
}
return _context2.abrupt("return");
- case 6:
+ case 9:
if (!(cn = navigator.connection)) {
- _context2.next = 9;
+ _context2.next = 12;
break;
}
if (!((cn.effectiveType || '').indexOf('2g') !== -1 || cn.saveData)) {
- _context2.next = 9;
+ _context2.next = 12;
break;
}
return _context2.abrupt("return");
- case 9:
+ case 12:
if (true) {
- _context2.next = 15;
+ _context2.next = 18;
break;
}
;
- _context2.next = 13;
+ _context2.next = 16;
return _this2.getDependencies(route);
- case 13:
+ case 16:
_context2.t0 = function (url) {
_this2.prefetch(url, true);
};
_context2.sent.forEach(_context2.t0);
- case 15:
+ case 18:
if (!hasPreload) {
- _context2.next = 18;
+ _context2.next = 21;
break;
}
preloadScript(url);
return _context2.abrupt("return");
- case 18:
+ case 21:
if (!isDependency) {
- _context2.next = 20;
+ _context2.next = 23;
break;
}
return _context2.abrupt("return");
- case 20:
+ case 23:
if (!(document.readyState === 'complete')) {
- _context2.next = 24;
+ _context2.next = 27;
break;
}
return _context2.abrupt("return", _this2.loadPage(route)["catch"](function () {}));
- case 24:
+ case 27:
return _context2.abrupt("return", new _promise["default"](function (resolve) {
window.addEventListener('load', function () {
_this2.loadPage(route).then(function () {
@@ -1701,7 +1727,7 @@ function () {
});
}));
- case 25:
+ case 28:
case "end":
return _context2.stop();
}
Diff for main-HASH.module.js
@@ -416,6 +416,7 @@ const {
page,
query,
buildId,
+ dynamicBuildId,
assetPrefix,
runtimeConfig,
dynamicIds
@@ -530,6 +531,8 @@ function () {
yield window.__NEXT_PRELOADREADY(dynamicIds);
}
+ if (false) {}
+
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader,
@@ -1348,6 +1351,9 @@ class PageLoader {
this.pageCache = {};
this.pageRegisterEvents = (0, _mitt.default)();
this.loadingRoutes = {};
+ this.promisedBuildId = _promise.default.resolve();
+
+ if (false) {}
if (false) {}
} // Returns a promise for the dependencies for a particular route
@@ -1418,6 +1424,8 @@ class PageLoader {
var _this = this;
return (0, _asyncToGenerator2.default)(function* () {
+ if (false) {}
+
route = _this.normalizeRoute(route);
let scriptRoute = route === '/' ? '/index.js' : route + ".js";
const url = _this.assetPrefix + "/_next/static/" + encodeURIComponent(_this.buildId) + "/pages" + scriptRoute;
@@ -1485,6 +1493,8 @@ class PageLoader {
var _this2 = this;
return (0, _asyncToGenerator2.default)(function* () {
+ if (false) {}
+
route = _this2.normalizeRoute(route);
let scriptRoute = (route === '/' ? '/index' : route) + ".js";
Serverless Mode (Increase detected ⚠️ )
General Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
buildDuration | 26.2s | 26.7s | |
nodeModulesSize | 41.2 MB | 41.3 MB |
Client Bundles (main, webpack, commons) Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.js | 17.8 kB | 17.9 kB | |
main-HASH.js gzip | 6.54 kB | 6.56 kB | |
webpack-HASH.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
commons.HASH.js | 190 kB | 190 kB | ✓ |
commons.HASH.js gzip | 61.6 kB | 61.6 kB | ✓ |
Overall change |
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.module.js | 16.1 kB | 16.2 kB | |
main-HASH.module.js gzip | 6.27 kB | 6.28 kB | |
webpack-HASH.module.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.module.js gzip | 746 B | 746 B | ✓ |
commons.HASH.module.js | 171 kB | 171 kB | ✓ |
commons.HASH.module.js gzip | 55.4 kB | 55.4 kB | ✓ |
Overall change |
Client Pages
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.js | 1.9 kB | 1.9 kB | ✓ |
_app.js gzip | 905 B | 905 B | ✓ |
_error.js | 12.1 kB | 12.1 kB | ✓ |
_error.js gzip | 4.76 kB | 4.76 kB | ✓ |
hooks.js | 1.06 kB | 1.06 kB | ✓ |
hooks.js gzip | 600 B | 600 B | ✓ |
index.js | 343 B | 343 B | ✓ |
index.js gzip | 237 B | 237 B | ✓ |
link.js | 8.13 kB | 8.13 kB | ✓ |
link.js gzip | 3.49 kB | 3.49 kB | ✓ |
routerDirect.js | 429 B | 429 B | ✓ |
routerDirect.js gzip | 292 B | 292 B | ✓ |
withRouter.js | 439 B | 439 B | ✓ |
withRouter.js gzip | 290 B | 290 B | ✓ |
Overall change | ✓ |
Client Pages Modern
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.module.js | 1.79 kB | 1.79 kB | ✓ |
_app.module.js gzip | 865 B | 865 B | ✓ |
_error.module.js | 10.6 kB | 10.6 kB | ✓ |
_error.module.js gzip | 4.31 kB | 4.31 kB | ✓ |
hooks.module.js | 596 B | 596 B | ✓ |
hooks.module.js gzip | 354 B | 354 B | ✓ |
index.module.js | 319 B | 319 B | ✓ |
index.module.js gzip | 238 B | 238 B | ✓ |
link.module.js | 8.52 kB | 8.52 kB | ✓ |
link.module.js gzip | 3.67 kB | 3.67 kB | ✓ |
routerDirect.module.js | 417 B | 417 B | ✓ |
routerDirect.module.js gzip | 292 B | 292 B | ✓ |
withRouter.module.js | 427 B | 427 B | ✓ |
withRouter.module.js gzip | 291 B | 291 B | ✓ |
Overall change | ✓ |
Serverless bundles Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_error.js | 247 kB | 247 kB | |
_error.js gzip | 66.3 kB | 66.3 kB | |
hooks.html | 2.85 kB | 2.87 kB | |
hooks.html gzip | 853 B | 868 B | |
index.js | 247 kB | 248 kB | |
index.js gzip | 66.4 kB | 66.6 kB | |
link.js | 255 kB | 255 kB | |
link.js gzip | 68.6 kB | 68.8 kB | |
routerDirect.js | 248 kB | 248 kB | |
routerDirect.js gzip | 66.6 kB | 66.5 kB | -45 B |
withRouter.js | 248 kB | 248 kB | |
withRouter.js gzip | 66.7 kB | 66.6 kB | -30 B |
Overall change |
Timer
approved these changes
Aug 21, 2019
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
buildDuration | 23.6s | 23.7s | |
nodeModulesSize | 41.2 MB | 41.2 MB | -6 B |
Client Bundles (main, webpack, commons)
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.js | 18.1 kB | 18.1 kB | ✓ |
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
Overall change | ✓ |
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.module.js | 16.5 kB | 16.5 kB | ✓ |
main-HASH.module.js gzip | 6.36 kB | 6.36 kB | ✓ |
webpack-HASH.module.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.module.js gzip | 746 B | 746 B | ✓ |
Overall change | ✓ |
Client Pages
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.js | 1.9 kB | 1.9 kB | ✓ |
_app.js gzip | 908 B | 908 B | ✓ |
_error.js | 12.1 kB | 12.1 kB | ✓ |
_error.js gzip | 4.76 kB | 4.76 kB | ✓ |
hooks.js | 12.7 kB | 12.7 kB | ✓ |
hooks.js gzip | 4.81 kB | 4.81 kB | ✓ |
index.js | 343 B | 343 B | ✓ |
index.js gzip | 237 B | 237 B | ✓ |
link.js | 8.14 kB | 8.14 kB | ✓ |
link.js gzip | 3.49 kB | 3.49 kB | ✓ |
routerDirect.js | 433 B | 433 B | ✓ |
routerDirect.js gzip | 296 B | 296 B | ✓ |
withRouter.js | 444 B | 444 B | ✓ |
withRouter.js gzip | 294 B | 294 B | ✓ |
Overall change | ✓ |
Client Pages Modern
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.module.js | 1.79 kB | 1.79 kB | ✓ |
_app.module.js gzip | 867 B | 867 B | ✓ |
_error.module.js | 23.3 kB | 23.3 kB | ✓ |
_error.module.js gzip | 8.62 kB | 8.62 kB | ✓ |
hooks.module.js | 1.55 kB | 1.55 kB | ✓ |
hooks.module.js gzip | 804 B | 804 B | ✓ |
index.module.js | 319 B | 319 B | ✓ |
index.module.js gzip | 238 B | 238 B | ✓ |
link.module.js | 8.52 kB | 8.52 kB | ✓ |
link.module.js gzip | 3.68 kB | 3.68 kB | ✓ |
routerDirect.module.js | 419 B | 419 B | ✓ |
routerDirect.module.js gzip | 294 B | 294 B | ✓ |
withRouter.module.js | 429 B | 429 B | ✓ |
withRouter.module.js gzip | 293 B | 293 B | ✓ |
Overall change | ✓ |
Client Build Manifests
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_buildManifest.js | 81 B | 81 B | ✓ |
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManifest.module.js | 81 B | 81 B | ✓ |
_buildManifest.module.js gzip | 61 B | 61 B | ✓ |
Overall change | ✓ |
Fetched pages Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
link | 3.74 kB | 3.75 kB | |
link gzip | 964 B | 963 B | -1 B |
index | 3.69 kB | 3.69 kB | |
index gzip | 955 B | 955 B | ✓ |
withRouter | 3.75 kB | 3.75 kB | |
withRouter gzip | 950 B | 949 B | -1 B |
Overall change |
Serverless Mode (Increase detected ⚠️ )
General Overall decrease ✓
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
buildDuration | 25.2s | 24.9s | -297ms |
nodeModulesSize | 41.2 MB | 41.2 MB | -6 B |
Client Bundles (main, webpack, commons)
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.js | 18.1 kB | 18.1 kB | ✓ |
main-HASH.js gzip | 6.63 kB | 6.63 kB | ✓ |
webpack-HASH.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
Overall change | ✓ |
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
main-HASH.module.js | 16.5 kB | 16.5 kB | ✓ |
main-HASH.module.js gzip | 6.36 kB | 6.36 kB | ✓ |
webpack-HASH.module.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.module.js gzip | 746 B | 746 B | ✓ |
Overall change | ✓ |
Client Pages
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.js | 1.9 kB | 1.9 kB | ✓ |
_app.js gzip | 908 B | 908 B | ✓ |
_error.js | 12.1 kB | 12.1 kB | ✓ |
_error.js gzip | 4.76 kB | 4.76 kB | ✓ |
hooks.js | 12.7 kB | 12.7 kB | ✓ |
hooks.js gzip | 4.81 kB | 4.81 kB | ✓ |
index.js | 343 B | 343 B | ✓ |
index.js gzip | 237 B | 237 B | ✓ |
link.js | 8.14 kB | 8.14 kB | ✓ |
link.js gzip | 3.49 kB | 3.49 kB | ✓ |
routerDirect.js | 433 B | 433 B | ✓ |
routerDirect.js gzip | 296 B | 296 B | ✓ |
withRouter.js | 444 B | 444 B | ✓ |
withRouter.js gzip | 294 B | 294 B | ✓ |
Overall change | ✓ |
Client Pages Modern
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_app.module.js | 1.79 kB | 1.79 kB | ✓ |
_app.module.js gzip | 867 B | 867 B | ✓ |
_error.module.js | 23.3 kB | 23.3 kB | ✓ |
_error.module.js gzip | 8.62 kB | 8.62 kB | ✓ |
hooks.module.js | 1.55 kB | 1.55 kB | ✓ |
hooks.module.js gzip | 804 B | 804 B | ✓ |
index.module.js | 319 B | 319 B | ✓ |
index.module.js gzip | 238 B | 238 B | ✓ |
link.module.js | 8.52 kB | 8.52 kB | ✓ |
link.module.js gzip | 3.68 kB | 3.68 kB | ✓ |
routerDirect.module.js | 419 B | 419 B | ✓ |
routerDirect.module.js gzip | 294 B | 294 B | ✓ |
withRouter.module.js | 429 B | 429 B | ✓ |
withRouter.module.js gzip | 293 B | 293 B | ✓ |
Overall change | ✓ |
Client Build Manifests
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_buildManifest.js | 81 B | 81 B | ✓ |
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManifest.module.js | 81 B | 81 B | ✓ |
_buildManifest.module.js gzip | 61 B | 61 B | ✓ |
Overall change | ✓ |
Serverless bundles Overall increase ⚠️
zeit/next.js canary | ranyitz/next.js patch-1 | Change | |
---|---|---|---|
_error.js | 248 kB | 248 kB | |
_error.js gzip | 66.5 kB | 66.3 kB | -190 B |
hooks.html | 3.81 kB | 3.81 kB | |
hooks.html gzip | 977 B | 974 B | -3 B |
index.js | 248 kB | 248 kB | |
index.js gzip | 66.7 kB | 66.8 kB | |
link.js | 256 kB | 256 kB | |
link.js gzip | 68.9 kB | 68.8 kB | -58 B |
routerDirect.js | 249 kB | 249 kB | |
routerDirect.js gzip | 66.7 kB | 66.7 kB | |
withRouter.js | 249 kB | 249 kB | |
withRouter.js gzip | 66.7 kB | 66.6 kB | -32 B |
Overall change |
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.
The link https://err.sh/zeit/next.js/promise-in-next-config.md directs to https://github.com/zeit/next.js/blob/master/errors/promise-in-next-config.md.md which is not the correct URL.
This PR fixes it.