-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Flying Shuttle experiment #8433
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 (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Client Pages
Client Pages Modern
Fetched pages Overall decrease ✓
DiffsDiff for main-HASH.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[9],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[2],{
/***/ "/h46":
/***/ (function(module, exports, __webpack_require__) {
@@ -343,7 +343,6 @@ 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;
@@ -516,8 +515,6 @@ function () {
return window.__NEXT_PRELOADREADY(dynamicIds);
case 22:
- if (false) {}
-
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader: pageLoader,
@@ -548,7 +545,7 @@ function () {
render(renderCtx);
return _context.abrupt("return", emitter);
- case 27:
+ case 26:
case "end":
return _context.stop();
}
@@ -1435,8 +1432,6 @@ var PageLoader =
/*#__PURE__*/
function () {
function PageLoader(buildId, assetPrefix) {
- var _this3 = this;
-
_classCallCheck(this, PageLoader);
this.buildId = buildId;
@@ -1444,9 +1439,6 @@ 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
@@ -1475,7 +1467,7 @@ function () {
}, {
key: "loadPage",
value: function loadPage(route) {
- var _this4 = this;
+ var _this3 = this;
route = this.normalizeRoute(route);
return new _promise["default"](function (resolve, reject) {
@@ -1483,9 +1475,9 @@ function () {
var error = _ref.error,
page = _ref.page;
- _this4.pageRegisterEvents.off(route, fire);
+ _this3.pageRegisterEvents.off(route, fire);
- delete _this4.loadingRoutes[route];
+ delete _this3.loadingRoutes[route];
if (error) {
reject(error);
@@ -1495,7 +1487,7 @@ function () {
}; // If there's a cached version of the page, let's use it.
- var cachedPage = _this4.pageCache[route];
+ var cachedPage = _this3.pageCache[route];
if (cachedPage) {
var error = cachedPage.error,
@@ -1505,7 +1497,7 @@ function () {
} // Register a listener to get the page
- _this4.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
+ _this3.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
// rather downloading it again.
@@ -1513,11 +1505,11 @@ function () {
return;
}
- if (!_this4.loadingRoutes[route]) {
+ if (!_this3.loadingRoutes[route]) {
if (false) {} else {
- _this4.loadRoute(route);
+ _this3.loadRoute(route);
- _this4.loadingRoutes[route] = true;
+ _this3.loadingRoutes[route] = true;
}
}
});
@@ -1535,22 +1527,13 @@ 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 7:
+ case 4:
case "end":
return _context.stop();
}
@@ -1561,7 +1544,7 @@ function () {
}, {
key: "loadScript",
value: function loadScript(url, route, isPage) {
- var _this5 = this;
+ var _this4 = this;
var script = document.createElement('script');
@@ -1579,7 +1562,7 @@ function () {
var error = new Error("Error loading script " + url);
error.code = 'PAGE_LOAD_ERROR';
- _this5.pageRegisterEvents.emit(route, {
+ _this4.pageRegisterEvents.emit(route, {
error: error
});
};
@@ -1590,7 +1573,7 @@ function () {
}, {
key: "registerPage",
value: function registerPage(route, regFn) {
- var _this6 = this;
+ var _this5 = this;
var register = function register() {
try {
@@ -1598,21 +1581,21 @@ function () {
error = _regFn.error,
page = _regFn.page;
- _this6.pageCache[route] = {
+ _this5.pageCache[route] = {
error: error,
page: page
};
- _this6.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error,
page: page
});
} catch (error) {
- _this6.pageCache[route] = {
+ _this5.pageCache[route] = {
error: error
};
- _this6.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error
});
}
@@ -1635,15 +1618,6 @@ 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";
@@ -1655,68 +1629,68 @@ function () {
// its own deduping mechanism.
if (!document.querySelector("link[rel=\"preload\"][href^=\"" + url + "\"], script[data-next-page=\"" + route + "\"]")) {
- _context2.next = 9;
+ _context2.next = 6;
break;
}
return _context2.abrupt("return");
- case 9:
+ case 6:
if (!(cn = navigator.connection)) {
- _context2.next = 12;
+ _context2.next = 9;
break;
}
if (!((cn.effectiveType || '').indexOf('2g') !== -1 || cn.saveData)) {
- _context2.next = 12;
+ _context2.next = 9;
break;
}
return _context2.abrupt("return");
- case 12:
+ case 9:
if (true) {
- _context2.next = 18;
+ _context2.next = 15;
break;
}
;
- _context2.next = 16;
+ _context2.next = 13;
return _this2.getDependencies(route);
- case 16:
+ case 13:
_context2.t0 = function (url) {
_this2.prefetch(url, true);
};
_context2.sent.forEach(_context2.t0);
- case 18:
+ case 15:
if (!hasPreload) {
- _context2.next = 21;
+ _context2.next = 18;
break;
}
preloadScript(url);
return _context2.abrupt("return");
- case 21:
+ case 18:
if (!isDependency) {
- _context2.next = 23;
+ _context2.next = 20;
break;
}
return _context2.abrupt("return");
- case 23:
+ case 20:
if (!(document.readyState === 'complete')) {
- _context2.next = 27;
+ _context2.next = 24;
break;
}
return _context2.abrupt("return", _this2.loadPage(route)["catch"](function () {}));
- case 27:
+ case 24:
return _context2.abrupt("return", new _promise["default"](function (resolve) {
window.addEventListener('load', function () {
_this2.loadPage(route).then(function () {
@@ -1727,7 +1701,7 @@ function () {
});
}));
- case 28:
+ case 25:
case "end":
return _context2.stop();
} Diff for main-HASH.module.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[9],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[2],{
/***/ "+oT+":
/***/ (function(module, exports, __webpack_require__) {
@@ -416,7 +416,6 @@ const {
page,
query,
buildId,
- dynamicBuildId,
assetPrefix,
runtimeConfig,
dynamicIds
@@ -531,8 +530,6 @@ function () {
yield window.__NEXT_PRELOADREADY(dynamicIds);
}
- if (false) {}
-
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader,
@@ -1351,9 +1348,6 @@ 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
@@ -1424,8 +1418,6 @@ 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;
@@ -1493,8 +1485,6 @@ class PageLoader {
var _this2 = this;
return (0, _asyncToGenerator2.default)(function* () {
- if (false) {}
-
route = _this2.normalizeRoute(route);
let scriptRoute = (route === '/' ? '/index' : route) + ".js"; Diff for _app.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[2],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{
/***/ "B5Ud":
/***/ (function(module, exports, __webpack_require__) { Diff for _error.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[4],{
/***/ "+iuc":
/***/ (function(module, exports, __webpack_require__) { Diff for hooks.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[4],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[5],{
/***/ "+MDD":
/***/ (function(module, __webpack_exports__, __webpack_require__) { Diff for index.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[5],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[6],{
/***/ "RNiq":
/***/ (function(module, __webpack_exports__, __webpack_require__) { Diff for link.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[6],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[7],{
/***/ "/h46":
/***/ (function(module, exports, __webpack_require__) { Diff for routerDirect.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[7],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[8],{
/***/ "LtRI":
/***/ (function(module, exports, __webpack_require__) { Diff for withRouter.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[8],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[9],{
/***/ "0Hlz":
/***/ (function(module, __webpack_exports__, __webpack_require__) { Diff for _app.module.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[2],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{
/***/ "+oT+":
/***/ (function(module, exports, __webpack_require__) { Diff for _error.module.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[4],{
/***/ "+iuc":
/***/ (function(module, exports, __webpack_require__) { Diff for hooks.module.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[4],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[5],{
/***/ "+MDD":
/***/ (function(module, __webpack_exports__, __webpack_require__) { Diff for index.module.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[5],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[6],{
/***/ "RNiq":
/***/ (function(module, __webpack_exports__, __webpack_require__) { Diff for link.module.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[6],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[7],{
/***/ "/h46":
/***/ (function(module, exports, __webpack_require__) { Diff for routerDirect.module.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[7],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[8],{
/***/ "LtRI":
/***/ (function(module, exports, __webpack_require__) { Diff for withRouter.module.js@@ -1,4 +1,4 @@
-(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[8],{
+(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[9],{
/***/ "0Hlz":
/***/ (function(module, __webpack_exports__, __webpack_require__) { Serverless Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Client Pages
Client Pages Modern
Serverless bundles Overall decrease ✓
|
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Client Pages
Client Pages Modern
Fetched pages Overall decrease ✓
DiffsDiff for main-HASH.js@@ -343,7 +343,6 @@ 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;
@@ -516,8 +515,6 @@ function () {
return window.__NEXT_PRELOADREADY(dynamicIds);
case 22:
- if (false) {}
-
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader: pageLoader,
@@ -548,7 +545,7 @@ function () {
render(renderCtx);
return _context.abrupt("return", emitter);
- case 27:
+ case 26:
case "end":
return _context.stop();
}
@@ -1435,8 +1432,6 @@ var PageLoader =
/*#__PURE__*/
function () {
function PageLoader(buildId, assetPrefix) {
- var _this3 = this;
-
_classCallCheck(this, PageLoader);
this.buildId = buildId;
@@ -1444,9 +1439,6 @@ 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
@@ -1475,7 +1467,7 @@ function () {
}, {
key: "loadPage",
value: function loadPage(route) {
- var _this4 = this;
+ var _this3 = this;
route = this.normalizeRoute(route);
return new _promise["default"](function (resolve, reject) {
@@ -1483,9 +1475,9 @@ function () {
var error = _ref.error,
page = _ref.page;
- _this4.pageRegisterEvents.off(route, fire);
+ _this3.pageRegisterEvents.off(route, fire);
- delete _this4.loadingRoutes[route];
+ delete _this3.loadingRoutes[route];
if (error) {
reject(error);
@@ -1495,7 +1487,7 @@ function () {
}; // If there's a cached version of the page, let's use it.
- var cachedPage = _this4.pageCache[route];
+ var cachedPage = _this3.pageCache[route];
if (cachedPage) {
var error = cachedPage.error,
@@ -1505,7 +1497,7 @@ function () {
} // Register a listener to get the page
- _this4.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
+ _this3.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
// rather downloading it again.
@@ -1513,11 +1505,11 @@ function () {
return;
}
- if (!_this4.loadingRoutes[route]) {
+ if (!_this3.loadingRoutes[route]) {
if (false) {} else {
- _this4.loadRoute(route);
+ _this3.loadRoute(route);
- _this4.loadingRoutes[route] = true;
+ _this3.loadingRoutes[route] = true;
}
}
});
@@ -1535,22 +1527,13 @@ 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 7:
+ case 4:
case "end":
return _context.stop();
}
@@ -1561,7 +1544,7 @@ function () {
}, {
key: "loadScript",
value: function loadScript(url, route, isPage) {
- var _this5 = this;
+ var _this4 = this;
var script = document.createElement('script');
@@ -1579,7 +1562,7 @@ function () {
var error = new Error("Error loading script " + url);
error.code = 'PAGE_LOAD_ERROR';
- _this5.pageRegisterEvents.emit(route, {
+ _this4.pageRegisterEvents.emit(route, {
error: error
});
};
@@ -1590,7 +1573,7 @@ function () {
}, {
key: "registerPage",
value: function registerPage(route, regFn) {
- var _this6 = this;
+ var _this5 = this;
var register = function register() {
try {
@@ -1598,21 +1581,21 @@ function () {
error = _regFn.error,
page = _regFn.page;
- _this6.pageCache[route] = {
+ _this5.pageCache[route] = {
error: error,
page: page
};
- _this6.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error,
page: page
});
} catch (error) {
- _this6.pageCache[route] = {
+ _this5.pageCache[route] = {
error: error
};
- _this6.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error
});
}
@@ -1635,15 +1618,6 @@ 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";
@@ -1655,68 +1629,68 @@ function () {
// its own deduping mechanism.
if (!document.querySelector("link[rel=\"preload\"][href^=\"" + url + "\"], script[data-next-page=\"" + route + "\"]")) {
- _context2.next = 9;
+ _context2.next = 6;
break;
}
return _context2.abrupt("return");
- case 9:
+ case 6:
if (!(cn = navigator.connection)) {
- _context2.next = 12;
+ _context2.next = 9;
break;
}
if (!((cn.effectiveType || '').indexOf('2g') !== -1 || cn.saveData)) {
- _context2.next = 12;
+ _context2.next = 9;
break;
}
return _context2.abrupt("return");
- case 12:
+ case 9:
if (true) {
- _context2.next = 18;
+ _context2.next = 15;
break;
}
;
- _context2.next = 16;
+ _context2.next = 13;
return _this2.getDependencies(route);
- case 16:
+ case 13:
_context2.t0 = function (url) {
_this2.prefetch(url, true);
};
_context2.sent.forEach(_context2.t0);
- case 18:
+ case 15:
if (!hasPreload) {
- _context2.next = 21;
+ _context2.next = 18;
break;
}
preloadScript(url);
return _context2.abrupt("return");
- case 21:
+ case 18:
if (!isDependency) {
- _context2.next = 23;
+ _context2.next = 20;
break;
}
return _context2.abrupt("return");
- case 23:
+ case 20:
if (!(document.readyState === 'complete')) {
- _context2.next = 27;
+ _context2.next = 24;
break;
}
return _context2.abrupt("return", _this2.loadPage(route)["catch"](function () {}));
- case 27:
+ case 24:
return _context2.abrupt("return", new _promise["default"](function (resolve) {
window.addEventListener('load', function () {
_this2.loadPage(route).then(function () {
@@ -1727,7 +1701,7 @@ function () {
});
}));
- case 28:
+ case 25:
case "end":
return _context2.stop();
} Diff for main-HASH.module.js@@ -416,7 +416,6 @@ const {
page,
query,
buildId,
- dynamicBuildId,
assetPrefix,
runtimeConfig,
dynamicIds
@@ -531,8 +530,6 @@ function () {
yield window.__NEXT_PRELOADREADY(dynamicIds);
}
- if (false) {}
-
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader,
@@ -1351,9 +1348,6 @@ 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
@@ -1424,8 +1418,6 @@ 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;
@@ -1493,8 +1485,6 @@ class PageLoader {
var _this2 = this;
return (0, _asyncToGenerator2.default)(function* () {
- if (false) {}
-
route = _this2.normalizeRoute(route);
let scriptRoute = (route === '/' ? '/index' : route) + ".js"; Serverless Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Client Pages
Client Pages Modern
Serverless bundles Overall decrease ✓
|
Stats from current PRDefault Server Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Client Pages
Client Pages Modern
Fetched pages Overall decrease ✓
DiffsDiff for main-HASH.js@@ -343,7 +343,6 @@ 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;
@@ -516,8 +515,6 @@ function () {
return window.__NEXT_PRELOADREADY(dynamicIds);
case 22:
- if (false) {}
-
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader: pageLoader,
@@ -548,7 +545,7 @@ function () {
render(renderCtx);
return _context.abrupt("return", emitter);
- case 27:
+ case 26:
case "end":
return _context.stop();
}
@@ -1435,8 +1432,6 @@ var PageLoader =
/*#__PURE__*/
function () {
function PageLoader(buildId, assetPrefix) {
- var _this3 = this;
-
_classCallCheck(this, PageLoader);
this.buildId = buildId;
@@ -1444,9 +1439,6 @@ 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
@@ -1475,7 +1467,7 @@ function () {
}, {
key: "loadPage",
value: function loadPage(route) {
- var _this4 = this;
+ var _this3 = this;
route = this.normalizeRoute(route);
return new _promise["default"](function (resolve, reject) {
@@ -1483,9 +1475,9 @@ function () {
var error = _ref.error,
page = _ref.page;
- _this4.pageRegisterEvents.off(route, fire);
+ _this3.pageRegisterEvents.off(route, fire);
- delete _this4.loadingRoutes[route];
+ delete _this3.loadingRoutes[route];
if (error) {
reject(error);
@@ -1495,7 +1487,7 @@ function () {
}; // If there's a cached version of the page, let's use it.
- var cachedPage = _this4.pageCache[route];
+ var cachedPage = _this3.pageCache[route];
if (cachedPage) {
var error = cachedPage.error,
@@ -1505,7 +1497,7 @@ function () {
} // Register a listener to get the page
- _this4.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
+ _this3.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
// rather downloading it again.
@@ -1513,11 +1505,11 @@ function () {
return;
}
- if (!_this4.loadingRoutes[route]) {
+ if (!_this3.loadingRoutes[route]) {
if (false) {} else {
- _this4.loadRoute(route);
+ _this3.loadRoute(route);
- _this4.loadingRoutes[route] = true;
+ _this3.loadingRoutes[route] = true;
}
}
});
@@ -1535,22 +1527,13 @@ 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 7:
+ case 4:
case "end":
return _context.stop();
}
@@ -1561,7 +1544,7 @@ function () {
}, {
key: "loadScript",
value: function loadScript(url, route, isPage) {
- var _this5 = this;
+ var _this4 = this;
var script = document.createElement('script');
@@ -1579,7 +1562,7 @@ function () {
var error = new Error("Error loading script " + url);
error.code = 'PAGE_LOAD_ERROR';
- _this5.pageRegisterEvents.emit(route, {
+ _this4.pageRegisterEvents.emit(route, {
error: error
});
};
@@ -1590,7 +1573,7 @@ function () {
}, {
key: "registerPage",
value: function registerPage(route, regFn) {
- var _this6 = this;
+ var _this5 = this;
var register = function register() {
try {
@@ -1598,21 +1581,21 @@ function () {
error = _regFn.error,
page = _regFn.page;
- _this6.pageCache[route] = {
+ _this5.pageCache[route] = {
error: error,
page: page
};
- _this6.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error,
page: page
});
} catch (error) {
- _this6.pageCache[route] = {
+ _this5.pageCache[route] = {
error: error
};
- _this6.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error
});
}
@@ -1635,15 +1618,6 @@ 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";
@@ -1655,68 +1629,68 @@ function () {
// its own deduping mechanism.
if (!document.querySelector("link[rel=\"preload\"][href^=\"" + url + "\"], script[data-next-page=\"" + route + "\"]")) {
- _context2.next = 9;
+ _context2.next = 6;
break;
}
return _context2.abrupt("return");
- case 9:
+ case 6:
if (!(cn = navigator.connection)) {
- _context2.next = 12;
+ _context2.next = 9;
break;
}
if (!((cn.effectiveType || '').indexOf('2g') !== -1 || cn.saveData)) {
- _context2.next = 12;
+ _context2.next = 9;
break;
}
return _context2.abrupt("return");
- case 12:
+ case 9:
if (true) {
- _context2.next = 18;
+ _context2.next = 15;
break;
}
;
- _context2.next = 16;
+ _context2.next = 13;
return _this2.getDependencies(route);
- case 16:
+ case 13:
_context2.t0 = function (url) {
_this2.prefetch(url, true);
};
_context2.sent.forEach(_context2.t0);
- case 18:
+ case 15:
if (!hasPreload) {
- _context2.next = 21;
+ _context2.next = 18;
break;
}
preloadScript(url);
return _context2.abrupt("return");
- case 21:
+ case 18:
if (!isDependency) {
- _context2.next = 23;
+ _context2.next = 20;
break;
}
return _context2.abrupt("return");
- case 23:
+ case 20:
if (!(document.readyState === 'complete')) {
- _context2.next = 27;
+ _context2.next = 24;
break;
}
return _context2.abrupt("return", _this2.loadPage(route)["catch"](function () {}));
- case 27:
+ case 24:
return _context2.abrupt("return", new _promise["default"](function (resolve) {
window.addEventListener('load', function () {
_this2.loadPage(route).then(function () {
@@ -1727,7 +1701,7 @@ function () {
});
}));
- case 28:
+ case 25:
case "end":
return _context2.stop();
} Diff for main-HASH.module.js@@ -416,7 +416,6 @@ const {
page,
query,
buildId,
- dynamicBuildId,
assetPrefix,
runtimeConfig,
dynamicIds
@@ -531,8 +530,6 @@ function () {
yield window.__NEXT_PRELOADREADY(dynamicIds);
}
- if (false) {}
-
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader,
@@ -1351,9 +1348,6 @@ 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
@@ -1424,8 +1418,6 @@ 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;
@@ -1493,8 +1485,6 @@ class PageLoader {
var _this2 = this;
return (0, _asyncToGenerator2.default)(function* () {
- if (false) {}
-
route = _this2.normalizeRoute(route);
let scriptRoute = (route === '/' ? '/index' : route) + ".js"; Serverless Mode (Decrease detected ✓)General Overall decrease ✓
Client Bundles (main, webpack, commons) Overall decrease ✓
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
Client Pages
Client Pages Modern
Serverless bundles Overall decrease ✓
|
ijjk
reviewed
Aug 20, 2019
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
buildDuration | 25.2s | 24.6s | -591ms |
nodeModulesSize | 41.3 MB | 41.2 MB | -67.5 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
main-HASH.js | 18.2 kB | 18.1 kB | -107 B |
main-HASH.js gzip | 6.65 kB | 6.63 kB | -24 B |
webpack-HASH.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
Overall change | -107 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
main-HASH.module.js | 16.5 kB | 16.5 kB | -61 B |
main-HASH.module.js gzip | 6.37 kB | 6.36 kB | -11 B |
webpack-HASH.module.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.module.js gzip | 746 B | 746 B | ✓ |
Overall change | -61 B |
Client Pages
zeit/next.js canary | Timer/next.js remove-flying-shuttle | 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 | Timer/next.js remove-flying-shuttle | 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 Overall increase ⚠️
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
_buildManifest.js | 81 B | 81 B | ✓ |
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManifest.module.js | 518 B | 519 B | |
_buildManifest.module.js gzip | 309 B | 310 B | |
Overall change |
Fetched pages Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
link | 3.77 kB | 3.75 kB | -20 B |
link gzip | 971 B | 963 B | -8 B |
index | 3.71 kB | 3.69 kB | -20 B |
index gzip | 962 B | 954 B | -8 B |
withRouter | 3.77 kB | 3.75 kB | -20 B |
withRouter gzip | 957 B | 950 B | -7 B |
Overall change | -60 B |
Diffs
Diff for main-HASH.js
@@ -343,7 +343,6 @@ 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;
@@ -516,8 +515,6 @@ function () {
return window.__NEXT_PRELOADREADY(dynamicIds);
case 22:
- if (false) {}
-
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader: pageLoader,
@@ -548,7 +545,7 @@ function () {
render(renderCtx);
return _context.abrupt("return", emitter);
- case 27:
+ case 26:
case "end":
return _context.stop();
}
@@ -1435,8 +1432,6 @@ var PageLoader =
/*#__PURE__*/
function () {
function PageLoader(buildId, assetPrefix) {
- var _this3 = this;
-
_classCallCheck(this, PageLoader);
this.buildId = buildId;
@@ -1444,7 +1439,6 @@ function () {
this.pageCache = {};
this.pageRegisterEvents = (0, _mitt["default"])();
this.loadingRoutes = {};
- this.promisedBuildId = _promise["default"].resolve();
if (true) {
this.promisedBuildManifest = new _promise["default"](function (resolve) {
@@ -1457,8 +1451,6 @@ function () {
}
});
}
-
- if (false) {}
} // Returns a promise for the dependencies for a particular route
@@ -1485,7 +1477,7 @@ function () {
}, {
key: "loadPage",
value: function loadPage(route) {
- var _this4 = this;
+ var _this3 = this;
route = this.normalizeRoute(route);
return new _promise["default"](function (resolve, reject) {
@@ -1493,9 +1485,9 @@ function () {
var error = _ref.error,
page = _ref.page;
- _this4.pageRegisterEvents.off(route, fire);
+ _this3.pageRegisterEvents.off(route, fire);
- delete _this4.loadingRoutes[route];
+ delete _this3.loadingRoutes[route];
if (error) {
reject(error);
@@ -1505,7 +1497,7 @@ function () {
}; // If there's a cached version of the page, let's use it.
- var cachedPage = _this4.pageCache[route];
+ var cachedPage = _this3.pageCache[route];
if (cachedPage) {
var error = cachedPage.error,
@@ -1515,7 +1507,7 @@ function () {
} // Register a listener to get the page
- _this4.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
+ _this3.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
// rather downloading it again.
@@ -1523,18 +1515,18 @@ function () {
return;
}
- if (!_this4.loadingRoutes[route]) {
+ if (!_this3.loadingRoutes[route]) {
if (true) {
- _this4.getDependencies(route).then(function (deps) {
+ _this3.getDependencies(route).then(function (deps) {
deps.forEach(function (d) {
if (!document.querySelector("script[src^=\"" + d + "\"]")) {
- _this4.loadScript(d, route, false);
+ _this3.loadScript(d, route, false);
}
});
- _this4.loadRoute(route);
+ _this3.loadRoute(route);
- _this4.loadingRoutes[route] = true;
+ _this3.loadingRoutes[route] = true;
});
} else {}
}
@@ -1553,22 +1545,13 @@ 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 7:
+ case 4:
case "end":
return _context.stop();
}
@@ -1579,7 +1562,7 @@ function () {
}, {
key: "loadScript",
value: function loadScript(url, route, isPage) {
- var _this5 = this;
+ var _this4 = this;
var script = document.createElement('script');
@@ -1597,7 +1580,7 @@ function () {
var error = new Error("Error loading script " + url);
error.code = 'PAGE_LOAD_ERROR';
- _this5.pageRegisterEvents.emit(route, {
+ _this4.pageRegisterEvents.emit(route, {
error: error
});
};
@@ -1608,7 +1591,7 @@ function () {
}, {
key: "registerPage",
value: function registerPage(route, regFn) {
- var _this6 = this;
+ var _this5 = this;
var register = function register() {
try {
@@ -1616,21 +1599,21 @@ function () {
error = _regFn.error,
page = _regFn.page;
- _this6.pageCache[route] = {
+ _this5.pageCache[route] = {
error: error,
page: page
};
- _this6.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error,
page: page
});
} catch (error) {
- _this6.pageCache[route] = {
+ _this5.pageCache[route] = {
error: error
};
- _this6.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error
});
}
@@ -1653,15 +1636,6 @@ 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";
@@ -1673,68 +1647,68 @@ function () {
// its own deduping mechanism.
if (!document.querySelector("link[rel=\"preload\"][href^=\"" + url + "\"], script[data-next-page=\"" + route + "\"]")) {
- _context2.next = 9;
+ _context2.next = 6;
break;
}
return _context2.abrupt("return");
- case 9:
+ case 6:
if (!(cn = navigator.connection)) {
- _context2.next = 12;
+ _context2.next = 9;
break;
}
if (!((cn.effectiveType || '').indexOf('2g') !== -1 || cn.saveData)) {
- _context2.next = 12;
+ _context2.next = 9;
break;
}
return _context2.abrupt("return");
- case 12:
+ case 9:
if (!( true && !isDependency)) {
- _context2.next = 18;
+ _context2.next = 15;
break;
}
;
- _context2.next = 16;
+ _context2.next = 13;
return _this2.getDependencies(route);
- case 16:
+ case 13:
_context2.t0 = function (url) {
_this2.prefetch(url, true);
};
_context2.sent.forEach(_context2.t0);
- case 18:
+ case 15:
if (!hasPreload) {
- _context2.next = 21;
+ _context2.next = 18;
break;
}
preloadScript(url);
return _context2.abrupt("return");
- case 21:
+ case 18:
if (!isDependency) {
- _context2.next = 23;
+ _context2.next = 20;
break;
}
return _context2.abrupt("return");
- case 23:
+ case 20:
if (!(document.readyState === 'complete')) {
- _context2.next = 27;
+ _context2.next = 24;
break;
}
return _context2.abrupt("return", _this2.loadPage(route)["catch"](function () {}));
- case 27:
+ case 24:
return _context2.abrupt("return", new _promise["default"](function (resolve) {
window.addEventListener('load', function () {
_this2.loadPage(route).then(function () {
@@ -1745,7 +1719,7 @@ function () {
});
}));
- case 28:
+ case 25:
case "end":
return _context2.stop();
}
Diff for main-HASH.module.js
@@ -416,7 +416,6 @@ const {
page,
query,
buildId,
- dynamicBuildId,
assetPrefix,
runtimeConfig,
dynamicIds
@@ -531,8 +530,6 @@ function () {
yield window.__NEXT_PRELOADREADY(dynamicIds);
}
- if (false) {}
-
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader,
@@ -1351,7 +1348,6 @@ class PageLoader {
this.pageCache = {};
this.pageRegisterEvents = (0, _mitt.default)();
this.loadingRoutes = {};
- this.promisedBuildId = _promise.default.resolve();
if (true) {
this.promisedBuildManifest = new _promise.default(resolve => {
@@ -1364,8 +1360,6 @@ class PageLoader {
}
});
}
-
- if (false) {}
} // Returns a promise for the dependencies for a particular route
@@ -1441,8 +1435,6 @@ 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;
@@ -1510,8 +1502,6 @@ class PageLoader {
var _this2 = this;
return (0, _asyncToGenerator2.default)(function* () {
- if (false) {}
-
route = _this2.normalizeRoute(route);
let scriptRoute = (route === '/' ? '/index' : route) + ".js";
Diff for _buildManifest.module.js
@@ -1 +1 @@
-self.__BUILD_MANIFEST = (function(a,b,c,d){return {"/":[a,b],"/_error":[a,c,b],"/hooks":[a,c,b],"/index":[a,b],"/link":[a,c,d,b],"/routerDirect":[a,c,d,b],"/withRouter":[a,c,d,b]}}("static\u002Fruntime\u002Fwebpack-7928590be3ef2e55b835.module.js","static\u002Fruntime\u002Fmain-0299981520514dd2cc2d.module.js","static\u002Fchunks\u002Fframework.cdb73e402d876d4ac87f.module.js","static\u002Fchunks\u002F1QSRrB48e94JKY+T5oL8O+DtGUk=.2da329b7caecfd217e7f.module.js"));self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
\ No newline at end of file
+self.__BUILD_MANIFEST = (function(a,b,c,d){return {"/":[a,b],"/_error":[a,c,b],"/hooks":[a,c,b],"/index":[a,b],"/link":[a,c,d,b],"/routerDirect":[a,c,d,b],"/withRouter":[a,c,d,b]}}("static\u002Fruntime\u002Fwebpack-7928590be3ef2e55b835.module.js","static\u002Fruntime\u002Fmain-26f52093cd5cae22a02c.module.js","static\u002Fchunks\u002Fframework.cdb73e402d876d4ac87f.module.js","static\u002Fchunks\u002FXm27wiwD0rzW4VpjNIt99rPaI=.2da329b7caecfd217e7f.module.js"));self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
\ No newline at end of file
Serverless Mode (Increase detected ⚠️ )
General Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
buildDuration | 26.5s | 25.9s | -586ms |
nodeModulesSize | 41.3 MB | 41.2 MB | -67.5 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
main-HASH.js | 18.2 kB | 18.1 kB | -108 B |
main-HASH.js gzip | 6.65 kB | 6.62 kB | -25 B |
webpack-HASH.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
Overall change | -108 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
main-HASH.module.js | 16.5 kB | 16.5 kB | -62 B |
main-HASH.module.js gzip | 6.37 kB | 6.36 kB | -12 B |
webpack-HASH.module.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.module.js gzip | 746 B | 746 B | ✓ |
Overall change | -62 B |
Client Pages Overall increase ⚠️
zeit/next.js canary | Timer/next.js remove-flying-shuttle | 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 | 434 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 Overall increase ⚠️
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
_app.module.js | 1.79 kB | 1.79 kB | ✓ |
_app.module.js gzip | 867 B | 866 B | -1 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 | 805 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 | 430 B | |
withRouter.module.js gzip | 293 B | 293 B | ✓ |
Overall change |
Client Build Manifests
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
_buildManifest.js | 81 B | 81 B | ✓ |
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManifest.module.js | 518 B | 518 B | ✓ |
_buildManifest.module.js gzip | 311 B | 310 B | -1 B |
Overall change | ✓ |
Serverless bundles Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
_error.js | 248 kB | 248 kB | -730 B |
_error.js gzip | 66.5 kB | 66.5 kB | |
hooks.html | 3.83 kB | 3.81 kB | -23 B |
hooks.html gzip | 995 B | 979 B | -16 B |
index.js | 249 kB | 248 kB | -855 B |
index.js gzip | 66.8 kB | 66.6 kB | -241 B |
link.js | 256 kB | 255 kB | -855 B |
link.js gzip | 69 kB | 68.9 kB | -74 B |
routerDirect.js | 249 kB | 249 kB | -855 B |
routerDirect.js gzip | 66.7 kB | 66.7 kB | -59 B |
withRouter.js | 249 kB | 249 kB | -855 B |
withRouter.js gzip | 66.8 kB | 66.8 kB | -54 B |
Overall change | -4.17 kB |
Stats from current PRDefault Server Mode (Increase detected
|
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
buildDuration | 23.8s | 23.6s | -207ms |
nodeModulesSize | 41.3 MB | 41.2 MB | -67.5 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
main-HASH.js | 18.2 kB | 18.1 kB | -107 B |
main-HASH.js gzip | 6.65 kB | 6.63 kB | -24 B |
webpack-HASH.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
Overall change | -107 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
main-HASH.module.js | 16.5 kB | 16.5 kB | -61 B |
main-HASH.module.js gzip | 6.37 kB | 6.36 kB | -11 B |
webpack-HASH.module.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.module.js gzip | 746 B | 746 B | ✓ |
Overall change | -61 B |
Client Pages
zeit/next.js canary | Timer/next.js remove-flying-shuttle | 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 | Timer/next.js remove-flying-shuttle | 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 Overall increase ⚠️
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
_buildManifest.js | 81 B | 81 B | ✓ |
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManifest.module.js | 518 B | 519 B | |
_buildManifest.module.js gzip | 309 B | 311 B | |
Overall change |
Fetched pages Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
link | 3.77 kB | 3.75 kB | -20 B |
link gzip | 973 B | 962 B | -11 B |
index | 3.71 kB | 3.69 kB | -20 B |
index gzip | 965 B | 953 B | -12 B |
withRouter | 3.77 kB | 3.75 kB | -20 B |
withRouter gzip | 960 B | 948 B | -12 B |
Overall change | -60 B |
Diffs
Diff for main-HASH.js
@@ -343,7 +343,6 @@ 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;
@@ -516,8 +515,6 @@ function () {
return window.__NEXT_PRELOADREADY(dynamicIds);
case 22:
- if (false) {}
-
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader: pageLoader,
@@ -548,7 +545,7 @@ function () {
render(renderCtx);
return _context.abrupt("return", emitter);
- case 27:
+ case 26:
case "end":
return _context.stop();
}
@@ -1435,8 +1432,6 @@ var PageLoader =
/*#__PURE__*/
function () {
function PageLoader(buildId, assetPrefix) {
- var _this3 = this;
-
_classCallCheck(this, PageLoader);
this.buildId = buildId;
@@ -1444,7 +1439,6 @@ function () {
this.pageCache = {};
this.pageRegisterEvents = (0, _mitt["default"])();
this.loadingRoutes = {};
- this.promisedBuildId = _promise["default"].resolve();
if (true) {
this.promisedBuildManifest = new _promise["default"](function (resolve) {
@@ -1457,8 +1451,6 @@ function () {
}
});
}
-
- if (false) {}
} // Returns a promise for the dependencies for a particular route
@@ -1485,7 +1477,7 @@ function () {
}, {
key: "loadPage",
value: function loadPage(route) {
- var _this4 = this;
+ var _this3 = this;
route = this.normalizeRoute(route);
return new _promise["default"](function (resolve, reject) {
@@ -1493,9 +1485,9 @@ function () {
var error = _ref.error,
page = _ref.page;
- _this4.pageRegisterEvents.off(route, fire);
+ _this3.pageRegisterEvents.off(route, fire);
- delete _this4.loadingRoutes[route];
+ delete _this3.loadingRoutes[route];
if (error) {
reject(error);
@@ -1505,7 +1497,7 @@ function () {
}; // If there's a cached version of the page, let's use it.
- var cachedPage = _this4.pageCache[route];
+ var cachedPage = _this3.pageCache[route];
if (cachedPage) {
var error = cachedPage.error,
@@ -1515,7 +1507,7 @@ function () {
} // Register a listener to get the page
- _this4.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
+ _this3.pageRegisterEvents.on(route, fire); // If the page is loading via SSR, we need to wait for it
// rather downloading it again.
@@ -1523,18 +1515,18 @@ function () {
return;
}
- if (!_this4.loadingRoutes[route]) {
+ if (!_this3.loadingRoutes[route]) {
if (true) {
- _this4.getDependencies(route).then(function (deps) {
+ _this3.getDependencies(route).then(function (deps) {
deps.forEach(function (d) {
if (!document.querySelector("script[src^=\"" + d + "\"]")) {
- _this4.loadScript(d, route, false);
+ _this3.loadScript(d, route, false);
}
});
- _this4.loadRoute(route);
+ _this3.loadRoute(route);
- _this4.loadingRoutes[route] = true;
+ _this3.loadingRoutes[route] = true;
});
} else {}
}
@@ -1553,22 +1545,13 @@ 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 7:
+ case 4:
case "end":
return _context.stop();
}
@@ -1579,7 +1562,7 @@ function () {
}, {
key: "loadScript",
value: function loadScript(url, route, isPage) {
- var _this5 = this;
+ var _this4 = this;
var script = document.createElement('script');
@@ -1597,7 +1580,7 @@ function () {
var error = new Error("Error loading script " + url);
error.code = 'PAGE_LOAD_ERROR';
- _this5.pageRegisterEvents.emit(route, {
+ _this4.pageRegisterEvents.emit(route, {
error: error
});
};
@@ -1608,7 +1591,7 @@ function () {
}, {
key: "registerPage",
value: function registerPage(route, regFn) {
- var _this6 = this;
+ var _this5 = this;
var register = function register() {
try {
@@ -1616,21 +1599,21 @@ function () {
error = _regFn.error,
page = _regFn.page;
- _this6.pageCache[route] = {
+ _this5.pageCache[route] = {
error: error,
page: page
};
- _this6.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error,
page: page
});
} catch (error) {
- _this6.pageCache[route] = {
+ _this5.pageCache[route] = {
error: error
};
- _this6.pageRegisterEvents.emit(route, {
+ _this5.pageRegisterEvents.emit(route, {
error: error
});
}
@@ -1653,15 +1636,6 @@ 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";
@@ -1673,68 +1647,68 @@ function () {
// its own deduping mechanism.
if (!document.querySelector("link[rel=\"preload\"][href^=\"" + url + "\"], script[data-next-page=\"" + route + "\"]")) {
- _context2.next = 9;
+ _context2.next = 6;
break;
}
return _context2.abrupt("return");
- case 9:
+ case 6:
if (!(cn = navigator.connection)) {
- _context2.next = 12;
+ _context2.next = 9;
break;
}
if (!((cn.effectiveType || '').indexOf('2g') !== -1 || cn.saveData)) {
- _context2.next = 12;
+ _context2.next = 9;
break;
}
return _context2.abrupt("return");
- case 12:
+ case 9:
if (!( true && !isDependency)) {
- _context2.next = 18;
+ _context2.next = 15;
break;
}
;
- _context2.next = 16;
+ _context2.next = 13;
return _this2.getDependencies(route);
- case 16:
+ case 13:
_context2.t0 = function (url) {
_this2.prefetch(url, true);
};
_context2.sent.forEach(_context2.t0);
- case 18:
+ case 15:
if (!hasPreload) {
- _context2.next = 21;
+ _context2.next = 18;
break;
}
preloadScript(url);
return _context2.abrupt("return");
- case 21:
+ case 18:
if (!isDependency) {
- _context2.next = 23;
+ _context2.next = 20;
break;
}
return _context2.abrupt("return");
- case 23:
+ case 20:
if (!(document.readyState === 'complete')) {
- _context2.next = 27;
+ _context2.next = 24;
break;
}
return _context2.abrupt("return", _this2.loadPage(route)["catch"](function () {}));
- case 27:
+ case 24:
return _context2.abrupt("return", new _promise["default"](function (resolve) {
window.addEventListener('load', function () {
_this2.loadPage(route).then(function () {
@@ -1745,7 +1719,7 @@ function () {
});
}));
- case 28:
+ case 25:
case "end":
return _context2.stop();
}
Diff for main-HASH.module.js
@@ -416,7 +416,6 @@ const {
page,
query,
buildId,
- dynamicBuildId,
assetPrefix,
runtimeConfig,
dynamicIds
@@ -531,8 +530,6 @@ function () {
yield window.__NEXT_PRELOADREADY(dynamicIds);
}
- if (false) {}
-
exports.router = router = (0, _router.createRouter)(page, query, asPath, {
initialProps: props,
pageLoader,
@@ -1351,7 +1348,6 @@ class PageLoader {
this.pageCache = {};
this.pageRegisterEvents = (0, _mitt.default)();
this.loadingRoutes = {};
- this.promisedBuildId = _promise.default.resolve();
if (true) {
this.promisedBuildManifest = new _promise.default(resolve => {
@@ -1364,8 +1360,6 @@ class PageLoader {
}
});
}
-
- if (false) {}
} // Returns a promise for the dependencies for a particular route
@@ -1441,8 +1435,6 @@ 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;
@@ -1510,8 +1502,6 @@ class PageLoader {
var _this2 = this;
return (0, _asyncToGenerator2.default)(function* () {
- if (false) {}
-
route = _this2.normalizeRoute(route);
let scriptRoute = (route === '/' ? '/index' : route) + ".js";
Diff for _buildManifest.module.js
@@ -1 +1 @@
-self.__BUILD_MANIFEST = (function(a,b,c,d){return {"/":[a,b],"/_error":[a,c,b],"/hooks":[a,c,b],"/index":[a,b],"/link":[a,c,d,b],"/routerDirect":[a,c,d,b],"/withRouter":[a,c,d,b]}}("static\u002Fruntime\u002Fwebpack-7928590be3ef2e55b835.module.js","static\u002Fruntime\u002Fmain-0299981520514dd2cc2d.module.js","static\u002Fchunks\u002Fframework.cdb73e402d876d4ac87f.module.js","static\u002Fchunks\u002FdnN3gmjSugypOOxWPFQu1dHcqkM=.2da329b7caecfd217e7f.module.js"));self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
\ No newline at end of file
+self.__BUILD_MANIFEST = (function(a,b,c,d){return {"/":[a,b],"/_error":[a,c,b],"/hooks":[a,c,b],"/index":[a,b],"/link":[a,c,d,b],"/routerDirect":[a,c,d,b],"/withRouter":[a,c,d,b]}}("static\u002Fruntime\u002Fwebpack-7928590be3ef2e55b835.module.js","static\u002Fruntime\u002Fmain-26f52093cd5cae22a02c.module.js","static\u002Fchunks\u002Fframework.cdb73e402d876d4ac87f.module.js","static\u002Fchunks\u002F24hvswtizmz9KJSLe9Kb2mlOa3c=.2da329b7caecfd217e7f.module.js"));self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()
\ No newline at end of file
Serverless Mode (Increase detected ⚠️ )
General Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
buildDuration | 25.6s | 25.3s | -256ms |
nodeModulesSize | 41.3 MB | 41.2 MB | -67.5 kB |
Client Bundles (main, webpack, commons) Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
main-HASH.js | 18.2 kB | 18.1 kB | -107 B |
main-HASH.js gzip | 6.65 kB | 6.63 kB | -24 B |
webpack-HASH.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.js gzip | 746 B | 746 B | ✓ |
Overall change | -107 B |
Client Bundles (main, webpack, commons) Modern Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
main-HASH.module.js | 16.5 kB | 16.5 kB | -61 B |
main-HASH.module.js gzip | 6.37 kB | 6.36 kB | -11 B |
webpack-HASH.module.js | 1.53 kB | 1.53 kB | ✓ |
webpack-HASH.module.js gzip | 746 B | 746 B | ✓ |
Overall change | -61 B |
Client Pages
zeit/next.js canary | Timer/next.js remove-flying-shuttle | 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 | Timer/next.js remove-flying-shuttle | 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 Overall increase ⚠️
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
_buildManifest.js | 81 B | 81 B | ✓ |
_buildManifest.js gzip | 61 B | 61 B | ✓ |
_buildManifest.module.js | 517 B | 519 B | |
_buildManifest.module.js gzip | 310 B | 312 B | |
Overall change |
Serverless bundles Overall decrease ✓
zeit/next.js canary | Timer/next.js remove-flying-shuttle | Change | |
---|---|---|---|
_error.js | 248 kB | 248 kB | -719 B |
_error.js gzip | 66.5 kB | 66.5 kB | |
hooks.html | 3.83 kB | 3.81 kB | -18 B |
hooks.html gzip | 991 B | 981 B | -10 B |
index.js | 249 kB | 248 kB | -844 B |
index.js gzip | 66.8 kB | 66.6 kB | -241 B |
link.js | 256 kB | 255 kB | -844 B |
link.js gzip | 69 kB | 68.9 kB | -73 B |
routerDirect.js | 249 kB | 249 kB | -844 B |
routerDirect.js gzip | 66.7 kB | 66.7 kB | -58 B |
withRouter.js | 249 kB | 249 kB | -844 B |
withRouter.js gzip | 66.8 kB | 66.8 kB | -53 B |
Overall change | -4.11 kB |
timneutkens
approved these changes
Aug 20, 2019
timneutkens
approved these changes
Aug 20, 2019
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.
Removes a lot of maintenance burden for something we're no longer invested in.