Skip to content

Commit

Permalink
Make check release job parallel to build job (#30350)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk authored Oct 26, 2021
1 parent 8077f42 commit 8d82d76
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,30 @@ jobs:
- name: Check examples
run: ./scripts/check-examples.sh

checkIsRelease:
runs-on: ubuntu-latest
outputs:
isRelease: ${{ steps.check-release.outputs.IS_RELEASE }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 25
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- id: check-release
run: |
if [[ $(git describe --exact-match 2> /dev/null || :) = v* ]];
then
echo "::set-output name=IS_RELEASE::true"
else
echo "::set-output name=IS_RELEASE::false"
fi
build:
runs-on: ubuntu-latest
env:
NEXT_TELEMETRY_DISABLED: 1
outputs:
docsChange: ${{ steps.docs-change.outputs.DOCS_CHANGE }}
isRelease: ${{ steps.check-release.outputs.IS_RELEASE }}
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -32,24 +49,12 @@ jobs:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off

- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- run: yarn install --frozen-lockfile --check-files
- run: node run-tests.js --timings --write-timings -g 1/1
- name: Check docs only change
run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
id: docs-change
- run: echo ${{steps.docs-change.outputs.DOCS_CHANGE}}
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- run: git describe
- id: check-release
run: |
if [[ $(git describe --exact-match 2> /dev/null || :) = v* ]];
then
echo "::set-output name=IS_RELEASE::true"
else
echo "::set-output name=IS_RELEASE::false"
fi
- uses: actions/cache@v2
id: cache-build
with:
Expand Down Expand Up @@ -405,10 +410,11 @@ jobs:
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

publishRelease:
if: ${{ needs.build.outputs.isRelease == 'true' }}
if: ${{ needs.checkIsRelease.outputs.isRelease == 'true' }}
name: Potentially publish release
runs-on: ubuntu-latest
needs:
- checkIsRelease
- build
- build-native
- build-windows-i686
Expand Down Expand Up @@ -581,8 +587,8 @@ jobs:
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}

build-windows-i686:
needs: build
if: ${{ needs.build.outputs.isRelease == 'true' }}
needs: checkIsRelease
if: ${{ needs.checkIsRelease.outputs.isRelease == 'true' }}
name: next-swc - windows-i686 - node@14
runs-on: windows-latest
env:
Expand Down Expand Up @@ -640,8 +646,8 @@ jobs:
path: packages/next/native/next-swc.win32-ia32-msvc.node

build-windows-aarch64:
needs: build
if: ${{ needs.build.outputs.isRelease == 'true' }}
needs: checkIsRelease
if: ${{ needs.checkIsRelease.outputs.isRelease == 'true' }}
name: next-swc - windows-aarch64 - node@14
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -687,8 +693,8 @@ jobs:
path: packages/next/native/next-swc.win32-arm64-msvc.node

build-linux-musl:
needs: build
if: ${{ needs.build.outputs.isRelease == 'true' }}
needs: checkIsRelease
if: ${{ needs.checkIsRelease.outputs.isRelease == 'true' }}
name: next-swc - linux-musl - node@lts
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -741,8 +747,8 @@ jobs:
path: packages/next/native/next-swc.linux-x64-musl.node

build-linux-aarch64:
needs: build
if: ${{ needs.build.outputs.isRelease == 'true' }}
needs: checkIsRelease
if: ${{ needs.checkIsRelease.outputs.isRelease == 'true' }}
name: next-swc - aarch64-unknown-linux-gnu - node@14
runs-on: ubuntu-18.04
steps:
Expand Down Expand Up @@ -803,8 +809,8 @@ jobs:
path: packages/next/native/next-swc.linux-arm64-gnu.node

build-linux-aarch64-musl:
needs: build
if: ${{ needs.build.outputs.isRelease == 'true' }}
needs: checkIsRelease
if: ${{ needs.checkIsRelease.outputs.isRelease == 'true' }}
name: next-swc - aarch64-unknown-linux-musl - node@14
runs-on: ubuntu-18.04
steps:
Expand Down Expand Up @@ -863,8 +869,8 @@ jobs:
path: packages/next/native/next-swc.linux-arm64-musl.node

build-linux-arm7:
needs: build
if: ${{ needs.build.outputs.isRelease == 'true' }}
needs: checkIsRelease
if: ${{ needs.checkIsRelease.outputs.isRelease == 'true' }}
name: next-swc - arm7-unknown-linux-gnu - node@14
runs-on: ubuntu-18.04
steps:
Expand Down Expand Up @@ -925,8 +931,8 @@ jobs:
path: packages/next/native/next-swc.linux-arm-gnueabihf.node

build-android-aarch64:
needs: build
if: ${{ needs.build.outputs.isRelease == 'true' }}
needs: checkIsRelease
if: ${{ needs.checkIsRelease.outputs.isRelease == 'true' }}
name: next-swc - Android - aarch64
runs-on: macos-latest
steps:
Expand Down

1 comment on commit 8d82d76

@ijjk
Copy link
Member Author

@ijjk ijjk commented on 8d82d76 Oct 26, 2021

Choose a reason for hiding this comment

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

Stats from current release

Default Build (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
buildDuration 17.1s 17.1s ⚠️ +90ms
buildDurationCached 3.5s 3.5s ⚠️ +70ms
nodeModulesSize 198 MB 207 MB ⚠️ +9.19 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
/ failed reqs 0 0
/ total time (seconds) 2.827 2.88 ⚠️ +0.05
/ avg req/sec 884.3 867.91 ⚠️ -16.39
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.387 1.385 0
/error-in-render avg req/sec 1802.66 1804.67 +2.01
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.2 kB 42.2 kB
main-HASH.js gzip 27.7 kB 28 kB ⚠️ +365 B
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 71.5 kB 71.9 kB ⚠️ +365 B
Legacy Client Bundles (polyfills)
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
polyfills-a4..dd70.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
_app-HASH.js gzip 1.23 kB 1.23 kB
_error-HASH.js gzip 194 B 194 B
amp-HASH.js gzip 312 B 312 B
css-HASH.js gzip 327 B 327 B
dynamic-HASH.js gzip 2.38 kB 2.38 kB
head-HASH.js gzip 350 B 350 B
hooks-HASH.js gzip 635 B 635 B
image-HASH.js gzip 4.44 kB 4.44 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 1.87 kB 1.87 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
334f979574ae..6f4.css gzip 106 B 106 B
Overall change 13.1 kB 13.1 kB
Client Build Manifests
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
_buildManifest.js gzip 459 B 459 B
Overall change 459 B 459 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
index.html gzip 534 B 534 B
link.html gzip 546 B 547 B ⚠️ +1 B
withRouter.html gzip 527 B 528 B ⚠️ +1 B
Overall change 1.61 kB 1.61 kB ⚠️ +2 B

Diffs

Diff for main-HASH.js
@@ -522,7 +522,7 @@
         document.getElementById("__NEXT_DATA__").textContent
       );
       window.__NEXT_DATA__ = data;
-      var version = "12.0.0";
+      var version = "12.0.1-canary.3";
       exports.version = version;
       var looseToArray = function(input) {
         return [].slice.call(input);
@@ -539,7 +539,8 @@
         locale = data.locale,
         locales = data.locales,
         domainLocales = data.domainLocales,
-        isPreview = data.isPreview;
+        isPreview = data.isPreview,
+        rsc = data.rsc;
       var defaultLocale = data.defaultLocale;
       var prefix = assetPrefix || "";
       // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time
@@ -1156,6 +1157,10 @@
           );
         };
       };
