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

dep: upgrade @swc/core v1.2.148 , @swc/cli v0.1.55 #35054

Merged
merged 3 commits into from Mar 5, 2022

Conversation

bnoguchi
Copy link
Contributor

@bnoguchi bnoguchi commented Mar 4, 2022

Feature

Upgrades @swc/core to 1.2.148, which includes this critical fix swc-project/swc#3824

Also upgrades @swc/cli to v0.1.55

@ijjk
Copy link
Member

ijjk commented Mar 5, 2022

Stats from current PR

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
buildDuration 15.9s 15.8s -42ms
buildDurationCached 6.2s 6.1s -105ms
nodeModulesSize 372 MB 375 MB ⚠️ +2.14 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
/ failed reqs 0 0
/ total time (seconds) 3.135 3.159 ⚠️ +0.02
/ avg req/sec 797.47 791.28 ⚠️ -6.19
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.371 1.383 ⚠️ +0.01
/error-in-render avg req/sec 1823.98 1807.66 ⚠️ -16.32
Client Bundles (main, webpack) Overall decrease ✓
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
925.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 27.9 kB 27.9 kB -3 B
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 71.5 kB 71.5 kB -3 B
Legacy Client Bundles (polyfills)
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
_app-HASH.js gzip 1.36 kB 1.36 kB
_error-HASH.js gzip 192 B 192 B
amp-HASH.js gzip 309 B 309 B
css-HASH.js gzip 327 B 327 B
dynamic-HASH.js gzip 2.57 kB 2.57 kB
head-HASH.js gzip 351 B 351 B
hooks-HASH.js gzip 920 B 920 B
image-HASH.js gzip 5.06 kB 5.06 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 2.26 kB 2.26 kB
routerDirect..HASH.js gzip 320 B 320 B
script-HASH.js gzip 387 B 387 B
withRouter-HASH.js gzip 319 B 319 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 14.8 kB 14.8 kB
Client Build Manifests
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
_buildManifest.js gzip 460 B 460 B
Overall change 460 B 460 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
index.html gzip 532 B 531 B -1 B
link.html gzip 545 B 545 B
withRouter.html gzip 525 B 525 B
Overall change 1.6 kB 1.6 kB -1 B

Diffs

Diff for _buildManifest.js
@@ -8,11 +8,11 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Fcss-9b653f909589c123.js"
   ],
   "/dynamic": [
-    "static\u002Fchunks\u002Fpages\u002Fdynamic-3806562e6d80e46f.js"
+    "static\u002Fchunks\u002Fpages\u002Fdynamic-5fa0a9b9d9b0e52b.js"
   ],
   "/head": ["static\u002Fchunks\u002Fpages\u002Fhead-35c32b80abf212d2.js"],
   "/hooks": ["static\u002Fchunks\u002Fpages\u002Fhooks-8642d114a09c62c5.js"],
-  "/image": ["static\u002Fchunks\u002Fpages\u002Fimage-e3445a41cd45d90f.js"],
+  "/image": ["static\u002Fchunks\u002Fpages\u002Fimage-3b0e98cd8174c02a.js"],
   "/link": ["static\u002Fchunks\u002Fpages\u002Flink-0b3d72804dab6202.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-00527c3f2207a902.js"
Diff for _app-HASH.js
@@ -215,6 +215,9 @@
               default: obj
             };
       }
+      function appGetInitialProps(_) {
+        return _appGetInitialProps.apply(this, arguments);
+      }
       function _appGetInitialProps() {
         _appGetInitialProps = /**
          * `App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization.
@@ -243,9 +246,6 @@
         );
         return _appGetInitialProps.apply(this, arguments);
       }
-      function appGetInitialProps(_) {
-        return _appGetInitialProps.apply(this, arguments);
-      }
       var App = /*#__PURE__*/ (function(_Component) {
         _inherits(App, _Component);
         var _super = _createSuper(App);
@@ -269,9 +269,9 @@
         ]);
         return App;
       })(_react.default.Component);
+      exports["default"] = App;
       App.origGetInitialProps = appGetInitialProps;
-      App.getInitialProps = appGetInitialProps;
-      exports["default"] = App; //# sourceMappingURL=_app.js.map
+      App.getInitialProps = appGetInitialProps; //# sourceMappingURL=_app.js.map
 
       /***/
     }
Diff for dynamic-HASH.js
@@ -70,37 +70,10 @@
       __webpack_unused_export__ = {
         value: true
       };
-      __webpack_unused_export__ = noSSR;
       exports["default"] = dynamic;
+      __webpack_unused_export__ = noSSR;
       var _react = _interopRequireDefault(__webpack_require__(7294));
       var _loadable = _interopRequireDefault(__webpack_require__(4588));
-      function _interopRequireDefault(obj) {
-        return obj && obj.__esModule
-          ? obj
-          : {
-              default: obj
-            };
-      }
-      var isServerSide = "object" === "undefined";
-      function noSSR(LoadableInitializer, loadableOptions) {
-        // Removing webpack and modules means react-loadable won't try preloading
-        delete loadableOptions.webpack;
-        delete loadableOptions.modules;
-        // This check is necessary to prevent react-loadable from initializing on the server
-        if (!isServerSide) {
-          return LoadableInitializer(loadableOptions);
-        }
-        var Loading = loadableOptions.loading;
-        // This will only be rendered on the server side
-        return function() {
-          /*#__PURE__*/ return _react.default.createElement(Loading, {
-            error: null,
-            isLoading: true,
-            pastDelay: false,
-            timedOut: false
-          });
-        };
-      }
       function dynamic(dynamicOptions, options) {
         var loadableFn = _loadable.default;
         var loadableOptions = {
@@ -163,6 +136,33 @@
           delete loadableOptions.ssr;
         }
         return loadableFn(loadableOptions);
+      }
+      function _interopRequireDefault(obj) {
+        return obj && obj.__esModule
+          ? obj
+          : {
+              default: obj
+            };
+      }
+      var isServerSide = "object" === "undefined";
+      function noSSR(LoadableInitializer, loadableOptions) {
+        // Removing webpack and modules means react-loadable won't try preloading
+        delete loadableOptions.webpack;
+        delete loadableOptions.modules;
+        // This check is necessary to prevent react-loadable from initializing on the server
+        if (!isServerSide) {
+          return LoadableInitializer(loadableOptions);
+        }
+        var Loading = loadableOptions.loading;
+        // This will only be rendered on the server side
+        return function() {
+          /*#__PURE__*/ return _react.default.createElement(Loading, {
+            error: null,
+            isLoading: true,
+            pastDelay: false,
+            timedOut: false
+          });
+        };
       } //# sourceMappingURL=dynamic.js.map
 
       /***/
Diff for image-HASH.js
@@ -133,336 +133,6 @@
       var _useIntersection = __webpack_require__(9246);
       var _imageConfigContext = __webpack_require__(8730);
       var _utils = __webpack_require__(670);
