Skip to content
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

Debug CircleCi #8191

Closed
wants to merge 1 commit into from
Closed

Debug CircleCi #8191

wants to merge 1 commit into from

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Jul 31, 2019

Testing CircleCi failures possibly due to new image released 19 hours ago

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats ⚠️ Total Bundle Size Increase ⚠️
zeit/next.js canary ijjk/next.js debug-circle Change
Build Duration 13.2s 13.1s -32ms
node_modules Size 45.9 MB 45.9 MB ⚠️ +787 B
Total Bundle (main, webpack, commons) Size 206 kB 206 kB ⚠️ +237 B
Total Bundle (main, webpack, commons) gzip Size 67.8 kB 67.9 kB ⚠️ +43 B
Client _app Size 2.39 kB 2.39 kB
Client _app gzip Size 1.08 kB 1.08 kB
Client _error Size 8.22 kB 8.22 kB
Client _error gzip Size 3.16 kB 3.16 kB
Client pages/index Size 343 B 343 B
Client pages/index gzip Size 246 B 246 B
Client pages/link Size 4.08 kB 4.08 kB
Client pages/link gzip Size 1.8 kB 1.8 kB
Client pages/routerDirect Size 423 B 423 B
Client pages/routerDirect gzip Size 306 B 306 B
Client pages/withRouter Size 435 B 435 B
Client pages/withRouter gzip Size 301 B 301 B
Client main Size 15.4 kB 15.6 kB ⚠️ +237 B
Client main gzip Size 5.35 kB 5.39 kB ⚠️ +43 B
Client commons Size 188 kB 188 kB
Client commons gzip Size 61.1 kB 61.1 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 770 B 770 B
Base Rendered Size 1.35 kB 1.35 kB
Build Dir Size 702 kB 703 kB ⚠️ +1.11 kB
Click to expand serverless stats ⚠️ Total Bundle Size Increase ⚠️
zeit/next.js canary ijjk/next.js debug-circle Change
Build Duration 14.1s 14.5s ⚠️ +395ms
node_modules Size 45.9 MB 45.9 MB ⚠️ +787 B
Total Bundle (main, webpack, commons) Size 206 kB 206 kB ⚠️ +237 B
Total Bundle (main, webpack, commons) gzip Size 67.8 kB 67.9 kB ⚠️ +43 B
Client _app Size 2.39 kB 2.39 kB
Client _app gzip Size 1.08 kB 1.08 kB
Client _error Size 8.22 kB 8.22 kB
Client _error gzip Size 3.16 kB 3.16 kB
Client pages/index Size 343 B 343 B
Client pages/index gzip Size 246 B 246 B
Client pages/link Size 4.08 kB 4.08 kB
Client pages/link gzip Size 1.8 kB 1.8 kB
Client pages/routerDirect Size 423 B 423 B
Client pages/routerDirect gzip Size 306 B 306 B
Client pages/withRouter Size 435 B 435 B
Client pages/withRouter gzip Size 301 B 301 B
Client main Size 15.4 kB 15.6 kB ⚠️ +237 B
Client main gzip Size 5.35 kB 5.39 kB ⚠️ +43 B
Client commons Size 188 kB 188 kB
Client commons gzip Size 61.1 kB 61.1 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 770 B 770 B
Serverless pages/link Size 252 kB 252 kB
Serverless pages/link gzip Size 67.9 kB 67.9 kB -3 B
Serverless pages/index Size 244 kB 244 kB
Serverless pages/index gzip Size 65.8 kB 65.8 kB -1 B
Serverless pages/_error Size 244 kB 244 kB
Serverless pages/_error gzip Size 65.5 kB 65.5 kB -2 B
Serverless pages/routerDirect Size 245 kB 245 kB
Serverless pages/routerDirect gzip Size 65.7 kB 65.7 kB -3 B
Serverless pages/withRouter Size 245 kB 245 kB
Serverless pages/withRouter gzip Size 65.9 kB 65.8 kB -2 B
Build Dir Size 1.89 MB 1.89 MB ⚠️ +1.11 kB
Diff for main.js
@@ -1103,26 +1103,22 @@ var _mitt = _interopRequireDefault(__webpack_require__("kiME"));
 
 var _unfetch = _interopRequireDefault(__webpack_require__("m/Gl"));
 /* global document */