+      var RSCComponent;
+      if (false) {
+        var RSCWrapper, rscCache, createResponseCache;
+      }
       var lastAppProps;
       function doRender(input) {
         var onStart = // This function has a return type to ensure it doesn't start returning a
@@ -1256,12 +1261,14 @@
         var App = input.App,
           Component = input.Component,
           props = input.props,
-          err = input.err;
+          err = input.err,
+          __N_RSC = input.__N_RSC;
         var styleSheets = "initial" in input ? undefined : input.styleSheets;
         Component = Component || lastAppProps.Component;
         props = props || lastAppProps.props;
+        var isRSC = false ? 0 : !!__N_RSC;
         var appProps = _objectSpread({}, props, {
-          Component: Component,
+          Component: isRSC ? RSCComponent : Component,
           err: err,
           router: router
         });
@@ -1511,7 +1518,12 @@
              * @param {string} asPath the URL as shown in browser (virtual path); used for dynamic routes
              * @returns {string}
              */ key: "getDataHref",
-            value: function getDataHref(href, asPath, ssg, locale) {
+            value: function getDataHref(param) {
+              var href = param.href,
+                asPath = param.asPath,
+                ssg = param.ssg,
+                rsc = param.rsc,
+                locale = param.locale;
               var _this = this;
               var ref = (0, _parseRelativeUrl).parseRelativeUrl(href),
                 hrefPathname = ref.pathname,
@@ -1521,6 +1533,7 @@
                 asPathname = ref1.pathname;
               var route = normalizeRoute(hrefPathname);
               var getHrefForSlug = function(path) {
+                if (rsc) return path + "?__flight__";
                 var dataRoute = (0, _getAssetPathFromRoute).default(
                   (0, _normalizeTrailingSlash).removePathTrailingSlash(
                     (0, _router).addLocale(path, locale)
@@ -4170,7 +4183,7 @@
       var manualScrollRestoration =
         /* unused pure expression or super */ null && false && 0;
       var SSG_DATA_NOT_FOUND = Symbol("SSG_DATA_NOT_FOUND");
-      function fetchRetry(url, attempts) {
+      function fetchRetry(url, attempts, opts) {
         return fetch(url, {
           // Cookies are required to be present for Next.js' SSG "Preview Mode".
           // Cookies may also be required for `getServerSideProps`.
@@ -4187,7 +4200,7 @@
         }).then(function(res) {
           if (!res.ok) {
             if (attempts > 1 && res.status >= 500) {
-              return fetchRetry(url, attempts - 1);
+              return fetchRetry(url, attempts - 1, opts);
             }
             if (res.status === 404) {
               return res.json().then(function(data) {
@@ -4201,12 +4214,13 @@
             }
             throw new Error("Failed to load static props");
           }
-          return res.json();
+          return opts.text ? res.text() : res.json();
         });
       }
       function fetchNextData(
         dataHref,
         isServerRender,
+        text,
         inflightCache,
         persistCache
       ) {
@@ -4217,7 +4231,10 @@
         }
         return (inflightCache[cacheKey] = fetchRetry(
           dataHref,
-          isServerRender ? 3 : 1
+          isServerRender ? 3 : 1,
+          {
+            text: text
+          }
         )
           .catch(function(err) {
             // We should only trigger a server-side transition if this was caused
@@ -4336,13 +4353,17 @@
           // Otherwise, this cause issues when when going back and
           // come again to the errored page.
           if (pathname2 !== "/_error") {
+            var ref;
             this.components[this.route] = {
               Component: Component,
               initial: true,
               props: initialProps,
               err: err,
               __N_SSG: initialProps && initialProps.__N_SSG,
-              __N_SSP: initialProps && initialProps.__N_SSP
+              __N_SSP: initialProps && initialProps.__N_SSP,
+              __N_RSC: !!((ref = Component) === null || ref === void 0
+                ? void 0
+                : ref.__next_rsc__)
             };
           }
           this.components["/_app"] = {
@@ -5280,9 +5301,13 @@
                       Component,
                       __N_SSG,
                       __N_SSP,
+                      __N_RSC,
                       isValidElementType,
                       dataHref,
-                      props;
+                      props,
+                      _this1,
+                      fresh,
+                      data;
                     return _regeneratorRuntime.default.wrap(
                       function _callee$(_ctx) {
                         while (1)
@@ -5326,7 +5351,8 @@
                                   Component: res.page,
                                   styleSheets: res.styleSheets,
                                   __N_SSG: res.mod.__N_SSG,
-                                  __N_SSP: res.mod.__N_SSP
+                                  __N_SSP: res.mod.__N_SSP,
+                                  __N_RSC: !!res.page.__next_rsc__
                                 };
                               });
                             case 11:
@@ -5338,6 +5364,7 @@
                                 (Component = ref.Component),
                                 (__N_SSG = ref.__N_SSG),
                                 (__N_SSP = ref.__N_SSP),
+                                (__N_RSC = ref.__N_RSC),
                                 ref;
                               if (true) {
                                 _ctx.next = 18;
@@ -5363,16 +5390,17 @@
                                 )
                               );
                             case 18:
-                              if (__N_SSG || __N_SSP) {
-                                dataHref = this.pageLoader.getDataHref(
-                                  (0, _utils).formatWithValidation({
+                              if (__N_SSG || __N_SSP || __N_RSC) {
+                                dataHref = this.pageLoader.getDataHref({
+                                  href: (0, _utils).formatWithValidation({
                                     pathname: pathname,
                                     query: query
                                   }),
-                                  resolvedAs,
-                                  __N_SSG,
-                                  this.locale
-                                );
+                                  asPath: resolvedAs,
+                                  ssg: __N_SSG,
+                                  rsc: __N_RSC,
+                                  locale: this.locale
+                                });
                               }
                               _ctx.next = 22;
                               return this._getData(function() {
@@ -5380,6 +5408,7 @@
                                   ? fetchNextData(
                                       dataHref,
                                       _this.isSsr,
+                                      false,
                                       __N_SSG ? _this.sdc : _this.sdr,
                                       !!__N_SSG
                                     )
@@ -5394,11 +5423,31 @@
                               });
                             case 22:
                               props = _ctx.sent;
+                              if (!__N_RSC) {
+                                _ctx.next = 29;
+                                break;
+                              }
+                              _this1 = this;
+                              _ctx.next = 27;
+                              return this._getData(function() {
+                                return _this1._getFlightData(dataHref);
+                              });
+                            case 27:
+                              var ref1;
+                              (ref1 = _ctx.sent),
+                                (fresh = ref1.fresh),
+                                (data = ref1.data),
+                                ref1;
+                              props.pageProps = Object.assign(props.pageProps, {
+                                __flight_serialized__: data,
+                                __flight_fresh__: fresh
+                              });
+                            case 29:
                               routeInfo.props = props;
                               this.components[route] = routeInfo;
                               return _ctx.abrupt("return", routeInfo);
-                            case 28:
-                              _ctx.prev = 28;
+                            case 34:
+                              _ctx.prev = 34;
                               _ctx.t1 = _ctx["catch"](0);
                               return _ctx.abrupt(
                                 "return",
@@ -5412,14 +5461,14 @@
                                   routeProps
                                 )
                               );
-                            case 31:
+                            case 37:
                             case "end":
                               return _ctx.stop();
                           }
                       },
                       _callee,
                       this,
-                      [[0, 28]]
+                      [[0, 34]]
                     );
                   })
                   .bind(this)
@@ -5453,9 +5502,9 @@
               var ref = _slicedToArray(this.asPath.split("#"), 2),
                 oldUrlNoHash = ref[0],
                 oldHash = ref[1];
-              var ref1 = _slicedToArray(as.split("#"), 2),
-                newUrlNoHash = ref1[0],
-                newHash = ref1[1];
+              var ref9 = _slicedToArray(as.split("#"), 2),
+                newUrlNoHash = ref9[0],
+                newHash = ref9[1];
               // Makes sure we scroll to the provided hash if the url/hash are the same
               if (
                 newHash &&
@@ -5559,10 +5608,10 @@
                               _ctx.next = 12;
                               return (0, _routeLoader).getClientBuildManifest();
                             case 12:
-                              var ref9;
-                              (ref9 = _ctx.sent),
-                                (rewrites = ref9.__rewrites),
-                                ref9;
+                              var ref10;
+                              (ref10 = _ctx.sent),
+                                (rewrites = ref10.__rewrites),
+                                ref10;
                               rewritesResult = (0, _resolveRewrites).default(
                                 addBasePath(addLocale(asPath, this.locale)),
                                 pages,
@@ -5639,15 +5688,17 @@
                                   .then(function(isSsg) {
                                     return isSsg
                                       ? fetchNextData(
-                                          _this.pageLoader.getDataHref(
-                                            url,
-                                            resolvedAs,
-                                            true,
-                                            typeof options.locale !==
+                                          _this.pageLoader.getDataHref({
+                                            href: url,
+                                            asPath: resolvedAs,
+                                            ssg: true,
+                                            locale:
+                                              typeof options.locale !==
                                               "undefined"
-                                              ? options.locale
-                                              : _this.locale
-                                          ),
+                                                ? options.locale
+                                                : _this.locale
+                                          }),
+                                          false,
                                           false,
                                           _this.sdc,
                                           true
@@ -5755,6 +5806,29 @@
               });
             }
           },
+          {
+            key: "_getFlightData",
+            value: function _getFlightData(dataHref) {
+              var _this = this;
+              var ref = new URL(dataHref, window.location.href),
+                cacheKey = ref.href;
+              if (!this.isPreview && this.sdc[cacheKey]) {
+                return Promise.resolve({
+                  fresh: false,
+                  data: this.sdc[cacheKey]
+                });
+              }
+              return fetchNextData(dataHref, true, true, this.sdc, false).then(
+                function(serialized) {
+                  _this.sdc[cacheKey] = serialized;
+                  return {
+                    fresh: true,
+                    data: serialized
+                  };
+                }
+              );
+            }
+          },
           {
             key: "_preflightRequest",
             value: function _preflightRequest(options) {
@@ -5788,12 +5862,14 @@
                               return this.pageLoader.getMiddlewareList();
                             case 4:
                               fns = _ctx.sent;
-                              requiresPreflight = fns.some(function(
-                                middleware
-                              ) {
+                              requiresPreflight = fns.some(function(param) {
+                                var _param = _slicedToArray(param, 2),
+                                  middleware = _param[0],
+                                  isSSR = _param[1];
                                 return (0, _routeMatcher).getRouteMatcher(
                                   (0, _getMiddlewareRegex).getMiddlewareRegex(
-                                    middleware
+                                    middleware,
+                                    !isSSR
                                   )
                                 )(cleanedAs);
                               });
@@ -5873,15 +5949,15 @@
                                   this.locales
                                 ).pathname
                               );
-                              var ref10;
-                              (ref10 = prepareUrlAs(
+                              var ref11;
+                              (ref11 = prepareUrlAs(
                                 this,
                                 cleanRedirect,
                                 cleanRedirect
                               )),
-                                (newUrl = ref10.url),
-                                (newAs = ref10.as),
-                                ref10;
+                                (newUrl = ref11.url),
+                                (newAs = ref11.as),
+                                ref11;
                               return _ctx.abrupt("return", {
                                 type: "redirect",
                                 newUrl: newUrl,
@@ -5893,7 +5969,7 @@
                                 destination: preflight.redirect
                               });
                             case 24:
-                              if (!preflight.refresh) {
+                              if (!(preflight.refresh && !preflight.ssr)) {
                                 _ctx.next = 26;
                                 break;
                               }
@@ -5921,7 +5997,7 @@
             key: "_getPreflightData",
             value: function _getPreflightData(params) {
               var _this = this,
-                _this1 = this;
+                _this2 = this;
               var preflightHref = params.preflightHref,
                 _shouldCache = params.shouldCache,
                 shouldCache = _shouldCache === void 0 ? false : _shouldCache;
@@ -5949,7 +6025,8 @@
                   return {
                     redirect: res.headers.get("Location"),
                     refresh: res.headers.has("x-middleware-refresh"),
-                    rewrite: res.headers.get("x-middleware-rewrite")
+                    rewrite: res.headers.get("x-middleware-rewrite"),
+                    ssr: !!res.headers.get("x-middleware-ssr")
                   };
                 })
                 .then(function(data) {
@@ -5959,7 +6036,7 @@
                   return data;
                 })
                 .catch(function(err) {
-                  delete _this1.sde[cacheKey];
+                  delete _this2.sde[cacheKey];
                   throw err;
                 });
             }
@@ -6131,25 +6208,29 @@
       });
       exports.getMiddlewareRegex = getMiddlewareRegex;
       var _routeRegex = __webpack_require__(4095);
-      function getMiddlewareRegex(normalizedRoute) {
+      function getMiddlewareRegex(normalizedRoute, param) {
+        var catchAll = param === void 0 ? true : param;
         var result = (0, _routeRegex).getParametrizedRoute(normalizedRoute);
+        var catchAllRegex = catchAll ? "(?!_next).*" : "";
+        var catchAllGroupedRegex = catchAll ? "(?:(/.*)?)" : "";
         if ("routeKeys" in result) {
           if (result.parameterizedRoute === "/") {
             return {
               groups: {},
-              namedRegex: "^/(?!_next).*$",
-              re: new RegExp("^/(?!_next).*$"),
+              namedRegex: "^/".concat(catchAllRegex, "$"),
+              re: new RegExp("^/".concat(catchAllRegex, "$")),
               routeKeys: {}
             };
           }
           return {
             groups: result.groups,
-            namedRegex: "^".concat(
-              result.namedParameterizedRoute,
-              "(?:(/.*)?)$"
-            ),
+            namedRegex: "^"
+              .concat(result.namedParameterizedRoute)
+              .concat(catchAllGroupedRegex, "$"),
             re: new RegExp(
-              "^".concat(result.parameterizedRoute, "(?:(/.*)?)$")
+              "^"
+                .concat(result.parameterizedRoute)
+                .concat(catchAllGroupedRegex, "$")
             ),
             routeKeys: result.routeKeys
           };
@@ -6157,12 +6238,16 @@
         if (result.parameterizedRoute === "/") {
           return {
             groups: {},
-            re: new RegExp("^/.*$")
+            re: new RegExp("^/".concat(catchAllRegex, "$"))
           };
         }
         return {
           groups: {},
-          re: new RegExp("^".concat(result.parameterizedRoute, "(?:(/.*)?)$"))
+          re: new RegExp(
+            "^"
+              .concat(result.parameterizedRoute)
+              .concat(catchAllGroupedRegex, "$")
+          )
         };
       } //# sourceMappingURL=get-middleware-regex.js.map
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-7f284d233915b9b1.js"
+      src="/_next/static/chunks/main-c41231a97ee7e256.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-7f284d233915b9b1.js"
+      src="/_next/static/chunks/main-c41231a97ee7e256.js"
       defer=""
     ></script>
     <script
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-7f284d233915b9b1.js"
+      src="/_next/static/chunks/main-c41231a97ee7e256.js"
       defer=""
     ></script>
     <script

Default Build with SWC (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
buildDuration 16.8s 17.1s ⚠️ +273ms
buildDurationCached 3.6s 3.5s -23ms
nodeModulesSize 198 MB 207 MB ⚠️ +9.19 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
/ failed reqs 0 0
/ total time (seconds) 2.792 2.855 ⚠️ +0.06
/ avg req/sec 895.46 875.64 ⚠️ -19.82
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.314 1.359 ⚠️ +0.04
/error-in-render avg req/sec 1902.86 1840.18 ⚠️ -62.68
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.2 kB 42.2 kB
main-HASH.js gzip 27.7 kB 28 kB ⚠️ +365 B
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 71.5 kB 71.9 kB ⚠️ +365 B
Legacy Client Bundles (polyfills)
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
polyfills-a4..dd70.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
_app-HASH.js gzip 1.23 kB 1.23 kB
_error-HASH.js gzip 194 B 194 B
amp-HASH.js gzip 312 B 312 B
css-HASH.js gzip 327 B 327 B
dynamic-HASH.js gzip 2.38 kB 2.38 kB
head-HASH.js gzip 350 B 350 B
hooks-HASH.js gzip 635 B 635 B
image-HASH.js gzip 4.44 kB 4.44 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 1.87 kB 1.87 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
334f979574ae..6f4.css gzip 106 B 106 B
Overall change 13.1 kB 13.1 kB
Client Build Manifests
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
_buildManifest.js gzip 459 B 459 B
Overall change 459 B 459 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary v12.0.0 vercel/next.js refs/heads/canary Change
index.html gzip 534 B 534 B
link.html gzip 546 B 547 B ⚠️ +1 B
withRouter.html gzip 527 B 528 B ⚠️ +1 B
Overall change 1.61 kB 1.61 kB ⚠️ +2 B

Diffs

Diff for main-HASH.js
@@ -522,7 +522,7 @@
         document.getElementById("__NEXT_DATA__").textContent
       );
       window.__NEXT_DATA__ = data;
-      var version = "12.0.0";
+      var version = "12.0.1-canary.3";
       exports.version = version;
       var looseToArray = function(input) {
         return [].slice.call(input);
@@ -539,7 +539,8 @@
         locale = data.locale,
         locales = data.locales,
         domainLocales = data.domainLocales,
-        isPreview = data.isPreview;
+        isPreview = data.isPreview,
+        rsc = data.rsc;
       var defaultLocale = data.defaultLocale;
       var prefix = assetPrefix || "";
       // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time
@@ -1156,6 +1157,10 @@
           );
         };
       };
+      var RSCComponent;
+      if (false) {
+        var RSCWrapper, rscCache, createResponseCache;
+      }
       var lastAppProps;
       function doRender(input) {
         var onStart = // This function has a return type to ensure it doesn't start returning a
@@ -1256,12 +1261,14 @@
         var App = input.App,
           Component = input.Component,
           props = input.props,
-          err = input.err;
+          err = input.err,
+          __N_RSC = input.__N_RSC;
         var styleSheets = "initial" in input ? undefined : input.styleSheets;
         Component = Component || lastAppProps.Component;
         props = props || lastAppProps.props;
+        var isRSC = false ? 0 : !!__N_RSC;
         var appProps = _objectSpread({}, props, {
-          Component: Component,
+          Component: isRSC ? RSCComponent : Component,
           err: err,
           router: router
         });
@@ -1511,7 +1518,12 @@
              * @param {string} asPath the URL as shown in browser (virtual path); used for dynamic routes
              * @returns {string}
              */ key: "getDataHref",
-            value: function getDataHref(href, asPath, ssg, locale) {
+            value: function getDataHref(param) {
+              var href = param.href,
+                asPath = param.asPath,
+                ssg = param.ssg,
+                rsc = param.rsc,
+                locale = param.locale;
               var _this = this;
               var ref = (0, _parseRelativeUrl).parseRelativeUrl(href),
                 hrefPathname = ref.pathname,
@@ -1521,6 +1533,7 @@
                 asPathname = ref1.pathname;
               var route = normalizeRoute(hrefPathname);
               var getHrefForSlug = function(path) {
+                if (rsc) return path + "?__flight__";
                 var dataRoute = (0, _getAssetPathFromRoute).default(
                   (0, _normalizeTrailingSlash).removePathTrailingSlash(
                     (0, _router).addLocale(path, locale)
@@ -4170,7 +4183,7 @@
       var manualScrollRestoration =
         /* unused pure expression or super */ null && false && 0;
       var SSG_DATA_NOT_FOUND = Symbol("SSG_DATA_NOT_FOUND");
-      function fetchRetry(url, attempts) {
+      function fetchRetry(url, attempts, opts) {
         return fetch(url, {
           // Cookies are required to be present for Next.js' SSG "Preview Mode".
           // Cookies may also be required for `getServerSideProps`.
@@ -4187,7 +4200,7 @@
         }).then(function(res) {
           if (!res.ok) {
             if (attempts > 1 && res.status >= 500) {
-              return fetchRetry(url, attempts - 1);
+              return fetchRetry(url, attempts - 1, opts);
             }
             if (res.status === 404) {
               return res.json().then(function(data) {
@@ -4201,12 +4214,13 @@
             }
             throw new Error("Failed to load static props");
           }
-          return res.json();
+          return opts.text ? res.text() : res.json();
         });
       }
       function fetchNextData(
         dataHref,
         isServerRender,
+        text,
         inflightCache,
         persistCache
       ) {
@@ -4217,7 +4231,10 @@
         }
         return (inflightCache[cacheKey] = fetchRetry(
           dataHref,
-          isServerRender ? 3 : 1
+          isServerRender ? 3 : 1,
+          {
+            text: text
+          }
         )
           .catch(function(err) {
             // We should only trigger a server-side transition if this was caused
@@ -4336,13 +4353,17 @@
           // Otherwise, this cause issues when when going back and
           // come again to the errored page.
           if (pathname2 !== "/_error") {
+            var ref;
             this.components[this.route] = {
               Component: Component,
               initial: true,
               props: initialProps,
               err: err,
               __N_SSG: initialProps && initialProps.__N_SSG,
-              __N_SSP: initialProps && initialProps.__N_SSP
+              __N_SSP: initialProps && initialProps.__N_SSP,
+              __N_RSC: !!((ref = Component) === null || ref === void 0
+                ? void 0
+                : ref.__next_rsc__)
             };
           }
           this.components["/_app"] = {
@@ -5280,9 +5301,13 @@
                       Component,
                       __N_SSG,
                       __N_SSP,
+                      __N_RSC,
                       isValidElementType,
                       dataHref,
-                      props;
+                      props,
+                      _this1,
+                      fresh,
+                      data;
                     return _regeneratorRuntime.default.wrap(
                       function _callee$(_ctx) {
                         while (1)
@@ -5326,7 +5351,8 @@
                                   Component: res.page,
                                   styleSheets: res.styleSheets,
                                   __N_SSG: res.mod.__N_SSG,
-                                  __N_SSP: res.mod.__N_SSP
+                                  __N_SSP: res.mod.__N_SSP,
+                                  __N_RSC: !!res.page.__next_rsc__
                                 };
                               });
                             case 11:
@@ -5338,6 +5364,7 @@
                                 (Component = ref.Component),
                                 (__N_SSG = ref.__N_SSG),
                                 (__N_SSP = ref.__N_SSP),
+                                (__N_RSC = ref.__N_RSC),
                                 ref;
                               if (true) {
                                 _ctx.next = 18;
@@ -5363,16 +5390,17 @@
                                 )
                               );
                             case 18:
-                              if (__N_SSG || __N_SSP) {
-                                dataHref = this.pageLoader.getDataHref(
-                                  (0, _utils).formatWithValidation({
+                              if (__N_SSG || __N_SSP || __N_RSC) {
+                                dataHref = this.pageLoader.getDataHref({
+                                  href: (0, _utils).formatWithValidation({
                                     pathname: pathname,
                                     query: query
                                   }),
-                                  resolvedAs,
-                                  __N_SSG,
-                                  this.locale
-                                );
+                                  asPath: resolvedAs,
+                                  ssg: __N_SSG,
+                                  rsc: __N_RSC,
+                                  locale: this.locale
+                                });
                               }
                               _ctx.next = 22;
                               return this._getData(function() {
@@ -5380,6 +5408,7 @@
                                   ? fetchNextData(
                                       dataHref,
                                       _this.isSsr,
+                                      false,
                                       __N_SSG ? _this.sdc : _this.sdr,
                                       !!__N_SSG
                                     )
@@ -5394,11 +5423,31 @@
                               });
                             case 22:
                               props = _ctx.sent;
+                              if (!__N_RSC) {
+                                _ctx.next = 29;
+                                break;
+                              }
+                              _this1 = this;
+                              _ctx.next = 27;
+                              return this._getData(function() {
+                                return _this1._getFlightData(dataHref);
+                              });
+                            case 27:
+                              var ref1;
+                              (ref1 = _ctx.sent),
+                                (fresh = ref1.fresh),
+                                (data = ref1.data),
+                                ref1;
+                              props.pageProps = Object.assign(props.pageProps, {
+                                __flight_serialized__: data,
+                                __flight_fresh__: fresh
+                              });
+                            case 29:
                               routeInfo.props = props;
                               this.components[route] = routeInfo;
                               return _ctx.abrupt("return", routeInfo);
-                            case 28:
-                              _ctx.prev = 28;
+                            case 34:
+                              _ctx.prev = 34;
                               _ctx.t1 = _ctx["catch"](0);
                               return _ctx.abrupt(
                                 "return",
@@ -5412,14 +5461,14 @@
                                   routeProps
                                 )
                               );
-                            case 31:
+                            case 37:
                             case "end":
                               return _ctx.stop();
                           }
                       },
                       _callee,
                       this,
-                      [[0, 28]]
+                      [[0, 34]]
                     );
                   })
                   .bind(this)
@@ -5453,9 +5502,9 @@
               var ref = _slicedToArray(this.asPath.split("#"), 2),
                 oldUrlNoHash = ref[0],
                 oldHash = ref[1];
-              var ref1 = _slicedToArray(as.split("#"), 2),
-                newUrlNoHash = ref1[0],
-                newHash = ref1[1];
+              var ref9 = _slicedToArray(as.split("#"), 2),
+                newUrlNoHash = ref9[0],
+                newHash = ref9[1];
               // Makes sure we scroll to the provided hash if the url/hash are the same
               if (
                 newHash &&
@@ -5559,10 +5608,10 @@
                               _ctx.next = 12;
                               return (0, _routeLoader).getClientBuildManifest();
                             case 12:
-                              var ref9;
-                              (ref9 = _ctx.sent),
-                                (rewrites = ref9.__rewrites),
-                                ref9;
+                              var ref10;
+                              (ref10 = _ctx.sent),
+                                (rewrites = ref10.__rewrites),
+                                ref10;
                               rewritesResult = (0, _resolveRewrites).default(
                                 addBasePath(addLocale(asPath, this.locale)),
                                 pages,
@@ -5639,15 +5688,17 @@
                                   .then(function(isSsg) {
                                     return isSsg
                                       ? fetchNextData(
-                                          _this.pageLoader.getDataHref(
-                                            url,
-                                            resolvedAs,
-                                            true,
-                                            typeof options.locale !==
+                                          _this.pageLoader.getDataHref({
+                                            href: url,
+                                            asPath: resolvedAs,
+                                            ssg: true,
+                                            locale:
+                                              typeof options.locale !==
                                               "undefined"
-                                              ? options.locale
-                                              : _this.locale
-                                          ),
+                                                ? options.locale
+                                                : _this.locale
+                                          }),
+                                          false,
                                           false,
                                           _this.sdc,
                                           true
@@ -5755,6 +5806,29 @@
               });
             }
           },
+          {
+            key: "_getFlightData",
+            value: function _getFlightData(dataHref) {
+              var _this = this;
+              var ref = new URL(dataHref, window.location.href),
+                cacheKey = ref.href;
+              if (!this.isPreview && this.sdc[cacheKey]) {
+                return Promise.resolve({
+                  fresh: false,
+                  data: this.sdc[cacheKey]
+                });
+              }
+              return fetchNextData(dataHref, true, true, this.sdc, false).then(
+                function(serialized) {
+                  _this.sdc[cacheKey] = serialized;
+                  return {
+                    fresh: true,
+                    data: serialized
+                  };
+                }
+              );
+            }
+          },
           {
             key: "_preflightRequest",
             value: function _preflightRequest(options) {
@@ -5788,12 +5862,14 @@
                               return this.pageLoader.getMiddlewareList();
                             case 4:
                               fns = _ctx.sent;
-                              requiresPreflight = fns.some(function(
-                                middleware
-                              ) {
+                              requiresPreflight = fns.some(function(param) {
+                                var _param = _slicedToArray(param, 2),
+                                  middleware = _param[0],
+                                  isSSR = _param[1];
                                 return (0, _routeMatcher).getRouteMatcher(
                                   (0, _getMiddlewareRegex).getMiddlewareRegex(
-                                    middleware
+                                    middleware,
+                                    !isSSR
                                   )
                                 )(cleanedAs);
                               });
@@ -5873,15 +5949,15 @@
                                   this.locales
                                 ).pathname
                               );
-                              var ref10;
-                              (ref10 = prepareUrlAs(
+                              var ref11;
+                              (ref11 = prepareUrlAs(
                                 this,
                                 cleanRedirect,
                                 cleanRedirect
                               )),
-                                (newUrl = ref10.url),
-                                (newAs = ref10.as),
-                                ref10;
+                                (newUrl = ref11.url),
+                                (newAs = ref11.as),
+                                ref11;
                               return _ctx.abrupt("return", {
                                 type: "redirect",
                                 newUrl: newUrl,
@@ -5893,7 +5969,7 @@
                                 destination: preflight.redirect
                               });
                             case 24:
-                              if (!preflight.refresh) {
+                              if (!(preflight.refresh && !preflight.ssr)) {
                                 _ctx.next = 26;
                                 break;
                               }
@@ -5921,7 +5997,7 @@
             key: "_getPreflightData",
             value: function _getPreflightData(params) {
               var _this = this,
-                _this1 = this;
+                _this2 = this;
               var preflightHref = params.preflightHref,
                 _shouldCache = params.shouldCache,
                 shouldCache = _shouldCache === void 0 ? false : _shouldCache;
@@ -5949,7 +6025,8 @@
                   return {
                     redirect: res.headers.get("Location"),
                     refresh: res.headers.has("x-middleware-refresh"),
-                    rewrite: res.headers.get("x-middleware-rewrite")
+                    rewrite: res.headers.get("x-middleware-rewrite"),
+                    ssr: !!res.headers.get("x-middleware-ssr")
                   };
                 })
                 .then(function(data) {
@@ -5959,7 +6036,7 @@
                   return data;
                 })
                 .catch(function(err) {
-                  delete _this1.sde[cacheKey];
+                  delete _this2.sde[cacheKey];
                   throw err;
                 });
             }
@@ -6131,25 +6208,29 @@
       });
       exports.getMiddlewareRegex = getMiddlewareRegex;
       var _routeRegex = __webpack_require__(4095);
-      function getMiddlewareRegex(normalizedRoute) {
+      function getMiddlewareRegex(normalizedRoute, param) {
+        var catchAll = param === void 0 ? true : param;
         var result = (0, _routeRegex).getParametrizedRoute(normalizedRoute);
+        var catchAllRegex = catchAll ? "(?!_next).*" : "";
+        var catchAllGroupedRegex = catchAll ? "(?:(/.*)?)" : "";
         if ("routeKeys" in result) {
           if (result.parameterizedRoute === "/") {
             return {
               groups: {},
-              namedRegex: "^/(?!_next).*$",
-              re: new RegExp("^/(?!_next).*$"),
+              namedRegex: "^/".concat(catchAllRegex, "$"),
+              re: new RegExp("^/".concat(catchAllRegex, "$")),
               routeKeys: {}
             };
           }
           return {
             groups: result.groups,
-            namedRegex: "^".concat(
-              result.namedParameterizedRoute,
-              "(?:(/.*)?)$"
-            ),
+            namedRegex: "^"
+              .concat(result.namedParameterizedRoute)
+              .concat(catchAllGroupedRegex, "$"),
             re: new RegExp(
-              "^".concat(result.parameterizedRoute, "(?:(/.*)?)$")
+              "^"
+                .concat(result.parameterizedRoute)
+                .concat(catchAllGroupedRegex, "$")
             ),
             routeKeys: result.routeKeys
           };
@@ -6157,12 +6238,16 @@
         if (result.parameterizedRoute === "/") {
           return {
             groups: {},
-            re: new RegExp("^/.*$")
+            re: new RegExp("^/".concat(catchAllRegex, "$"))
           };
         }
         return {
           groups: {},
-          re: new RegExp("^".concat(result.parameterizedRoute, "(?:(/.*)?)$"))
+          re: new RegExp(
+            "^"
+              .concat(result.parameterizedRoute)
+              .concat(catchAllGroupedRegex, "$")
+          )
         };
       } //# sourceMappingURL=get-middleware-regex.js.map
Diff for index.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-7f284d233915b9b1.js"
+      src="/_next/static/chunks/main-c41231a97ee7e256.js"
       defer=""
     ></script>
     <script
Diff for link.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-7f284d233915b9b1.js"
+      src="/_next/static/chunks/main-c41231a97ee7e256.js"
       defer=""
     ></script>
     <script
Diff for withRouter.html
@@ -19,7 +19,7 @@
       defer=""
     ></script>
     <script
-      src="/_next/static/chunks/main-7f284d233915b9b1.js"
+      src="/_next/static/chunks/main-c41231a97ee7e256.js"
       defer=""
     ></script>
     <script

Please sign in to comment.