-      function _defineProperty1(obj, key, value) {
-        if (key in obj) {
-          Object.defineProperty(obj, key, {
-            value: value,
-            enumerable: true,
-            configurable: true,
-            writable: true
-          });
-        } else {
-          obj[key] = value;
-        }
-        return obj;
-      }
-      function _interopRequireDefault(obj) {
-        return obj && obj.__esModule
-          ? obj
-          : {
-              default: obj
-            };
-      }
-      function _interopRequireWildcard(obj) {
-        if (obj && obj.__esModule) {
-          return obj;
-        } else {
-          var newObj = {};
-          if (obj != null) {
-            for (var key in obj) {
-              if (Object.prototype.hasOwnProperty.call(obj, key)) {
-                var desc =
-                  Object.defineProperty && Object.getOwnPropertyDescriptor
-                    ? Object.getOwnPropertyDescriptor(obj, key)
-                    : {};
-                if (desc.get || desc.set) {
-                  Object.defineProperty(newObj, key, desc);
-                } else {
-                  newObj[key] = obj[key];
-                }
-              }
-            }
-          }
-          newObj.default = obj;
-          return newObj;
-        }
-      }
-      function _objectSpread(target) {
-        var _arguments = arguments,
-          _loop = function(i) {
-            var source = _arguments[i] != null ? _arguments[i] : {};
-            var ownKeys = Object.keys(source);
-            if (typeof Object.getOwnPropertySymbols === "function") {
-              ownKeys = ownKeys.concat(
-                Object.getOwnPropertySymbols(source).filter(function(sym) {
-                  return Object.getOwnPropertyDescriptor(
-                    source,
-                    sym
-                  ).enumerable;
-                })
-              );
-            }
-            ownKeys.forEach(function(key) {
-              _defineProperty1(target, key, source[key]);
-            });
-          };
-        for (var i = 1; i < arguments.length; i++) _loop(i);
-        return target;
-      }
-      function _objectWithoutProperties(source, excluded) {
-        if (source == null) return {};
-        var target = _objectWithoutPropertiesLoose(source, excluded);
-        var key, i;
-        if (Object.getOwnPropertySymbols) {
-          var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
-          for (i = 0; i < sourceSymbolKeys.length; i++) {
-            key = sourceSymbolKeys[i];
-            if (excluded.indexOf(key) >= 0) continue;
-            if (!Object.prototype.propertyIsEnumerable.call(source, key))
-              continue;
-            target[key] = source[key];
-          }
-        }
-        return target;
-      }
-      function _objectWithoutPropertiesLoose(source, excluded) {
-        if (source == null) return {};
-        var target = {};
-        var sourceKeys = Object.keys(source);
-        var key, i;
-        for (i = 0; i < sourceKeys.length; i++) {
-          key = sourceKeys[i];
-          if (excluded.indexOf(key) >= 0) continue;
-          target[key] = source[key];
-        }
-        return target;
-      }
-      var configEnv = {
-        deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
-        imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
-        path: "/_next/image",
-        loader: "default"
-      };
-      var loadedImageURLs = new Set();
-      var allImgs = new Map();
-      var perfObserver;
-      var emptyDataURL =
-        "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
-      if (false) {
-      }
-      var VALID_LOADING_VALUES = /* unused pure expression or super */ null && [
-        "lazy",
-        "eager",
-        undefined
-      ];
-      var loaders = new Map([
-        ["default", defaultLoader],
-        ["imgix", imgixLoader],
-        ["cloudinary", cloudinaryLoader],
-        ["akamai", akamaiLoader],
-        ["custom", customLoader]
-      ]);
-      var VALID_LAYOUT_VALUES = /* unused pure expression or super */ null && [
-        "fill",
-        "fixed",
-        "intrinsic",
-        "responsive",
-        undefined
-      ];
-      function isStaticRequire(src) {
-        return src.default !== undefined;
-      }
-      function isStaticImageData(src) {
-        return src.src !== undefined;
-      }
-      function isStaticImport(src) {
-        return (
-          typeof src === "object" &&
-          (isStaticRequire(src) || isStaticImageData(src))
-        );
-      }
-      function getWidths(param, width, layout, sizes) {
-        var deviceSizes = param.deviceSizes,
-          allSizes = param.allSizes;
-        if (sizes && (layout === "fill" || layout === "responsive")) {
-          // Find all the "vw" percent sizes used in the sizes prop
-          var viewportWidthRe = /(^|\s)(1?\d?\d)vw/g;
-          var percentSizes = [];
-          for (var match; (match = viewportWidthRe.exec(sizes)); match) {
-            percentSizes.push(parseInt(match[2]));
-          }
-          if (percentSizes.length) {
-            var _Math;
-            var smallestRatio =
-              (_Math = Math).min.apply(
-                _Math,
-                _toConsumableArray(percentSizes)
-              ) * 0.01;
-            return {
-              widths: allSizes.filter(function(s) {
-                return s >= deviceSizes[0] * smallestRatio;
-              }),
-              kind: "w"
-            };
-          }
-          return {
-            widths: allSizes,
-            kind: "w"
-          };
-        }
-        if (
-          typeof width !== "number" ||
-          layout === "fill" ||
-          layout === "responsive"
-        ) {
-          return {
-            widths: deviceSizes,
-            kind: "w"
-          };
-        }
-        var widths = _toConsumableArray(
-          new Set( // > are actually 3x in the green color, but only 1.5x in the red and
-            // > blue colors. Showing a 3x resolution image in the app vs a 2x
-            // > resolution image will be visually the same, though the 3x image
-            // > takes significantly more data. Even true 3x resolution screens are
-            // > wasteful as the human eye cannot see that level of detail without
-            // > something like a magnifying glass.
-            // https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html
-            [width, width * 2 /*, width * 3*/].map(function(w) {
-              return (
-                allSizes.find(function(p) {
-                  return p >= w;
-                }) || allSizes[allSizes.length - 1]
-              );
-            })
-          )
-        );
-        return {
-          widths: widths,
-          kind: "x"
-        };
-      }
-      function generateImgAttrs(param) {
-        var config = param.config,
-          src = param.src,
-          unoptimized = param.unoptimized,
-          layout = param.layout,
-          width = param.width,
-          quality = param.quality,
-          sizes = param.sizes,
-          loader = param.loader;
-        if (unoptimized) {
-          return {
-            src: src,
-            srcSet: undefined,
-            sizes: undefined
-          };
-        }
-        var ref = getWidths(config, width, layout, sizes),
-          widths = ref.widths,
-          kind = ref.kind;
-        var last = widths.length - 1;
-        return {
-          sizes: !sizes && kind === "w" ? "100vw" : sizes,
-          srcSet: widths
-            .map(function(w, i) {
-              return ""
-                .concat(
-                  loader({
-                    config: config,
-                    src: src,
-                    quality: quality,
-                    width: w
-                  }),
-                  " "
-                )
-                .concat(kind === "w" ? w : i + 1)
-                .concat(kind);
-            })
-            .join(", "),
-          // It's intended to keep `src` the last attribute because React updates
-          // attributes in order. If we keep `src` the first one, Safari will
-          // immediately start to fetch `src`, before `sizes` and `srcSet` are even
-          // updated by React. That causes multiple unnecessary requests if `srcSet`
-          // and `sizes` are defined.
-          // This bug cannot be reproduced in Chrome or Firefox.
-          src: loader({
-            config: config,
-            src: src,
-            quality: quality,
-            width: widths[last]
-          })
-        };
-      }
-      function getInt(x) {
-        if (typeof x === "number") {
-          return x;
-        }
-        if (typeof x === "string") {
-          return parseInt(x, 10);
-        }
-        return undefined;
-      }
-      function defaultImageLoader(loaderProps) {
-        var ref;
-        var loaderKey =
-          ((ref = loaderProps.config) === null || ref === void 0
-            ? void 0
-            : ref.loader) || "default";
-        var load = loaders.get(loaderKey);
-        if (load) {
-          return load(loaderProps);
-        }
-        throw new Error(
-          'Unknown "loader" found in "next.config.js". Expected: '
-            .concat(_imageConfig.VALID_LOADERS.join(", "), ". Received: ")
-            .concat(loaderKey)
-        );
-      }
-      // See https://stackoverflow.com/q/39777833/266535 for why we use this ref
-      // handler instead of the img's onLoad attribute.
-      function handleLoading(
-        imgRef,
-        src,
-        layout,
-        placeholder,
-        onLoadingCompleteRef
-      ) {
-        var handleLoad = function() {
-          var img = imgRef.current;
-          if (!img) {
-            return;
-          }
-          if (img.src !== emptyDataURL) {
-            var p = "decode" in img ? img.decode() : Promise.resolve();
-            p.catch(function() {}).then(function() {
-              if (!imgRef.current) {
-                return;
-              }
-              loadedImageURLs.add(src);
-              if (placeholder === "blur") {
-                img.style.filter = "";
-                img.style.backgroundSize = "";
-                img.style.backgroundImage = "";
-                img.style.backgroundPosition = "";
-              }
-              if (onLoadingCompleteRef.current) {
-                var naturalWidth = img.naturalWidth,
-                  naturalHeight = img.naturalHeight;
-                // Pass back read-only primitive values but not the
-                // underlying DOM element because it could be misused.
-                onLoadingCompleteRef.current({
-                  naturalWidth: naturalWidth,
-                  naturalHeight: naturalHeight
-                });
-              }
-              if (false) {
-                var parent, ref;
-              }
-            });
-          }
-        };
-        if (imgRef.current) {
-          if (imgRef.current.complete) {
-            // If the real image fails to load, this will still remove the placeholder.
-            // This is the desired behavior for now, and will be revisited when error
-            // handling is worked on for the image component itself.
-            handleLoad();
-          } else {
-            imgRef.current.onload = handleLoad;
-          }
-        }
-      }
       function Image(_param) {
         var src = _param.src,
           sizes = _param.sizes,
@@ -843,6 +513,336 @@
             : null
         );
       }
+      function _defineProperty1(obj, key, value) {
+        if (key in obj) {
+          Object.defineProperty(obj, key, {
+            value: value,
+            enumerable: true,
+            configurable: true,
+            writable: true
+          });
+        } else {
+          obj[key] = value;
+        }
+        return obj;
+      }
+      function _interopRequireDefault(obj) {
+        return obj && obj.__esModule
+          ? obj
+          : {
+              default: obj
+            };
+      }
+      function _interopRequireWildcard(obj) {
+        if (obj && obj.__esModule) {
+          return obj;
+        } else {
+          var newObj = {};
+          if (obj != null) {
+            for (var key in obj) {
+              if (Object.prototype.hasOwnProperty.call(obj, key)) {
+                var desc =
+                  Object.defineProperty && Object.getOwnPropertyDescriptor
+                    ? Object.getOwnPropertyDescriptor(obj, key)
+                    : {};
+                if (desc.get || desc.set) {
+                  Object.defineProperty(newObj, key, desc);
+                } else {
+                  newObj[key] = obj[key];
+                }
+              }
+            }
+          }
+          newObj.default = obj;
+          return newObj;
+        }
+      }
+      function _objectSpread(target) {
+        var _arguments = arguments,
+          _loop = function(i) {
+            var source = _arguments[i] != null ? _arguments[i] : {};
+            var ownKeys = Object.keys(source);
+            if (typeof Object.getOwnPropertySymbols === "function") {
+              ownKeys = ownKeys.concat(
+                Object.getOwnPropertySymbols(source).filter(function(sym) {
+                  return Object.getOwnPropertyDescriptor(
+                    source,
+                    sym
+                  ).enumerable;
+                })
+              );
+            }
+            ownKeys.forEach(function(key) {
+              _defineProperty1(target, key, source[key]);
+            });
+          };
+        for (var i = 1; i < arguments.length; i++) _loop(i);
+        return target;
+      }
+      function _objectWithoutProperties(source, excluded) {
+        if (source == null) return {};
+        var target = _objectWithoutPropertiesLoose(source, excluded);
+        var key, i;
+        if (Object.getOwnPropertySymbols) {
+          var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
+          for (i = 0; i < sourceSymbolKeys.length; i++) {
+            key = sourceSymbolKeys[i];
+            if (excluded.indexOf(key) >= 0) continue;
+            if (!Object.prototype.propertyIsEnumerable.call(source, key))
+              continue;
+            target[key] = source[key];
+          }
+        }
+        return target;
+      }
+      function _objectWithoutPropertiesLoose(source, excluded) {
+        if (source == null) return {};
+        var target = {};
+        var sourceKeys = Object.keys(source);
+        var key, i;
+        for (i = 0; i < sourceKeys.length; i++) {
+          key = sourceKeys[i];
+          if (excluded.indexOf(key) >= 0) continue;
+          target[key] = source[key];
+        }
+        return target;
+      }
+      var configEnv = {
+        deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
+        imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
+        path: "/_next/image",
+        loader: "default"
+      };
+      var loadedImageURLs = new Set();
+      var allImgs = new Map();
+      var perfObserver;
+      var emptyDataURL =
+        "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
+      if (false) {
+      }
+      var VALID_LOADING_VALUES = /* unused pure expression or super */ null && [
+        "lazy",
+        "eager",
+        undefined
+      ];
+      var loaders = new Map([
+        ["default", defaultLoader],
+        ["imgix", imgixLoader],
+        ["cloudinary", cloudinaryLoader],
+        ["akamai", akamaiLoader],
+        ["custom", customLoader]
+      ]);
+      var VALID_LAYOUT_VALUES = /* unused pure expression or super */ null && [
+        "fill",
+        "fixed",
+        "intrinsic",
+        "responsive",
+        undefined
+      ];
+      function isStaticRequire(src) {
+        return src.default !== undefined;
+      }
+      function isStaticImageData(src) {
+        return src.src !== undefined;
+      }
+      function isStaticImport(src) {
+        return (
+          typeof src === "object" &&
+          (isStaticRequire(src) || isStaticImageData(src))
+        );
+      }
+      function getWidths(param, width, layout, sizes) {
+        var deviceSizes = param.deviceSizes,
+          allSizes = param.allSizes;
+        if (sizes && (layout === "fill" || layout === "responsive")) {
+          // Find all the "vw" percent sizes used in the sizes prop
+          var viewportWidthRe = /(^|\s)(1?\d?\d)vw/g;
+          var percentSizes = [];
+          for (var match; (match = viewportWidthRe.exec(sizes)); match) {
+            percentSizes.push(parseInt(match[2]));
+          }
+          if (percentSizes.length) {
+            var _Math;
+            var smallestRatio =
+              (_Math = Math).min.apply(
+                _Math,
+                _toConsumableArray(percentSizes)
+              ) * 0.01;
+            return {
+              widths: allSizes.filter(function(s) {
+                return s >= deviceSizes[0] * smallestRatio;
+              }),
+              kind: "w"
+            };
+          }
+          return {
+            widths: allSizes,
+            kind: "w"
+          };
+        }
+        if (
+          typeof width !== "number" ||
+          layout === "fill" ||
+          layout === "responsive"
+        ) {
+          return {
+            widths: deviceSizes,
+            kind: "w"
+          };
+        }
+        var widths = _toConsumableArray(
+          new Set( // > are actually 3x in the green color, but only 1.5x in the red and
+            // > blue colors. Showing a 3x resolution image in the app vs a 2x
+            // > resolution image will be visually the same, though the 3x image
+            // > takes significantly more data. Even true 3x resolution screens are
+            // > wasteful as the human eye cannot see that level of detail without
+            // > something like a magnifying glass.
+            // https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html
+            [width, width * 2 /*, width * 3*/].map(function(w) {
+              return (
+                allSizes.find(function(p) {
+                  return p >= w;
+                }) || allSizes[allSizes.length - 1]
+              );
+            })
+          )
+        );
+        return {
+          widths: widths,
+          kind: "x"
+        };
+      }
+      function generateImgAttrs(param) {
+        var config = param.config,
+          src = param.src,
+          unoptimized = param.unoptimized,
+          layout = param.layout,
+          width = param.width,
+          quality = param.quality,
+          sizes = param.sizes,
+          loader = param.loader;
+        if (unoptimized) {
+          return {
+            src: src,
+            srcSet: undefined,
+            sizes: undefined
+          };
+        }
+        var ref = getWidths(config, width, layout, sizes),
+          widths = ref.widths,
+          kind = ref.kind;
+        var last = widths.length - 1;
+        return {
+          sizes: !sizes && kind === "w" ? "100vw" : sizes,
+          srcSet: widths
+            .map(function(w, i) {
+              return ""
+                .concat(
+                  loader({
+                    config: config,
+                    src: src,
+                    quality: quality,
+                    width: w
+                  }),
+                  " "
+                )
+                .concat(kind === "w" ? w : i + 1)
+                .concat(kind);
+            })
+            .join(", "),
+          // It's intended to keep `src` the last attribute because React updates
+          // attributes in order. If we keep `src` the first one, Safari will
+          // immediately start to fetch `src`, before `sizes` and `srcSet` are even
+          // updated by React. That causes multiple unnecessary requests if `srcSet`
+          // and `sizes` are defined.
+          // This bug cannot be reproduced in Chrome or Firefox.
+          src: loader({
+            config: config,
+            src: src,
+            quality: quality,
+            width: widths[last]
+          })
+        };
+      }
+      function getInt(x) {
+        if (typeof x === "number") {
+          return x;
+        }
+        if (typeof x === "string") {
+          return parseInt(x, 10);
+        }
+        return undefined;
+      }
+      function defaultImageLoader(loaderProps) {
+        var ref;
+        var loaderKey =
+          ((ref = loaderProps.config) === null || ref === void 0
+            ? void 0
+            : ref.loader) || "default";
+        var load = loaders.get(loaderKey);
+        if (load) {
+          return load(loaderProps);
+        }
+        throw new Error(
+          'Unknown "loader" found in "next.config.js". Expected: '
+            .concat(_imageConfig.VALID_LOADERS.join(", "), ". Received: ")
+            .concat(loaderKey)
+        );
+      }
+      // See https://stackoverflow.com/q/39777833/266535 for why we use this ref
+      // handler instead of the img's onLoad attribute.
+      function handleLoading(
+        imgRef,
+        src,
+        layout,
+        placeholder,
+        onLoadingCompleteRef
+      ) {
+        var handleLoad = function() {
+          var img = imgRef.current;
+          if (!img) {
+            return;
+          }
+          if (img.src !== emptyDataURL) {
+            var p = "decode" in img ? img.decode() : Promise.resolve();
+            p.catch(function() {}).then(function() {
+              if (!imgRef.current) {
+                return;
+              }
+              loadedImageURLs.add(src);
+              if (placeholder === "blur") {
+                img.style.filter = "";
+                img.style.backgroundSize = "";
+                img.style.backgroundImage = "";
+                img.style.backgroundPosition = "";
+              }
+              if (onLoadingCompleteRef.current) {
+                var naturalWidth = img.naturalWidth,
+                  naturalHeight = img.naturalHeight;
+                // Pass back read-only primitive values but not the
+                // underlying DOM element because it could be misused.
+                onLoadingCompleteRef.current({
+                  naturalWidth: naturalWidth,
+                  naturalHeight: naturalHeight
+                });
+              }
+              if (false) {
+                var parent, ref;
+              }
+            });
+          }
+        };
+        if (imgRef.current) {
+          if (imgRef.current.complete) {
+            // If the real image fails to load, this will still remove the placeholder.
+            // This is the desired behavior for now, and will be revisited when error
+            // handling is worked on for the image component itself.
+            handleLoad();
+          } else {
+            imgRef.current.onload = handleLoad;
+          }
+        }
+      }
       function normalizeSrc(src) {
         return src[0] === "/" ? src.slice(1) : src;
       }