+// smaller version of https://gist.github.com/igrigorik/a02f2359f3bc50ca7a9c
 
 
-function supportsPreload(el) {
+function supportsPreload(list) {
+  if (!list || !list.supports) {
+    return false;
+  }
+
   try {
-    return el.relList.supports('preload');
-  } catch (_unused) {
+    return list.supports('preload');
+  } catch (e) {
     return false;
   }
 }
 
-var hasPreload = supportsPreload(document.createElement('link'));
-
-function preloadScript(url) {
-  var link = document.createElement('link');
-  link.rel = 'preload';
-  link.crossOrigin = undefined;
-  link.href = url;
-  link.as = 'script';
-  document.head.appendChild(link);
-}
+var hasPreload = supportsPreload(document.createElement('link').relList);
 
 var PageLoader =
 /*#__PURE__*/
@@ -1313,7 +1309,7 @@ function () {
       return (0, _asyncToGenerator2["default"])(
       /*#__PURE__*/
       _regenerator["default"].mark(function _callee2() {
-        var scriptRoute, cn;
+        var scriptRoute, link;
         return _regenerator["default"].wrap(function _callee2$(_context2) {
           while (1) {
             switch (_context2.prev = _context2.next) {
@@ -1332,14 +1328,15 @@ function () {
 
               case 5:
                 _this2.prefetchCache.add(scriptRoute); // Inspired by quicklink, license: https://github.com/GoogleChromeLabs/quicklink/blob/master/LICENSE
+                // Don't prefetch if the user is on 2G / Don't prefetch if Save-Data is enabled
 
 
-                if (!(cn = navigator.connection)) {
+                if (!('connection' in navigator)) {
                   _context2.next = 9;
                   break;
                 }
 
-                if (!((cn.effectiveType || '').indexOf('2g') !== -1 || cn.saveData)) {
+                if (!((navigator.connection.effectiveType || '').indexOf('2g') !== -1 || navigator.connection.saveData)) {
                   _context2.next = 9;
                   break;
                 }
@@ -1348,7 +1345,7 @@ function () {
 
               case 9:
                 if (!hasPreload) {
-                  _context2.next = 14;
+                  _context2.next = 19;
                   break;
                 }
 
@@ -1356,18 +1353,23 @@ function () {
                 return _this2.promisedBuildId;
 
               case 12:
-                preloadScript(_this2.assetPrefix + "/_next/static/" + encodeURIComponent(_this2.buildId) + "/pages" + scriptRoute);
+                link = document.createElement('link');
+                link.rel = 'preload';
+                link.crossOrigin = undefined;
+                link.href = _this2.assetPrefix + "/_next/static/" + encodeURIComponent(_this2.buildId) + "/pages" + scriptRoute;
+                link.as = 'script';
+                document.head.appendChild(link);
                 return _context2.abrupt("return");
 
-              case 14:
+              case 19:
                 if (!(document.readyState === 'complete')) {
-                  _context2.next = 18;
+                  _context2.next = 23;
                   break;
                 }
 
                 return _context2.abrupt("return", _this2.loadPage(route)["catch"](function () {}));
 
-              case 18:
+              case 23:
                 return _context2.abrupt("return", new _promise["default"](function (resolve) {
                   window.addEventListener('load', function () {
                     _this2.loadPage(route).then(function () {
@@ -1378,7 +1380,7 @@ function () {
                   });
                 }));
 
-              case 19:
+              case 24:
               case "end":
                 return _context2.stop();
             }
@@ -1386,6 +1388,18 @@ function () {
         }, _callee2);
       }))();
     }
+  }, {
+    key: "clearCache",
+    value: function clearCache(route) {
+      route = this.normalizeRoute(route);
+      delete this.pageCache[route];
+      delete this.loadingRoutes[route];
+      var script = document.getElementById("__NEXT_PAGE__" + route);
+
+      if (script) {
+        script.parentNode.removeChild(script);
+      }
+    }
   }]);
   return PageLoader;
 }();

@ijjk
Copy link
Member Author

ijjk commented Jul 31, 2019

See #8192

@ijjk ijjk closed this Jul 31, 2019
@ijjk ijjk deleted the debug-circle branch July 31, 2019 19:52
@vercel vercel locked as resolved and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant