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

Pre-compile more dependencies #32627

Merged
merged 13 commits into from
Dec 20, 2021
Merged

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Dec 18, 2021

This aims to reduce the number of dependencies needed for next on install by pre-compiling more dependencies and removing left over dependencies that are no longer being used like node-lib-browser.

This is an initial PR, follow-up PRs will be made to reduce dependencies further.

Relies on vercel/ncc#832

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. type: next labels Dec 18, 2021
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk ijjk added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Dec 18, 2021
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk ijjk marked this pull request as ready for review December 18, 2021 21:55
"browserslist": "4.18.1",
"buffer": "5.6.0",
"caniuse-lite": "^1.0.30001283",
"chalk": "2.4.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a future PR, we should bump chalk since it got much smaller https://packagephobia.com/result?p=chalk

Copy link
Member

@balazsorban44 balazsorban44 Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without knowing what we use chalk for, what about picocolors which claims to be 2 times faster and is ~7kb compared to ~41.

https://github.com/alexeyraspopov/picocolors#replacing-chalk

Seems to be easy to migrate.

Tell me if it's worth looking into and I can open a PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chalk is used by a bunch of our other dependencies so using the same package de-dupes what is already needed. If picocolors has the same API guarantee and we can swap it for sub-dependencies we could look at that

@@ -14148,7 +14128,7 @@ node-int64@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"

node-libs-browser@2.2.1, node-libs-browser@^2.2.1:
node-libs-browser@^2.2.1:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like something else depends on node-libs-browser?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still install webpack 4 in the monorepo for it's types which has this as a dependency. It shouldn't be being installed with next though.

Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks!

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member Author

ijjk commented Dec 20, 2021

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary ijjk/next.js update/compiled-deps Change
buildDuration 18.5s 17.9s -591ms
buildDurationCached 3.5s 3.4s -101ms
nodeModulesSize 356 MB 350 MB -6.46 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js update/compiled-deps Change
/ failed reqs 0 0
/ total time (seconds) 2.968 2.917 -0.05
/ avg req/sec 842.4 857.18 +14.78
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.357 1.409 ⚠️ +0.05
/error-in-render avg req/sec 1841.63 1774.01 ⚠️ -67.62
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/compiled-deps Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.2 kB 42.2 kB
main-HASH.js gzip 30.2 kB 30.3 kB ⚠️ +80 B
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 74 kB 74.1 kB ⚠️ +80 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js update/compiled-deps Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js update/compiled-deps Change
_app-HASH.js gzip 1.37 kB 1.37 kB
_error-HASH.js gzip 194 B 194 B
amp-HASH.js gzip 312 B 312 B
css-HASH.js gzip 326 B 326 B
dynamic-HASH.js gzip 2.37 kB 2.37 kB
head-HASH.js gzip 350 B 350 B
hooks-HASH.js gzip 919 B 919 B
image-HASH.js gzip 4.73 kB 4.73 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 2.13 kB 2.13 kB
routerDirect..HASH.js gzip 321 B 321 B
script-HASH.js gzip 383 B 383 B
withRouter-HASH.js gzip 318 B 318 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 14.1 kB 14.1 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js update/compiled-deps Change
_buildManifest.js gzip 460 B 460 B
Overall change 460 B 460 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary ijjk/next.js update/compiled-deps Change
index.html gzip 533 B 531 B -2 B
link.html gzip 547 B 544 B -3 B
withRouter.html gzip 527 B 525 B -2 B
Overall change 1.61 kB 1.6 kB -7 B

Diffs

Diff for main-HASH.js
@@ -7964,6 +7964,193 @@
       /***/
     },
 