Diff for main-HASH.js
@@ -74,9 +74,60 @@
       Object.defineProperty(exports, "__esModule", {
         value: true
       });
-      exports.isEqualNode = isEqualNode;
       exports["default"] = initHeadManager;
+      exports.isEqualNode = isEqualNode;
       exports.DOMAttributeNames = void 0;
+      function initHeadManager() {
+        var updatePromise = null;
+        return {
+          mountedInstances: new Set(),
+          updateHead: function(head) {
+            var promise = (updatePromise = Promise.resolve().then(function() {
+              if (promise !== updatePromise) return;
+              updatePromise = null;
+              var tags = {};
+              head.forEach(function(h) {
+                if (
+                  // it won't be inlined. In this case revert to the original behavior
+                  h.type === "link" &&
+                  h.props["data-optimized-fonts"]
+                ) {
+                  if (
+                    document.querySelector(
+                      'style[data-href="'.concat(h.props["data-href"], '"]')
+                    )
+                  ) {
+                    return;
+                  } else {
+                    h.props.href = h.props["data-href"];
+                    h.props["data-href"] = undefined;
+                  }
+                }
+                var components = tags[h.type] || [];
+                components.push(h);
+                tags[h.type] = components;
+              });
+              var titleComponent = tags.title ? tags.title[0] : null;
+              var title = "";
+              if (titleComponent) {
+                var children = titleComponent.props.children;
+                title =
+                  typeof children === "string"
+                    ? children
+                    : Array.isArray(children)
+                    ? children.join("")
+                    : "";
+              }
+              if (title !== document.title) document.title = title;
+              ["meta", "base", "link", "style", "script"].forEach(function(
+                type
+              ) {
+                updateElements(type, tags[type] || []);
+              });
+            }));
+          }
+        };
+      }
       var DOMAttributeNames = {
         acceptCharset: "accept-charset",
         className: "class",
@@ -188,57 +239,6 @@
           oldTags.length +
           newTags.length
         ).toString();
-      }
-      function initHeadManager() {
-        var updatePromise = null;
-        return {
-          mountedInstances: new Set(),
-          updateHead: function(head) {
-            var promise = (updatePromise = Promise.resolve().then(function() {
-              if (promise !== updatePromise) return;
-              updatePromise = null;
-              var tags = {};
-              head.forEach(function(h) {
-                if (
-                  // it won't be inlined. In this case revert to the original behavior
-                  h.type === "link" &&
-                  h.props["data-optimized-fonts"]
-                ) {
-                  if (
-                    document.querySelector(
-                      'style[data-href="'.concat(h.props["data-href"], '"]')
-                    )
-                  ) {
-                    return;
-                  } else {
-                    h.props.href = h.props["data-href"];
-                    h.props["data-href"] = undefined;
-                  }
-                }
-                var components = tags[h.type] || [];
-                components.push(h);
-                tags[h.type] = components;
-              });
-              var titleComponent = tags.title ? tags.title[0] : null;
-              var title = "";
-              if (titleComponent) {
-                var children = titleComponent.props.children;
-                title =
-                  typeof children === "string"
-                    ? children
-                    : Array.isArray(children)
-                    ? children.join("")
-                    : "";
-              }
-              if (title !== document.title) document.title = title;
-              ["meta", "base", "link", "style", "script"].forEach(function(
-                type
-              ) {
-                updateElements(type, tags[type] || []);
-              });
-            }));
-          }
-        };
       } //# sourceMappingURL=head-manager.js.map
 
       /***/
@@ -804,6 +804,9 @@
       var emitter = (0, _mitt).default();
       exports.emitter = emitter;
       var CachedComponent;
+      function initNext() {
+        return _initNext.apply(this, arguments);
+      }
       function _initNext() {
         _initNext = _asyncToGenerator(
           _runtimeJs.default.mark(function _callee() {
@@ -1003,8 +1006,8 @@
         );
         return _initNext.apply(this, arguments);
       }
-      function initNext() {
-        return _initNext.apply(this, arguments);
+      function render(renderingProps) {
+        return _render.apply(this, arguments);
       }
       function _render() {
         _render = _asyncToGenerator(
@@ -1061,9 +1064,6 @@
         );
         return _render.apply(this, arguments);
       }
-      function render(renderingProps) {
-        return _render.apply(this, arguments);
-      }
       // This method handles all runtime and debug errors.
       // 404 and 500 errors are special kind of errors
       // and they are still handle via the main render method.
@@ -3232,13 +3232,6 @@
       exports["default"] = withRouter;
       var _react = _interopRequireDefault(__webpack_require__(7294));
       var _router = __webpack_require__(880);
-      function _interopRequireDefault(obj) {
-        return obj && obj.__esModule
-          ? obj
-          : {
-              default: obj
-            };
-      }
       function withRouter(ComposedComponent) {
         var WithRouterWrapper = function WithRouterWrapper(props) {
           return /*#__PURE__*/ _react.default.createElement(
@@ -3258,6 +3251,13 @@
           var name;
         }
         return WithRouterWrapper;
+      }
+      function _interopRequireDefault(obj) {
+        return obj && obj.__esModule
+          ? obj
+          : {
+              default: obj
+            };
       } //# sourceMappingURL=with-router.js.map
 
       /***/
@@ -3478,10 +3478,10 @@
         ]);
         return Error;
       })(_react.default.Component);
+      exports["default"] = Error;
       Error.displayName = "ErrorPage";
       Error.getInitialProps = _getInitialProps;
       Error.origGetInitialProps = _getInitialProps;
-      exports["default"] = Error;
       var styles = {
         error: {
           color: "#000",
@@ -4693,7 +4693,7 @@
           }));
       }
       var Router = /*#__PURE__*/ (function() {
-        function Router(pathname2, query1, as1, param) {
+        function Router(pathname1, query1, as1, param) {
           var initialProps = param.initialProps,
             pageLoader = param.pageLoader,
             App = param.App,
@@ -4753,14 +4753,14 @@
               var v;
             }
             _this._idx = idx;
-            var pathname1 = (0, _parseRelativeUrl).parseRelativeUrl(url)
+            var pathname2 = (0, _parseRelativeUrl).parseRelativeUrl(url)
               .pathname;
             // Make sure we don't re-render on initial load,
             // can be caused by navigating back from an external site
             if (
               _this.isSsr &&
               as === addBasePath(_this.asPath) &&
-              pathname1 === addBasePath(_this.pathname)
+              pathname2 === addBasePath(_this.pathname)
             ) {
               return;
             }
@@ -4782,14 +4782,14 @@
           };
           // represents the current component key
           var route = (0, _normalizeTrailingSlash).removePathTrailingSlash(
-            pathname2
+            pathname1
           );
           // set up the component cache (by route keys)
           this.components = {};
           // We should not keep the cache, if there's an error
           // Otherwise, this cause issues when when going back and
           // come again to the errored page.
-          if (pathname2 !== "/_error") {
+          if (pathname1 !== "/_error") {
             this.components[route] = {
               Component: Component,
               initial: true,
@@ -4811,7 +4811,7 @@
           // if auto prerendered and dynamic route wait to update asPath
           // until after mount to prevent hydration mismatch
           var autoExportDynamic =
-            (0, _isDynamic).isDynamicRoute(pathname2) &&
+            (0, _isDynamic).isDynamicRoute(pathname1) &&
             self.__NEXT_DATA__.autoExport;
           this.basePath = basePath;
           this.sub = subscription;
@@ -4831,9 +4831,9 @@
           }
           this.state = {
             route: route,
-            pathname: pathname2,
+            pathname: pathname1,
             query: query1,
-            asPath: autoExportDynamic ? pathname2 : as1,
+            asPath: autoExportDynamic ? pathname1 : as1,
             isPreview: !!isPreview,
             locale: false ? 0 : undefined,
             isFallback: isFallback
@@ -4847,11 +4847,11 @@
               var options1 = {
                 locale: locale
               };
-              options1._shouldResolveHref = as1 !== pathname2;
+              options1._shouldResolveHref = as1 !== pathname1;
               this.changeState(
                 "replaceState",
                 (0, _formatUrl).formatWithValidation({
-                  pathname: addBasePath(pathname2),
+                  pathname: addBasePath(pathname1),
                   query: query1
                 }),
                 (0, _utils).getURL(),
@@ -4962,8 +4962,8 @@
                     shouldInterpolate,
                     interpolatedAs,
                     missingParams,
-                    ref,
                     ref12,
+                    ref22,
                     routeInfo,
                     error,
                     props,
@@ -5547,13 +5547,13 @@
                             if (
                               options._h &&
                               pathname === "/_error" &&
-                              ((ref = self.__NEXT_DATA__.props) === null ||
-                              ref === void 0
+                              ((ref12 = self.__NEXT_DATA__.props) === null ||
+                              ref12 === void 0
                                 ? void 0
-                                : (ref12 = ref.pageProps) === null ||
-                                  ref12 === void 0
+                                : (ref22 = ref12.pageProps) === null ||
+                                  ref22 === void 0
                                 ? void 0
-                                : ref12.statusCode) === 500 &&
+                                : ref22.statusCode) === 500 &&
                               (props === null || props === void 0
                                 ? void 0
                                 : props.pageProps)
@@ -6613,8 +6613,8 @@
         ]);
         return Router;
       })();
-      Router.events = (0, _mitt).default();
-      exports["default"] = Router; //# sourceMappingURL=router.js.map
+      exports["default"] = Router;
+      Router.events = (0, _mitt).default(); //# sourceMappingURL=router.js.map
 
       /***/
     },
@@ -8193,10 +8193,10 @@
         return _loadGetInitialProps.apply(this, arguments);
       }
       var warnOnce = function(_) {};
+      exports.warnOnce = warnOnce;
       if (false) {
         var warnings;
       }
-      exports.warnOnce = warnOnce;
       var SP = typeof performance !== "undefined";
       exports.SP = SP;
       var ST =
Diff for index.html
@@ -19,11 +19,11 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-d899d849ecf228ef.js"
+      src="/_next/static/chunks/main-33a5431a1debc260.js"
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-8047265dcdea6c35.js"
+      src="/_next/static/chunks/pages/_app-fddd598caf627789.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,11 +19,11 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-d899d849ecf228ef.js"
+      src="/_next/static/chunks/main-33a5431a1debc260.js"
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-8047265dcdea6c35.js"
+      src="/_next/static/chunks/pages/_app-fddd598caf627789.js"
       defer=""
     ></script>
     <script
Diff for withRouter.html
@@ -19,11 +19,11 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-d899d849ecf228ef.js"
+      src="/_next/static/chunks/main-33a5431a1debc260.js"
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-8047265dcdea6c35.js"
+      src="/_next/static/chunks/pages/_app-fddd598caf627789.js"
       defer=""
     ></script>
     <script

Default Build with SWC (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
buildDuration 19s 19.1s ⚠️ +121ms
buildDurationCached 6.1s 6.2s ⚠️ +29ms
nodeModulesSize 372 MB 375 MB ⚠️ +2.14 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
/ failed reqs 0 0
/ total time (seconds) 3.145 3.135 -0.01
/ avg req/sec 794.89 797.41 +2.52
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.355 1.411 ⚠️ +0.06
/error-in-render avg req/sec 1845.22 1771.6 ⚠️ -73.62
Client Bundles (main, webpack) Overall increase ⚠️
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
925.HASH.js gzip 178 B 178 B
framework-HASH.js gzip 42.3 kB 42.3 kB
main-HASH.js gzip 28.1 kB 28.2 kB ⚠️ +3 B
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 72.1 kB 72.1 kB ⚠️ +3 B
Legacy Client Bundles (polyfills)
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages Overall decrease ✓
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
_app-HASH.js gzip 1.36 kB 1.35 kB -2 B
_error-HASH.js gzip 179 B 179 B
amp-HASH.js gzip 313 B 313 B
css-HASH.js gzip 324 B 324 B
dynamic-HASH.js gzip 2.56 kB 2.56 kB
head-HASH.js gzip 351 B 351 B
hooks-HASH.js gzip 921 B 921 B
image-HASH.js gzip 5.2 kB 5.2 kB ⚠️ +1 B
index-HASH.js gzip 261 B 261 B
link-HASH.js gzip 2.33 kB 2.33 kB
routerDirect..HASH.js gzip 322 B 322 B
script-HASH.js gzip 388 B 388 B
withRouter-HASH.js gzip 317 B 317 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 14.9 kB 14.9 kB -1 B
Client Build Manifests
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
_buildManifest.js gzip 458 B 458 B
Overall change 458 B 458 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary bnoguchi/next.js dep/upgrade-swc-core-1.2.148 Change
index.html gzip 530 B 530 B
link.html gzip 543 B 544 B ⚠️ +1 B
withRouter.html gzip 525 B 525 B
Overall change 1.6 kB 1.6 kB ⚠️ +1 B

Diffs

Diff for _buildManifest.js
@@ -8,11 +8,11 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Fcss-9b653f909589c123.js"
   ],
   "/dynamic": [
-    "static\u002Fchunks\u002Fpages\u002Fdynamic-3806562e6d80e46f.js"
+    "static\u002Fchunks\u002Fpages\u002Fdynamic-5fa0a9b9d9b0e52b.js"
   ],
   "/head": ["static\u002Fchunks\u002Fpages\u002Fhead-35c32b80abf212d2.js"],
   "/hooks": ["static\u002Fchunks\u002Fpages\u002Fhooks-8642d114a09c62c5.js"],
-  "/image": ["static\u002Fchunks\u002Fpages\u002Fimage-e3445a41cd45d90f.js"],
+  "/image": ["static\u002Fchunks\u002Fpages\u002Fimage-3b0e98cd8174c02a.js"],
   "/link": ["static\u002Fchunks\u002Fpages\u002Flink-0b3d72804dab6202.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-00527c3f2207a902.js"
Diff for _app-HASH.js
@@ -215,6 +215,9 @@
               default: obj
             };
       }
+      function appGetInitialProps(_) {
+        return _appGetInitialProps.apply(this, arguments);
+      }
       function _appGetInitialProps() {
         _appGetInitialProps = /**
          * `App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization.
@@ -243,9 +246,6 @@
         );
         return _appGetInitialProps.apply(this, arguments);
       }
-      function appGetInitialProps(_) {
-        return _appGetInitialProps.apply(this, arguments);
-      }
       var App = /*#__PURE__*/ (function(_Component) {
         _inherits(App, _Component);
         var _super = _createSuper(App);
@@ -269,9 +269,9 @@
         ]);
         return App;
       })(_react.default.Component);
+      exports["default"] = App;
       App.origGetInitialProps = appGetInitialProps;
-      App.getInitialProps = appGetInitialProps;
-      exports["default"] = App; //# sourceMappingURL=_app.js.map
+      App.getInitialProps = appGetInitialProps; //# sourceMappingURL=_app.js.map
 
       /***/
     }
Diff for dynamic-HASH.js
@@ -70,37 +70,10 @@
       __webpack_unused_export__ = {
         value: true
       };
-      __webpack_unused_export__ = noSSR;
       exports["default"] = dynamic;
+      __webpack_unused_export__ = noSSR;
       var _react = _interopRequireDefault(__webpack_require__(7294));
       var _loadable = _interopRequireDefault(__webpack_require__(4588));
-      function _interopRequireDefault(obj) {
-        return obj && obj.__esModule
-          ? obj
-          : {
-              default: obj
-            };
-      }
-      var isServerSide = "object" === "undefined";
-      function noSSR(LoadableInitializer, loadableOptions) {
-        // Removing webpack and modules means react-loadable won't try preloading
-        delete loadableOptions.webpack;
-        delete loadableOptions.modules;
-        // This check is necessary to prevent react-loadable from initializing on the server
-        if (!isServerSide) {
-          return LoadableInitializer(loadableOptions);
-        }
-        var Loading = loadableOptions.loading;
-        // This will only be rendered on the server side
-        return function() {
-          /*#__PURE__*/ return _react.default.createElement(Loading, {
-            error: null,
-            isLoading: true,
-            pastDelay: false,
-            timedOut: false
-          });
-        };
-      }
       function dynamic(dynamicOptions, options) {
         var loadableFn = _loadable.default;
         var loadableOptions = {
@@ -163,6 +136,33 @@
           delete loadableOptions.ssr;
         }
         return loadableFn(loadableOptions);
+      }
+      function _interopRequireDefault(obj) {
+        return obj && obj.__esModule
+          ? obj
+          : {
+              default: obj
+            };
+      }
+      var isServerSide = "object" === "undefined";
+      function noSSR(LoadableInitializer, loadableOptions) {
+        // Removing webpack and modules means react-loadable won't try preloading
+        delete loadableOptions.webpack;
+        delete loadableOptions.modules;
+        // This check is necessary to prevent react-loadable from initializing on the server
+        if (!isServerSide) {
+          return LoadableInitializer(loadableOptions);
+        }
+        var Loading = loadableOptions.loading;
+        // This will only be rendered on the server side
+        return function() {
+          /*#__PURE__*/ return _react.default.createElement(Loading, {
+            error: null,
+            isLoading: true,
+            pastDelay: false,
+            timedOut: false
+          });
+        };
       } //# sourceMappingURL=dynamic.js.map
 
       /***/
Diff for image-HASH.js
@@ -133,336 +133,6 @@
       var _useIntersection = __webpack_require__(9246);
       var _imageConfigContext = __webpack_require__(8730);
       var _utils = __webpack_require__(670);
-      function _defineProperty1(obj, key, value) {
-        if (key in obj) {
-          Object.defineProperty(obj, key, {
-            value: value,
-            enumerable: true,
-            configurable: true,
-            writable: true
-          });
-        } else {
-          obj[key] = value;
-        }
-        return obj;
-      }
-      function _interopRequireDefault(obj) {
-        return obj && obj.__esModule
-          ? obj
-          : {
-              default: obj
-            };
-      }
-      function _interopRequireWildcard(obj) {
-        if (obj && obj.__esModule) {
-          return obj;
-        } else {
-          var newObj = {};
-          if (obj != null) {
-            for (var key in obj) {
-              if (Object.prototype.hasOwnProperty.call(obj, key)) {
-                var desc =
-                  Object.defineProperty && Object.getOwnPropertyDescriptor
-                    ? Object.getOwnPropertyDescriptor(obj, key)
-                    : {};
-                if (desc.get || desc.set) {
-                  Object.defineProperty(newObj, key, desc);
-                } else {
-                  newObj[key] = obj[key];
-                }
-              }
-            }
-          }
-          newObj.default = obj;
-          return newObj;
-        }
-      }
-      function _objectSpread(target) {
-        var _arguments = arguments,
-          _loop = function(i) {
-            var source = _arguments[i] != null ? _arguments[i] : {};
-            var ownKeys = Object.keys(source);
-            if (typeof Object.getOwnPropertySymbols === "function") {
-              ownKeys = ownKeys.concat(
-                Object.getOwnPropertySymbols(source).filter(function(sym) {
-                  return Object.getOwnPropertyDescriptor(
-                    source,
-                    sym
-                  ).enumerable;
-                })
-              );
-            }
-            ownKeys.forEach(function(key) {
-              _defineProperty1(target, key, source[key]);
-            });
-          };
-        for (var i = 1; i < arguments.length; i++) _loop(i);
-        return target;
-      }
-      function _objectWithoutProperties(source, excluded) {
-        if (source == null) return {};
-        var target = _objectWithoutPropertiesLoose(source, excluded);
-        var key, i;
-        if (Object.getOwnPropertySymbols) {
-          var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
-          for (i = 0; i < sourceSymbolKeys.length; i++) {
-            key = sourceSymbolKeys[i];
-            if (excluded.indexOf(key) >= 0) continue;
-            if (!Object.prototype.propertyIsEnumerable.call(source, key))
-              continue;
-            target[key] = source[key];
-          }
-        }
-        return target;
-      }
-      function _objectWithoutPropertiesLoose(source, excluded) {
-        if (source == null) return {};
-        var target = {};
-        var sourceKeys = Object.keys(source);
-        var key, i;
-        for (i = 0; i < sourceKeys.length; i++) {
-          key = sourceKeys[i];
-          if (excluded.indexOf(key) >= 0) continue;
-          target[key] = source[key];
-        }
-        return target;
-      }
-      var configEnv = {
-        deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
-        imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
-        path: "/_next/image",
-        loader: "default"
-      };
-      var loadedImageURLs = new Set();
-      var allImgs = new Map();
-      var perfObserver;
-      var emptyDataURL =
-        "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
-      if (false) {
-      }
-      var VALID_LOADING_VALUES = /* unused pure expression or super */ null && [
-        "lazy",
-        "eager",
-        undefined
-      ];
-      var loaders = new Map([
-        ["default", defaultLoader],
-        ["imgix", imgixLoader],
-        ["cloudinary", cloudinaryLoader],
-        ["akamai", akamaiLoader],
-        ["custom", customLoader]
-      ]);
-      var VALID_LAYOUT_VALUES = /* unused pure expression or super */ null && [
-        "fill",
-        "fixed",
-        "intrinsic",
-        "responsive",
-        undefined
-      ];
-      function isStaticRequire(src) {
-        return src.default !== undefined;
-      }
-      function isStaticImageData(src) {
-        return src.src !== undefined;
-      }
-      function isStaticImport(src) {
-        return (
-          typeof src === "object" &&
-          (isStaticRequire(src) || isStaticImageData(src))
-        );
-      }
-      function getWidths(param, width, layout, sizes) {
-        var deviceSizes = param.deviceSizes,
-          allSizes = param.allSizes;
-        if (sizes && (layout === "fill" || layout === "responsive")) {
-          // Find all the "vw" percent sizes used in the sizes prop
-          var viewportWidthRe = /(^|\s)(1?\d?\d)vw/g;
-          var percentSizes = [];
-          for (var match; (match = viewportWidthRe.exec(sizes)); match) {
-            percentSizes.push(parseInt(match[2]));
-          }
-          if (percentSizes.length) {
-            var _Math;
-            var smallestRatio =
-              (_Math = Math).min.apply(
-                _Math,
-                _toConsumableArray(percentSizes)
-              ) * 0.01;
-            return {
-              widths: allSizes.filter(function(s) {
-                return s >= deviceSizes[0] * smallestRatio;
-              }),
-              kind: "w"
-            };
-          }
-          return {
-            widths: allSizes,
-            kind: "w"
-          };
-        }
-        if (
-          typeof width !== "number" ||
-          layout === "fill" ||
-          layout === "responsive"
-        ) {
-          return {
-            widths: deviceSizes,
-            kind: "w"
-          };
-        }
-        var widths = _toConsumableArray(
-          new Set( // > are actually 3x in the green color, but only 1.5x in the red and
-            // > blue colors. Showing a 3x resolution image in the app vs a 2x
-            // > resolution image will be visually the same, though the 3x image
-            // > takes significantly more data. Even true 3x resolution screens are
-            // > wasteful as the human eye cannot see that level of detail without
-            // > something like a magnifying glass.
-            // https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/capping-image-fidelity-on-ultra-high-resolution-devices.html
-            [width, width * 2 /*, width * 3*/].map(function(w) {
-              return (
-                allSizes.find(function(p) {
-                  return p >= w;
-                }) || allSizes[allSizes.length - 1]
-              );
-            })
-          )
-        );
-        return {
-          widths: widths,
-          kind: "x"
-        };
-      }
-      function generateImgAttrs(param) {
-        var config = param.config,
-          src = param.src,
-          unoptimized = param.unoptimized,
-          layout = param.layout,
-          width = param.width,
-          quality = param.quality,
-          sizes = param.sizes,
-          loader = param.loader;
-        if (unoptimized) {
-          return {
-            src: src,
-            srcSet: undefined,
-            sizes: undefined
-          };
-        }
-        var ref = getWidths(config, width, layout, sizes),
-          widths = ref.widths,
-          kind = ref.kind;
-        var last = widths.length - 1;
-        return {
-          sizes: !sizes && kind === "w" ? "100vw" : sizes,
-          srcSet: widths
-            .map(function(w, i) {
-              return ""
-                .concat(
-                  loader({
-                    config: config,
-                    src: src,
-                    quality: quality,
-                    width: w
-                  }),
-                  " "
-                )
-                .concat(kind === "w" ? w : i + 1)
-                .concat(kind);
-            })
-            .join(", "),
-          // It's intended to keep `src` the last attribute because React updates
-          // attributes in order. If we keep `src` the first one, Safari will
-          // immediately start to fetch `src`, before `sizes` and `srcSet` are even
-          // updated by React. That causes multiple unnecessary requests if `srcSet`
-          // and `sizes` are defined.
-          // This bug cannot be reproduced in Chrome or Firefox.
-          src: loader({
-            config: config,
-            src: src,
-            quality: quality,
-            width: widths[last]
-          })
-        };
-      }
-      function getInt(x) {
-        if (typeof x === "number") {
-          return x;
-        }
-        if (typeof x === "string") {
-          return parseInt(x, 10);
-        }
-        return undefined;
-      }
-      function defaultImageLoader(loaderProps) {
-        var ref;
-        var loaderKey =
-          ((ref = loaderProps.config) === null || ref === void 0
-            ? void 0
-            : ref.loader) || "default";
-        var load = loaders.get(loaderKey);
-        if (load) {
-          return load(loaderProps);
-        }
-        throw new Error(
-          'Unknown "loader" found in "next.config.js". Expected: '
-            .concat(_imageConfig.VALID_LOADERS.join(", "), ". Received: ")
-            .concat(loaderKey)
-        );
-      }
-      // See https://stackoverflow.com/q/39777833/266535 for why we use this ref
-      // handler instead of the img's onLoad attribute.
-      function handleLoading(
-        imgRef,
-        src,
-        layout,
-        placeholder,
-        onLoadingCompleteRef
-      ) {
-        var handleLoad = function() {
-          var img = imgRef.current;
-          if (!img) {
-            return;
-          }
-          if (img.src !== emptyDataURL) {
-            var p = "decode" in img ? img.decode() : Promise.resolve();
-            p.catch(function() {}).then(function() {
-              if (!imgRef.current) {
-                return;
-              }
-              loadedImageURLs.add(src);
-              if (placeholder === "blur") {
-                img.style.filter = "";
-                img.style.backgroundSize = "";
-                img.style.backgroundImage = "";
-                img.style.backgroundPosition = "";
-              }
-              if (onLoadingCompleteRef.current) {
-                var naturalWidth = img.naturalWidth,
-                  naturalHeight = img.naturalHeight;
-                // Pass back read-only primitive values but not the
-                // underlying DOM element because it could be misused.
-                onLoadingCompleteRef.current({
-                  naturalWidth: naturalWidth,
-                  naturalHeight: naturalHeight
-                });
-              }
-              if (false) {
-                var parent, ref;
-              }
-            });
-          }
-        };
-        if (imgRef.current) {
-          if (imgRef.current.complete) {
-            // If the real image fails to load, this will still remove the placeholder.
-            // This is the desired behavior for now, and will be revisited when error
-            // handling is worked on for the image component itself.
-            handleLoad();
-          } else {
-            imgRef.current.onload = handleLoad;
-          }
-        }
-      }
       function Image(_param) {
         var src = _param.src,
           sizes = _param.sizes,
@@ -843,6 +513,336 @@
             : null
         );
       }
+      function _defineProperty1(obj, key, value) {
+        if (key in obj) {
+          Object.defineProperty(obj, key, {
+            value: value,
+            enumerable: true,
+            configurable: true,
+            writable: true
+          });
+        } else {
+          obj[key] = 
Post job cleanup.
[command]/usr/bin/git version
git version 2.35.1
[command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
[command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
http.https://github.com/.extraheader
[command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
Cleaning up orphan processes
Commit: ea4c2ba7378f24f75bdb131d8a6c3ac6e9583226

@kodiakhq kodiakhq bot merged commit 01268f6 into vercel:canary Mar 5, 2022
@huozhi
Copy link
Member

huozhi commented Mar 7, 2022

@bnoguchi Are you running this command in next.js? This is what I got

> npx swc --version

@swc/cli: 0.1.55
@swc/core: 1.2.148

Did you run yarn in the workspace directory to reinstall and build all deps?

@bnoguchi
Copy link
Contributor Author

bnoguchi commented Mar 7, 2022

I'm running npx swc --version from a project that requires next, on an M1 (are you also on an identical platform? maybe we are using different platform swc binaries). I'm using npm, not yarn in the project. I've tried clearing my yarn cache and npm cache, removing node_modules, and reinstalling everything -- but still getting.

> npx swc --version

@swc/cli: 0.1.55
@swc/core: 1.2.147

@bnoguchi
Copy link
Contributor Author

bnoguchi commented Mar 8, 2022

Nvm resolved.

Running yarn in vercel/next.js tag v12.1.1-canary.7 returns the correct version:

> npx swc --version

@swc/cli: 0.1.55
@swc/core: 1.2.148

@bnoguchi
Copy link
Contributor Author

bnoguchi commented Mar 8, 2022

@huozhi Is there a way to check what version of @swc/core next is using from a project that is using next.js? Or a way to have access to the swc-ish binary that next is publishing to check to see how it compares to the compilation behavior of the official @swc/cli package binary? Because when using the next@canary, I'm not seeing the updated behavior from next's swc-compiled version of a file locally that I was expecting to see with @swc/core@1.2.148.

@bnoguchi
Copy link
Contributor Author

bnoguchi commented Mar 8, 2022

@huozhi Oh wait, I looked at the source code for next.js more closely. I'm guessing that I probably should have also included updates to the crate versions here? https://github.com/vercel/next.js/blob/canary/packages/next-swc/crates/core/Cargo.toml#L19-L26

@bnoguchi
Copy link
Contributor Author

bnoguchi commented Mar 8, 2022

@huozhi To try to get the fix I'm hoping for from swc, I created a new PR here, which also updates the crate versions for swc and swc_* crates - #35127

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 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

3 participants