+    /***/ 7663: /***/ function(module) {
+      var __dirname = "/";
+      (function() {
+        var e = {
+          162: function(e) {
+            var t = (e.exports = {});
+            var r;
+            var n;
+            function defaultSetTimout() {
+              throw new Error("setTimeout has not been defined");
+            }
+            function defaultClearTimeout() {
+              throw new Error("clearTimeout has not been defined");
+            }
+            (function() {
+              try {
+                if (typeof setTimeout === "function") {
+                  r = setTimeout;
+                } else {
+                  r = defaultSetTimout;
+                }
+              } catch (e) {
+                r = defaultSetTimout;
+              }
+              try {
+                if (typeof clearTimeout === "function") {
+                  n = clearTimeout;
+                } else {
+                  n = defaultClearTimeout;
+                }
+              } catch (e) {
+                n = defaultClearTimeout;
+              }
+            })();
+            function runTimeout(e) {
+              if (r === setTimeout) {
+                return setTimeout(e, 0);
+              }
+              if ((r === defaultSetTimout || !r) && setTimeout) {
+                r = setTimeout;
+                return setTimeout(e, 0);
+              }
+              try {
+                return r(e, 0);
+              } catch (t) {
+                try {
+                  return r.call(null, e, 0);
+                } catch (t) {
+                  return r.call(this, e, 0);
+                }
+              }
+            }
+            function runClearTimeout(e) {
+              if (n === clearTimeout) {
+                return clearTimeout(e);
+              }
+              if ((n === defaultClearTimeout || !n) && clearTimeout) {
+                n = clearTimeout;
+                return clearTimeout(e);
+              }
+              try {
+                return n(e);
+              } catch (t) {
+                try {
+                  return n.call(null, e);
+                } catch (t) {
+                  return n.call(this, e);
+                }
+              }
+            }
+            var i = [];
+            var o = false;
+            var u;
+            var a = -1;
+            function cleanUpNextTick() {
+              if (!o || !u) {
+                return;
+              }
+              o = false;
+              if (u.length) {
+                i = u.concat(i);
+              } else {
+                a = -1;
+              }
+              if (i.length) {
+                drainQueue();
+              }
+            }
+            function drainQueue() {
+              if (o) {
+                return;
+              }
+              var e = runTimeout(cleanUpNextTick);
+              o = true;
+              var t = i.length;
+              while (t) {
+                u = i;
+                i = [];
+                while (++a < t) {
+                  if (u) {
+                    u[a].run();
+                  }
+                }
+                a = -1;
+                t = i.length;
+              }
+              u = null;
+              o = false;
+              runClearTimeout(e);
+            }
+            t.nextTick = function(e) {
+              var t = new Array(arguments.length - 1);
+              if (arguments.length > 1) {
+                for (var r = 1; r < arguments.length; r++) {
+                  t[r - 1] = arguments[r];
+                }
+              }
+              i.push(new Item(e, t));
+              if (i.length === 1 && !o) {
+                runTimeout(drainQueue);
+              }
+            };
+            function Item(e, t) {
+              this.fun = e;
+              this.array = t;
+            }
+            Item.prototype.run = function() {
+              this.fun.apply(null, this.array);
+            };
+            t.title = "browser";
+            t.browser = true;
+            t.env = {};
+            t.argv = [];
+            t.version = "";
+            t.versions = {};
+            function noop() {}
+            t.on = noop;
+            t.addListener = noop;
+            t.once = noop;
+            t.off = noop;
+            t.removeListener = noop;
+            t.removeAllListeners = noop;
+            t.emit = noop;
+            t.prependListener = noop;
+            t.prependOnceListener = noop;
+            t.listeners = function(e) {
+              return [];
+            };
+            t.binding = function(e) {
+              throw new Error("process.binding is not supported");
+            };
+            t.cwd = function() {
+              return "/";
+            };
+            t.chdir = function(e) {
+              throw new Error("process.chdir is not supported");
+            };
+            t.umask = function() {
+              return 0;
+            };
+          }
+        };
+        var t = {};
+        function __nccwpck_require__(r) {
+          var n = t[r];
+          if (n !== undefined) {
+            return n.exports;
+          }
+          var i = (t[r] = { exports: {} });
+          var o = true;
+          try {
+            e[r](i, i.exports, __nccwpck_require__);
+            o = false;
+          } finally {
+            if (o) delete t[r];
+          }
+          return i.exports;
+        }
+        if (typeof __nccwpck_require__ !== "undefined")
+          __nccwpck_require__.ab = __dirname + "/";
+        var r = __nccwpck_require__(162);
+        module.exports = r;
+      })();
+
+      /***/
+    },
+
     /***/ 8745: /***/ function(module) {
       var __dirname = "/";
       (function() {
@@ -8340,202 +8527,6 @@
       /***/
     },
 
-    /***/ 4155: /***/ function(module) {
-      // shim for using process in browser
-      var process = (module.exports = {});
-
-      // cached from whatever global is present so that test runners that stub it
-      // don't break things.  But we need to wrap it in a try catch in case it is
-      // wrapped in strict mode code which doesn't define any globals.  It's inside a
-      // function because try/catches deoptimize in certain engines.
-
-      var cachedSetTimeout;
-      var cachedClearTimeout;
-
-      function defaultSetTimout() {
-        throw new Error("setTimeout has not been defined");
-      }
-      function defaultClearTimeout() {
-        throw new Error("clearTimeout has not been defined");
-      }
-      (function() {
-        try {
-          if (typeof setTimeout === "function") {
-            cachedSetTimeout = setTimeout;
-          } else {
-            cachedSetTimeout = defaultSetTimout;
-          }
-        } catch (e) {
-          cachedSetTimeout = defaultSetTimout;
-        }
-        try {
-          if (typeof clearTimeout === "function") {
-            cachedClearTimeout = clearTimeout;
-          } else {
-            cachedClearTimeout = defaultClearTimeout;
-          }
-        } catch (e) {
-          cachedClearTimeout = defaultClearTimeout;
-        }
-      })();
-      function runTimeout(fun) {
-        if (cachedSetTimeout === setTimeout) {
-          //normal enviroments in sane situations
-          return setTimeout(fun, 0);
-        }
-        // if setTimeout wasn't available but was latter defined
-        if (
-          (cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) &&
-          setTimeout
-        ) {
-          cachedSetTimeout = setTimeout;
-          return setTimeout(fun, 0);
-        }
-        try {
-          // when when somebody has screwed with setTimeout but no I.E. maddness
-          return cachedSetTimeout(fun, 0);
-        } catch (e) {
-          try {
-            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
-            return cachedSetTimeout.call(null, fun, 0);
-          } catch (e) {
-            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
-            return cachedSetTimeout.call(this, fun, 0);
-          }
-        }
-      }
-      function runClearTimeout(marker) {
-        if (cachedClearTimeout === clearTimeout) {
-          //normal enviroments in sane situations
-          return clearTimeout(marker);
-        }
-        // if clearTimeout wasn't available but was latter defined
-        if (
-          (cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) &&
-          clearTimeout
-        ) {
-          cachedClearTimeout = clearTimeout;
-          return clearTimeout(marker);
-        }
-        try {
-          // when when somebody has screwed with setTimeout but no I.E. maddness
-          return cachedClearTimeout(marker);
-        } catch (e) {
-          try {
-            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
-            return cachedClearTimeout.call(null, marker);
-          } catch (e) {
-            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
-            // Some versions of I.E. have different rules for clearTimeout vs setTimeout
-            return cachedClearTimeout.call(this, marker);
-          }
-        }
-      }
-      var queue = [];
-      var draining = false;
-      var currentQueue;
-      var queueIndex = -1;
-
-      function cleanUpNextTick() {
-        if (!draining || !currentQueue) {
-          return;
-        }
-        draining = false;
-        if (currentQueue.length) {
-          queue = currentQueue.concat(queue);
-        } else {
-          queueIndex = -1;
-        }
-        if (queue.length) {
-          drainQueue();
-        }
-      }
-
-      function drainQueue() {
-        if (draining) {
-          return;
-        }
-        var timeout = runTimeout(cleanUpNextTick);
-        draining = true;
-
-        var len = queue.length;
-        while (len) {
-          currentQueue = queue;
-          queue = [];
-          while (++queueIndex < len) {
-            if (currentQueue) {
-              currentQueue[queueIndex].run();
-            }
-          }
-          queueIndex = -1;
-          len = queue.length;
-        }
-        currentQueue = null;
-        draining = false;
-        runClearTimeout(timeout);
-      }
-
-      process.nextTick = function(fun) {
-        var args = new Array(arguments.length - 1);
-        if (arguments.length > 1) {
-          for (var i = 1; i < arguments.length; i++) {
-            args[i - 1] = arguments[i];
-          }
-        }
-        queue.push(new Item(fun, args));
-        if (queue.length === 1 && !draining) {
-          runTimeout(drainQueue);
-        }
-      };
-
-      // v8 likes predictible objects
-      function Item(fun, array) {
-        this.fun = fun;
-        this.array = array;
-      }
-      Item.prototype.run = function() {
-        this.fun.apply(null, this.array);
-      };
-      process.title = "browser";
-      process.browser = true;
-      process.env = {};
-      process.argv = [];
-      process.version = ""; // empty string to avoid regexp issues
-      process.versions = {};
-
-      function noop() {}
-
-      process.on = noop;
-      process.addListener = noop;
-      process.once = noop;
-      process.off = noop;
-      process.removeListener = noop;
-      process.removeAllListeners = noop;
-      process.emit = noop;
-      process.prependListener = noop;
-      process.prependOnceListener = noop;
-
-      process.listeners = function(name) {
-        return [];
-      };
-
-      process.binding = function(name) {
-        throw new Error("process.binding is not supported");
-      };
-
-      process.cwd = function() {
-        return "/";
-      };
-      process.chdir = function(dir) {
-        throw new Error("process.chdir is not supported");
-      };
-      process.umask = function() {
-        return 0;
-      };
-
-      /***/
-    },
-
     /***/ 5666: /***/ function(module) {
       /**
        * Copyright (c) 2014-present, Facebook, Inc.
@@ -9409,7 +9400,7 @@
       __webpack_require__
     ) {
       "use strict";
-      /* provided dependency */ var process = __webpack_require__(4155);
+      /* provided dependency */ var process = __webpack_require__(7663);
 
       exports.__esModule = true;
       exports["default"] = void 0;
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-860d1e6ea49e6b7a.js"
+      src="/_next/static/chunks/main-663fd8163ce9a21b.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-860d1e6ea49e6b7a.js"
+      src="/_next/static/chunks/main-663fd8163ce9a21b.js"
       defer=""
     ></script>
     <script
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-860d1e6ea49e6b7a.js"
+      src="/_next/static/chunks/main-663fd8163ce9a21b.js"
       defer=""
     ></script>
     <script

Default Build with SWC (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary ijjk/next.js update/compiled-deps Change
buildDuration 20s 19.1s -915ms
buildDurationCached 3.5s 3.4s -83ms
nodeModulesSize 356 MB 350 MB -6.46 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js update/compiled-deps Change
/ failed reqs 0 0
/ total time (seconds) 2.938 2.971 ⚠️ +0.03
/ avg req/sec 850.98 841.59 ⚠️ -9.39
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.371 1.402 ⚠️ +0.03
/error-in-render avg req/sec 1823.56 1783 ⚠️ -40.56
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js update/compiled-deps Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.3 kB 42.3 kB
main-HASH.js gzip 30.3 kB 30.4 kB ⚠️ +78 B
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 74.3 kB 74.3 kB ⚠️ +78 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js update/compiled-deps Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js update/compiled-deps Change
_app-HASH.js gzip 1.35 kB 1.35 kB
_error-HASH.js gzip 180 B 180 B
amp-HASH.js gzip 305 B 305 B
css-HASH.js gzip 321 B 321 B
dynamic-HASH.js gzip 2.36 kB 2.36 kB
head-HASH.js gzip 342 B 342 B
hooks-HASH.js gzip 906 B 906 B
image-HASH.js gzip 4.75 kB 4.75 kB
index-HASH.js gzip 256 B 256 B
link-HASH.js gzip 2.19 kB 2.19 kB
routerDirect..HASH.js gzip 314 B 314 B
script-HASH.js gzip 375 B 375 B
withRouter-HASH.js gzip 309 B 309 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 14.1 kB 14.1 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js update/compiled-deps Change
_buildManifest.js gzip 459 B 459 B
Overall change 459 B 459 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js update/compiled-deps Change
index.html gzip 532 B 533 B ⚠️ +1 B
link.html gzip 546 B 545 B -1 B
withRouter.html gzip 526 B 526 B
Overall change 1.6 kB 1.6 kB

Diffs

Diff for main-HASH.js
@@ -7964,6 +7964,193 @@
       /***/
     },
 
+    /***/ 7663: /***/ function(module) {
+      var __dirname = "/";
+      (function() {
+        var e = {
+          162: function(e) {
+            var t = (e.exports = {});
+            var r;
+            var n;
+            function defaultSetTimout() {
+              throw new Error("setTimeout has not been defined");
+            }
+            function defaultClearTimeout() {
+              throw new Error("clearTimeout has not been defined");
+            }
+            (function() {
+              try {
+                if (typeof setTimeout === "function") {
+                  r = setTimeout;
+                } else {
+                  r = defaultSetTimout;
+                }
+              } catch (e) {
+                r = defaultSetTimout;
+              }
+              try {
+                if (typeof clearTimeout === "function") {
+                  n = clearTimeout;
+                } else {
+                  n = defaultClearTimeout;
+                }
+              } catch (e) {
+                n = defaultClearTimeout;
+              }
+            })();
+            function runTimeout(e) {
+              if (r === setTimeout) {
+                return setTimeout(e, 0);
+              }
+              if ((r === defaultSetTimout || !r) && setTimeout) {
+                r = setTimeout;
+                return setTimeout(e, 0);
+              }
+              try {
+                return r(e, 0);
+              } catch (t) {
+                try {
+                  return r.call(null, e, 0);
+                } catch (t) {
+                  return r.call(this, e, 0);
+                }
+              }
+            }
+            function runClearTimeout(e) {
+              if (n === clearTimeout) {
+                return clearTimeout(e);
+              }
+              if ((n === defaultClearTimeout || !n) && clearTimeout) {
+                n = clearTimeout;
+                return clearTimeout(e);
+              }
+              try {
+                return n(e);
+              } catch (t) {
+                try {
+                  return n.call(null, e);
+                } catch (t) {
+                  return n.call(this, e);
+                }
+              }
+            }
+            var i = [];
+            var o = false;
+            var u;
+            var a = -1;
+            function cleanUpNextTick() {
+              if (!o || !u) {
+                return;
+              }
+              o = false;
+              if (u.length) {
+                i = u.concat(i);
+              } else {
+                a = -1;
+              }
+              if (i.length) {
+                drainQueue();
+              }
+            }
+            function drainQueue() {
+              if (o) {
+                return;
+              }
+              var e = runTimeout(cleanUpNextTick);
+              o = true;
+              var t = i.length;
+              while (t) {
+                u = i;
+                i = [];
+                while (++a < t) {
+                  if (u) {
+                    u[a].run();
+                  }
+                }
+                a = -1;
+                t = i.length;
+              }
+              u = null;
+              o = false;
+              runClearTimeout(e);
+            }
+            t.nextTick = function(e) {
+              var t = new Array(arguments.length - 1);
+              if (arguments.length > 1) {
+                for (var r = 1; r < arguments.length; r++) {
+                  t[r - 1] = arguments[r];
+                }
+              }
+              i.push(new Item(e, t));
+              if (i.length === 1 && !o) {
+                runTimeout(drainQueue);
+              }
+            };
+            function Item(e, t) {
+              this.fun = e;
+              this.array = t;
+            }
+            Item.prototype.run = function() {
+              this.fun.apply(null, this.array);
+            };
+            t.title = "browser";
+            t.browser = true;
+            t.env = {};
+            t.argv = [];
+            t.version = "";
+            t.versions = {};
+            function noop() {}
+            t.on = noop;
+            t.addListener = noop;
+            t.once = noop;
+            t.off = noop;
+            t.removeListener = noop;
+            t.removeAllListeners = noop;
+            t.emit = noop;
+            t.prependListener = noop;
+            t.prependOnceListener = noop;
+            t.listeners = function(e) {
+              return [];
+            };
+            t.binding = function(e) {
+              throw new Error("process.binding is not supported");
+            };
+            t.cwd = function() {
+              return "/";
+            };
+            t.chdir = function(e) {
+              throw new Error("process.chdir is not supported");
+            };
+            t.umask = function() {
+              return 0;
+            };
+          }
+        };
+        var t = {};
+        function __nccwpck_require__(r) {
+          var n = t[r];
+          if (n !== undefined) {
+            return n.exports;
+          }
+          var i = (t[r] = { exports: {} });
+          var o = true;
+          try {
+            e[r](i, i.exports, __nccwpck_require__);
+            o = false;
+          } finally {
+            if (o) delete t[r];
+          }
+          return i.exports;
+        }
+        if (typeof __nccwpck_require__ !== "undefined")
+          __nccwpck_require__.ab = __dirname + "/";
+        var r = __nccwpck_require__(162);
+        module.exports = r;
+      })();
+
+      /***/
+    },
+
     /***/ 8745: /***/ function(module) {
       var __dirname = "/";
       (function() {
@@ -8340,202 +8527,6 @@
       /***/
     },
 
-    /***/ 4155: /***/ function(module) {
-      // shim for using process in browser
-      var process = (module.exports = {});
-
-      // cached from whatever global is present so that test runners that stub it
-      // don't break things.  But we need to wrap it in a try catch in case it is
-      // wrapped in strict mode code which doesn't define any globals.  It's inside a
-      // function because try/catches deoptimize in certain engines.
-
-      var cachedSetTimeout;
-      var cachedClearTimeout;
-
-      function defaultSetTimout() {
-        throw new Error("setTimeout has not been defined");
-      }
-      function defaultClearTimeout() {
-        throw new Error("clearTimeout has not been defined");
-      }
-      (function() {
-        try {
-          if (typeof setTimeout === "function") {
-            cachedSetTimeout = setTimeout;
-          } else {
-            cachedSetTimeout = defaultSetTimout;
-          }
-        } catch (e) {
-          cachedSetTimeout = defaultSetTimout;
-        }
-        try {
-          if (typeof clearTimeout === "function") {
-            cachedClearTimeout = clearTimeout;
-          } else {
-            cachedClearTimeout = defaultClearTimeout;
-          }
-        } catch (e) {
-          cachedClearTimeout = defaultClearTimeout;
-        }
-      })();
-      function runTimeout(fun) {
-        if (cachedSetTimeout === setTimeout) {
-          //normal enviroments in sane situations
-          return setTimeout(fun, 0);
-        }
-        // if setTimeout wasn't available but was latter defined
-        if (
-          (cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) &&
-          setTimeout
-        ) {
-          cachedSetTimeout = setTimeout;
-          return setTimeout(fun, 0);
-        }
-        try {
-          // when when somebody has screwed with setTimeout but no I.E. maddness
-          return cachedSetTimeout(fun, 0);
-        } catch (e) {
-          try {
-            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
-            return cachedSetTimeout.call(null, fun, 0);
-          } catch (e) {
-            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
-            return cachedSetTimeout.call(this, fun, 0);
-          }
-        }
-      }
-      function runClearTimeout(marker) {
-        if (cachedClearTimeout === clearTimeout) {
-          //normal enviroments in sane situations
-          return clearTimeout(marker);
-        }
-        // if clearTimeout wasn't available but was latter defined
-        if (
-          (cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) &&
-          clearTimeout
-        ) {
-          cachedClearTimeout = clearTimeout;
-          return clearTimeout(marker);
-        }
-        try {
-          // when when somebody has screwed with setTimeout but no I.E. maddness
-          return cachedClearTimeout(marker);
-        } catch (e) {
-          try {
-            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
-            return cachedClearTimeout.call(null, marker);
-          } catch (e) {
-            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
-            // Some versions of I.E. have different rules for clearTimeout vs setTimeout
-            return cachedClearTimeout.call(this, marker);
-          }
-        }
-      }
-      var queue = [];
-      var draining = false;
-      var currentQueue;
-      var queueIndex = -1;
-
-      function cleanUpNextTick() {
-        if (!draining || !currentQueue) {
-          return;
-        }
-        draining = false;
-        if (currentQueue.length) {
-          queue = currentQueue.concat(queue);
-        } else {
-          queueIndex = -1;
-        }
-        if (queue.length) {
-          drainQueue();
-        }
-      }
-
-      function drainQueue() {
-        if (draining) {
-          return;
-        }
-        var timeout = runTimeout(cleanUpNextTick);
-        draining = true;
-
-        var len = queue.length;
-        while (len) {
-          currentQueue = queue;
-          queue = [];
-          while (++queueIndex < len) {
-            if (currentQueue) {
-              currentQueue[queueIndex].run();
-            }
-          }
-          queueIndex = -1;
-          len = queue.length;
-        }
-        currentQueue = null;
-        draining = false;
-        runClearTimeout(timeout);
-      }
-
-      process.nextTick = function(fun) {
-        var args = new Array(arguments.length - 1);
-        if (arguments.length > 1) {
-          for (var i = 1; i < arguments.length; i++) {
-            args[i - 1] = arguments[i];
-          }
-        }
-        queue.push(new Item(fun, args));
-        if (queue.length === 1 && !draining) {
-          runTimeout(drainQueue);
-        }
-      };
-
-      // v8 likes predictible objects
-      function Item(fun, array) {
-        this.fun = fun;
-        this.array = array;
-      }
-      Item.prototype.run = function() {
-        this.fun.apply(null, this.array);
-      };
-      process.title = "browser";
-      process.browser = true;
-      process.env = {};
-      process.argv = [];
-      process.version = ""; // empty string to avoid regexp issues
-      process.versions = {};
-
-      function noop() {}
-
-      process.on = noop;
-      process.addListener = noop;
-      process.once = noop;
-      process.off = noop;
-      process.removeListener = noop;
-      process.removeAllListeners = noop;
-      process.emit = noop;
-      process.prependListener = noop;
-      process.prependOnceListener = noop;
-
-      process.listeners = function(name) {
-        return [];
-      };
-
-      process.binding = function(name) {
-        throw new Error("process.binding is not supported");
-      };
-
-      process.cwd = function() {
-        return "/";
-      };
-      process.chdir = function(dir) {
-        throw new Error("process.chdir is not supported");
-      };
-      process.umask = function() {
-        return 0;
-      };
-
-      /***/
-    },
-
     /***/ 5666: /***/ function(module) {
       /**
        * Copyright (c) 2014-present, Facebook, Inc.
@@ -9409,7 +9400,7 @@
       __webpack_require__
     ) {
       "use strict";
-      /* provided dependency */ var process = __webpack_require__(4155);
+      /* provided dependency */ var process = __webpack_require__(7663);
 
       exports.__esModule = true;
       exports["default"] = void 0;
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-860d1e6ea49e6b7a.js"
+      src="/_next/static/chunks/main-663fd8163ce9a21b.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-860d1e6ea49e6b7a.js"
+      src="/_next/static/chunks/main-663fd8163ce9a21b.js"
       defer=""
     ></script>
     <script
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-860d1e6ea49e6b7a.js"
+      src="/_next/static/chunks/main-663fd8163ce9a21b.js"
       defer=""
     ></script>
     <script
Commit: b251c91

@timneutkens timneutkens merged commit e8408c7 into vercel:canary Dec 20, 2021
@timneutkens timneutkens deleted the update/compiled-deps branch December 20, 2021 13:01
kodiakhq bot pushed a commit that referenced this pull request Jan 17, 2022
This ncc's some remaining dependencies bringing us under 20 install time dependencies (including nested dependencies), this also reduces install size by another `2.75 MB`. A follow-up PR will investigate a custom install script for our swc packages to allow us to remove the `optionalDependencies` which is slowing down install time as well. 

x-ref: #32679
x-ref: #32627
x-ref: #31887
x-ref: vercel/styled-jsx#770
@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application. created-by: Next.js team PRs by the Next.js team. type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants